zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@sunsite.dk
Subject: Re: run-help's man arguments
Date: Fri, 05 Jun 2009 22:53:30 -0700	[thread overview]
Message-ID: <090605225330.ZM551@torch.brasslantern.com> (raw)
In-Reply-To: <C141D892-5C34-428A-87C2-4ABC5A60BFC1@kba.biglobe.ne.jp>

On Jun 6, 12:52pm, Jun T. wrote:
} Subject: Re: run-help's man arguments
}
} I'm not familiar with zsh internals, but I think ESC-h (in the default  
} bindings) is bound to the ZLE widget 'run-help' which calls the  
} function "run-help" as "run-help $1".

You have a point there.  PWS, how did you manage to get run-help to
pass the entire locate command line to "man $@:t"?

The only time the whole command line is obtained is when there's a
function or alias named (in this example) "run-help-locate".

The only OTHER time multiple arguments are in $@ is when $1 is quoted
so the command is re-applied to ${(Q)1}, but in that case $@ is the
output from "whence", not the original command line.

} So "man $@:t" in the function is equivalent to "man $1:t" if called
} from the widget.

True except in the second of those latter two cases.
 
} I believe most people use the run-help function via key binding, but  
} there is a possibility that someone use it by explicitly typing it. Or  
} by "alias m=run-help" and "m history", "m 3 printf" etc.

That's the sort of "against the spirit" and "well-hidden" behavior to
which PWS referred.  Also note that "m 3 printf" will produce a bunch
of errors about not finding "3" before it gets around to running "man",
so it's not a particularly good use of run-help.


  reply	other threads:[~2009-06-06  5:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 11:10 Peter Stephenson
2009-06-05 15:14 ` Bart Schaefer
2009-06-06  3:52 ` Jun T.
2009-06-06  5:53   ` Bart Schaefer [this message]
2009-06-08  8:52     ` Peter Stephenson
2009-06-08 13:54       ` Clint Adams
2009-06-08 14:03         ` Peter Stephenson
2009-06-08 16:06           ` Bart Schaefer
2009-06-08 16:36             ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=090605225330.ZM551@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).