xahlee / xah-fly-keys

the most efficient keybinding for emacs
http://xahlee.info/emacs/misc/xah-fly-keys.html
484 stars 83 forks source link

Byte-compilation prevents functioning of control/meta key settings #98

Open rjhwelsh opened 4 years ago

rjhwelsh commented 4 years ago

Hi,

If I try byte-compiling my init for xah-fly-keys, it causes the customizations xah-fly-use-meta-key and xah-fly-use-control-key to not be picked up, before loading the xah-fly-keys package. (And all my control/meta keys are bound up by the xah-fly-keys package.)

As a workaround, I can add ;;; xah-fly-keys-config.el --- -*- no-byte-compile: t -*- to my config file; and everything works fine. Perhaps it's my fault, and I shouldn't try to byte-compile everything ;P.

On the other hand, I was thinking maybe it would be cleaner to package the keybindings into a function, which could be called when the user enables (xah-fly-keys 1) for the first time. Any thoughts on this?

(PS I am happy to do the work and submit a pull-request, if you think it might be a good idea.)

My current config, for reference, (tested with xah-fly-keys_old_2020-04-18.el). ;;; xah-fly-keys-config.el --- -*- no-byte-compile: t -*- (setq xah-fly-use-meta-key nil) (setq xah-fly-use-control-key nil) (use-package "xah-fly-keys" :ensure t :init (require 'xah-fly-keys) (xah-fly-keys-set-layout 'colemak) (xah-fly-keys 1) )

All the best, R

ghost commented 3 years ago

Is this still happening? I used the following config and it worked:

(use-package xah-fly-keys
  :custom
  (xah-fly-keys-set-layout "dvorak")
  (xah-fly-use-control-key nil)
  (xah-fly-use-meta-key nil)
  :config
  (xah-fly-keys t))