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

Re: READNULLCMD: its process and completion



On Tue, 30 Sep 2008 22:37:48 -0400 (EDT)
"Benjamin R. Haskell" <zsh@xxxxxxxxxx> wrote:
> Two issues related to READNULLCMD (one of the features I looove about 
> Zsh):
> 
> 
> 1. There's something weird about completion of 'init.d' scripts with the 
> '<filename' form. The simplest example I could find:

There certainly is:  completion for these files is in
Completion/Unix/Command/_init_d which asks to be called as

#compdef -p */(init|rc[0-9S]#).d/*

in other words *any* completion from *anywhere* involving files in an init
and an rc directory tries to treat it as if it was a service to be started
or stopped.  It seems hard to believe this is the right thing to do.

> 2. There's something different about the way READNULLCMD gets called. My 
> normal PAGER is less:
> 
> $ env | grep less
> READNULLCMD=less
> PAGER=less
> LESSOPEN=|lesspipe.sh %s
> 
> Using 'less' as my READNULLCMD like that, it doesn't respect the LESSOPEN 
> variable.

That's because the file is coming from stdin, so it doesn't see the file
name and can't tell it's a .html file.  It's a necessary feature of the way
READNULLCMD works that it does read from stdin, so that can't really be
changed.  However, there may be a workaround.

-- 
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