Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] out of memory error after "edit-command-line"



> 2022/10/19 0:07, Jun. T <takimoto-j@xxxxxxxxxxxxxxxxx> wrote:
> 
> EMACS/VI:
> % bindkey -v
> % () { setopt localoptions emacs; }
> % (still using emacs binding)
> We need to restore the keymap in doshfunc() as in dosetopt().

Sorry, I reconsidered this.

zle builtin has an option '-K keymap' to temporarily change the
keymap. I think users need not (or should not) use
'setopt localoptions emacs'.

Use of EMACS/VI should be highly discouraged, since turning them off
has no effect, and they are meaningless if a user-defined keymap
is in use.
Moreover, even with my patch, the following does not work:

% export VISUAL=vim
% zsh -f
% (vi keymap, but VI is not set)
% () { setopt localoptions emacs; ... }
% (now emacs keymap)

Instead of fixing this problem, I feel it is better to do
nothing for 'setopt localoptions emacs'. Then keymap is not
restored, but we can just say "please use zle -K".

Maybe we can add some more comments to the description of
EMACS and VI options in zshoptions(1), indicating that
use of these options is _highly_ discouraged.

Or should we try to restore the keymap?




Messages sorted by: Reverse Date, Date, Thread, Author