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

Re: $KEYMAP in command, isearch and menuselect



On Mon, 23 Aug 2010 10:36:38 +0100
Peter Stephenson <Peter.Stephenson@xxxxxxx> wrote:
> Basically, the only thing you can do
> is bind one of the names listed in the documentation to a different
> key. The documentation should probably be clearer the behaviour isn't
> extensible.  Internally, this is because those modes are each
> implemented within a single function, not by looking up function
> behaviour like standard editing behaviour.

(Moved to zsh-workers.)

This might clear up the documentation a bit.  isearch already has a note
about limitations thought it doesn't explicitly say you can't extend the
list of commands.

I'm now scratching my head over this in the isearch doc:

  Any multi-character string that is not bound to one of the above
  functions will beep and interrupt the search, leaving the last found
  line in the buffer. Any single character that is not bound to one of
  the above functions, or tt(self-insert) or tt(self-insert-unmeta),
  will have the same effect but the function will be executed.

I don't think this distinction exists --- I think any unrecognised
binding will have the same effect, of leaving isearch and executing
that command. Also, this is a bit confusing in that it doesn't note
that printable multibyte characters are handled they way you expect.
It might be I removed it as a side-effect of adding multibyte handling
but I don't see any evidence of the distinction being explicit in 4.2.
Maybe we were documenting some ancient restriction that went when
Zefram rewrote ZLE.

I think this can just be rewritten to say the search is interrupted and
the command executed.  I'm not convinced it even beeps (but I always
have that turned off).

Index: Doc/Zsh/mod_complist.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/mod_complist.yo,v
retrieving revision 1.29
diff -p -u -r1.29 mod_complist.yo
--- Doc/Zsh/mod_complist.yo	30 Nov 2009 17:26:54 -0000
1.29 +++ Doc/Zsh/mod_complist.yo	23 Aug 2010 09:46:26 -0000
@@ -291,7 +291,10 @@ Selecting matches is done by moving the 
 functions.  When not all matches can be shown on the screen at the
same time, the list will scroll up and down when crossing the top or
 bottom line.  The following zle functions have special meaning during
-menu selection:
+menu selection.  Note that the following always
+perform the same task within the menu selection map and cannot be
+replaced by user defined widgets, nor can the set of functions
+be extended:
 
 startitem()
 item(tt(accept-line), tt(accept-search))(
Index: Doc/Zsh/zle.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/zle.yo,v
retrieving revision 1.83
diff -p -u -r1.83 zle.yo
--- Doc/Zsh/zle.yo	11 Aug 2010 12:48:20 -0000	1.83
+++ Doc/Zsh/zle.yo	23 Aug 2010 09:46:26 -0000
@@ -1146,7 +1146,8 @@ An interrupt signal, as defined by the s
 setting, will stop the search and go back to the original line.  An
undefined key will have the same effect.  Note that the following always
 perform the same task within incremental searches and cannot be
-replaced by user defined widgets.  The supported functions are:
+replaced by user defined widgets, nor can the set of functions
+be extended.  The supported functions are:
 
 startitem()
 xitem(tt(accept-and-hold))
@@ -1888,7 +1889,10 @@ execute it.  A restricted set of editing
 mini-buffer.  Keys are looked up in the special
 tt(command) keymap, and if not found there in the main keymap.
 An interrupt signal, as defined by the stty setting, will
-abort the function. The allowed functions are:
+abort the function.  Note that the following always
+perform the same task within the tt(executed-named-cmd) environment and
+cannot be replaced by user defined widgets, nor can the set of
functions +be extended.  The allowed functions are:
 tt(backward-delete-char),
 tt(vi-backward-delete-char),
 tt(clear-screen),

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio
Limited Churchill House, Cambridge Business Park, Cowley Road,
Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



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