zsh-workers
 help / color / mirror / code / Atom feed
* Re: zsh-4.04 and w3m browser
       [not found] <Pine.LNX.4.44.0208280943460.18602-100000@scuzzy.blorf.net>
@ 2002-08-28 17:56 ` Peter Stephenson
  2002-08-28 18:16   ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2002-08-28 17:56 UTC (permalink / raw)
  To: Zsh hackers list

Wayne Davison wrote:
> On Wed, 28 Aug 2002, Vincent Lefevre wrote:
> > But how to make it work for any command? (and that should work even
> > when there are pipes and so on.)
> 
> If there were some way to run a shell function after the user hits
> return but before the line is parsed, it would be possible for the
> function to add single quotes to all the strings of non-spaces that
> start with http: (assuming that the command-line was in a variable
> that could be modified).

I've never dared add this because it's too easy to get the shell into a
state where it will never work again.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070



**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


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

* Re: zsh-4.04 and w3m browser
  2002-08-28 17:56 ` zsh-4.04 and w3m browser Peter Stephenson
@ 2002-08-28 18:16   ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2002-08-28 18:16 UTC (permalink / raw)
  To: Zsh hackers list

On Aug 28,  6:56pm, Peter Stephenson wrote:
> Subject: Re: zsh-4.04 and w3m browser
> Wayne Davison wrote:
> > 
> > If there were some way to run a shell function after the user hits
> > return but before the line is parsed, it would be possible for the
> > function to add single quotes
> 
> I've never dared add this because it's too easy to get the shell into a
> state where it will never work again.

What about a command-not-found hook of some kind?  E.g. any time you get
command-not-found, run function X with the command line as $@.  The only
rule would be that if you get command-not-found again while inside the
command-not-found hook, the hook is not called again.

Then one could do something like

realpath=($path)
path=()
setopt noglob
function command_not_found_hook {
  local -ah path
  path=($realpath)
  setopt localoptions glob
  urlglobber "$@"
}


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

end of thread, other threads:[~2002-08-28 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Pine.LNX.4.44.0208280943460.18602-100000@scuzzy.blorf.net>
2002-08-28 17:56 ` zsh-4.04 and w3m browser Peter Stephenson
2002-08-28 18:16   ` 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).