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

Re: which-command help



Bart Schaefer wrote:
> } > Suppose you have
> } > 
> } >   alias LL='ls -lL'
> } > 
> } > Do you want run-help to display the man page for "ls", or do you want it
> } > to simply fail because there is no LL command?
> } 
> } Actually, it *doesn't* fail after the patch:
> 
> I know which-command doesn't fail.  What about run-help?

Oh, I see, it's one of those annoying messages you actually have to read
to see what it says.

Well, the simplest way around is something like the following... this
may be OK because we're only dealing with builtin widgets with fixed
names here.

Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.51
diff -u -r1.51 zle_tricky.c
--- Src/Zle/zle_tricky.c	23 Feb 2005 13:50:45 -0000	1.51
+++ Src/Zle/zle_tricky.c	17 May 2005 17:44:25 -0000
@@ -2390,9 +2390,12 @@
 processcmd(UNUSED(char **args))
 {
     char *s;
-    int m = zmult;
+    int m = zmult, na = noaliases;
 
+    if (!strcmp(bindk->nam, "which-command"))
+	noaliases = 1;
     s = getcurcmd();
+    noaliases = na;
     if (!s)
 	return 1;
     zmult = 1;

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


**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

**********************************************************************



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