Major key engine rewrite, by Dan Langlois and Will Dey (wi11dey).
Much thanks to them, the mode is now more efficient and powerful.
Now it works with magit.
The minor mode can be turned on and off.
More efficient when you switch between command/insert modes.
The code is updated on github. And probably on MELPA already or later today.
For user, it should not have any visible changes.
The older version is still available, named xah-fly-keys_old_2020-04-18.el
on github.
I'm still going thru the code.
Still need to update my page about customization and how it works.
I'll be working on them in the next few days.
Following i start to write notes about changes. Mostly just for myself, as i update my docs.
new customizable variables:
xah-fly-use-isearch-arrows
xah-fly-use-esc-c-g
internal change:
now uses byte-compile-dynamic
xah-fly--define-keys is now a macro. This means, now you can bind your fav M-x replacement, such as smex, helm-M-x, counsel-M-x, execute-extended-command.
fix isearch exit becomes insert mode but cursor shape does not change. this fixed it(add-hook 'isearch-mode-end-hook 'xah-fly-command-mode-activate), but need to see why is it necessary.
xah-fly-key--current-layout is declared obsolete and becomes xah-fly-key-current-layout. xah-fly-key--current-layout is only used once. Probably want to remove it.
Fixed recursive loading error when setting a layout. this is done by remove (load "xah-fly-keys"). need to check consequences and if it's proper fix.
The layout options are now symbol instead of string. consider change back to string only.
use of widget-prompt-value. consider not using it.
Saw your notes in your blog and think I figured out why the recursive-load
was happening: because of the way the Customize interface works, it tries
to use the setter (same as the custom-set property) to set the default
value. However, the setter is xah-fly-keys-set-layout, which reloads the
file to update the keybindings to the new layout. Loading the file again
calls the setter again which reloads the file, etc which causes the recursive
load.
I've fixed this by not making the Customize interface dependent on xah-fly-keys-set-layout
and only have it reload the file if it was already loaded and the new value
is different than the old one. Otherwise, the bindings will not be updated
to use the new layout when people set the layout through Customize. (Also
removed the extra quote I added for the Customize choices)
xah-fly-keys-set-layout just calls the same function that Customize
would have, for people who don't like the Customize interface or just want
to do it lisp-only. The widget-prompt-value just asks the human-friendly
names for the keyboard layouts during completion, but it will never be
called for users who don't call xah-fly-keys-set-layout interactively.
Note: doing (setq xah-fly-key-current-layout 'qwerty) before it is loaded
is the same as calling xah-fly-keys-set-layout after it is loaded, and
will speed up your init slightly since the file will only be loaded once.
As for the isearch: I think your solution with the isearch hooks is
a good one, since isearch only tries to be careful if a transient map is
started during isearch, but it replaces any maps that were there before
it. This is bad behavior on the part of isearch (and I might try to make
a change to upstream Emacs to convert it to set-transient-keymap too π),
but for now it is ok to use the hooks since isearch is an exception to
how modes should interact.
Emacs: Insert Brackets by Pair π
renamed some functions
by remove non-ascii
, e.g. xah-insert-double-curly-quoteββ
is now
xah-insert-double-curly-quote