zsh-workers
 help / color / mirror / code / Atom feed
* Why run-help gets the expanded command?
@ 2009-02-20 13:53 Jörg Sommer
  2009-02-20 21:43 ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Jörg Sommer @ 2009-02-20 13:53 UTC (permalink / raw)
  To: zsh-workers

Hi,

I've defined some aliases like wget='noglob wget'. Running run-help
(ESC h) for these commands gives me the help for noglob. I've checked and
run-help is called with noglob, i.e. the expanded command and not the one
typed in by the user. I didn't found where run-help gets called to fix it
there. The other way would be to use getln to get the correct command
line and use this in run-help. Which one would you prefer?

Bye, Jörg.
-- 
“UNIX was not designed to stop people from doing stupid things, because
 that would also stop them from doing clever things.”
            (Doug Gwyn)


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why run-help gets the expanded command?
  2009-02-20 13:53 Why run-help gets the expanded command? Jörg Sommer
@ 2009-02-20 21:43 ` Peter Stephenson
  2009-02-21  1:25   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2009-02-20 21:43 UTC (permalink / raw)
  To: zsh-workers

On Fri, 20 Feb 2009 13:53:20 +0000 (UTC)
Jörg Sommer <joerg@alea.gnuu.de> wrote:
> I've defined some aliases like wget='noglob wget'. Running run-help
> (ESC h) for these commands gives me the help for noglob. I've checked and
> run-help is called with noglob, i.e. the expanded command and not the one
> typed in by the user.

I'm not quite sure what that was trying to achieve, since it doesn't do
this for which-command.  It was possibly a better guess with older
versions of run-help, but the current one will actually track back through
aliases to see what commands they call so it's particularly unhelpful to
be stuck with the noglob.

Index: Src/Zle/zle_tricky.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Zle/zle_tricky.c,v
retrieving revision 1.98
diff -u -r1.98 zle_tricky.c
--- Src/Zle/zle_tricky.c	5 Jan 2009 11:14:53 -0000	1.98
+++ Src/Zle/zle_tricky.c	20 Feb 2009 21:41:10 -0000
@@ -2799,8 +2799,7 @@
     char *s;
     int m = zmult, na = noaliases;
 
-    if (!strcmp(bindk->nam, "which-command"))
-	noaliases = 1;
+    noaliases = 1;
     s = getcurcmd();
     noaliases = na;
     if (!s)

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why run-help gets the expanded command?
  2009-02-20 21:43 ` Peter Stephenson
@ 2009-02-21  1:25   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2009-02-21  1:25 UTC (permalink / raw)
  To: zsh-workers

On Feb 20,  9:43pm, Peter Stephenson wrote:
} Subject: Re: Why run-help gets the expanded command?
}
} On Fri, 20 Feb 2009 13:53:20 +0000 (UTC)
} Jorg Sommer <joerg@alea.gnuu.de> wrote:
} > I've defined some aliases like wget='noglob wget'. Running run-help
} > (ESC h) for these commands gives me the help for noglob. I've checked and
} > run-help is called with noglob, i.e. the expanded command and not the one
} > typed in by the user.
} 
} I'm not quite sure what that was trying to achieve, since it doesn't do
} this for which-command.

It's trying to do the right thing for the dirt-simple default which is
"alias run-help=man" rather than the right thing for the autoloadable
shell function function named "run-help" that is now supplied with the
distribution (but might not always be available and might not be in use
even if it is available).


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-21  1:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-20 13:53 Why run-help gets the expanded command? Jörg Sommer
2009-02-20 21:43 ` Peter Stephenson
2009-02-21  1:25   ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).