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

Re: Problem with zsh up-line-or-beginning-search and down-line-or-beginning-search functions



On Tue, 21 Aug 2007 13:18:12 -0400
"Bryan Jacobs" <braujac@xxxxxxxxxxx> wrote:
> When the "unset" option is off, causing zsh to prompt whenever an unknown
> parameter would be expanded, trying to trigger these functions causes an
> error message stating that "__searching" is unset.  Which it is.
> 
> Adding "emulate -L zsh; setopt unset" to the top of these two functions
> resolves the issue.

unset is in any case the default in zsh emulation, but otherwise that seems
a reasonable fix.

Index: Functions/Zle/down-line-or-beginning-search
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zle/down-line-or-beginning-search,v
retrieving revision 1.2
diff -u -r1.2 down-line-or-beginning-search
--- Functions/Zle/down-line-or-beginning-search	4 Apr 2002 11:59:10 -0000	1.2
+++ Functions/Zle/down-line-or-beginning-search	21 Aug 2007 17:27:35 -0000
@@ -1,6 +1,8 @@
 # Like down-line-or-search, but uses the whole line prefix up to the
 # cursor position for searching forwards.
 
+emulate -L zsh
+
 if [[ ${+NUMERIC} -eq 0 &&
     ( $LASTWIDGET = $__searching || $RBUFFER != *$'\n'* ) ]]
 then
Index: Functions/Zle/up-line-or-beginning-search
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/Zle/up-line-or-beginning-search,v
retrieving revision 1.2
diff -u -r1.2 up-line-or-beginning-search
--- Functions/Zle/up-line-or-beginning-search	4 Apr 2002 11:59:10 -0000	1.2
+++ Functions/Zle/up-line-or-beginning-search	21 Aug 2007 17:27:35 -0000
@@ -1,6 +1,8 @@
 # Like up-line-or-search, but uses the whole line prefix up to the
 # cursor position for searching backwards.
 
+emulate -L zsh
+
 if [[ $LBUFFER == *$'\n'* ]]; then
   zle .up-line-or-history
   __searching=''


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


.



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