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

Re: _expand_alias does not expand aliases that contain an "!"



On Oct 1,  5:39pm, Peter Stephenson wrote:
} Subject: Re: _expand_alias does not expand aliases that contain an "!"
}
} On Wed, 01 Oct 2014 09:29:34 -0700
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > Maybe we just need something along the lines of makecommaspecial() that
} > can be called from hbegin() to set ISPECIAL on bangchar, and called in
} > the completion code to temporarily switch it off/on.
} > 
} > Then inittyptab() never has to mess with examining bangchar, and the
} > new makebangspecial() can be called from histcharsetfn() instead of
} > doing a full inittyptab().
} 
} That certainly sounds possible, if you know where to put those calls.
} 
} Here's the other proposal, done entirely local to inittyptab(), and
} untested.

This looks fine, though it doesn't solve the problem of needing to turn
off special-ness during completion.

Of course there's a conflict:  If completion does not include expansion,
then bangchar should be quoted if it results from completion.  Otherwise
it will already have expanded and therefore appear only where it does
not need quoting (theoretically).  Of course history expansion could
produce a string containing yet another bangchar, which would then be
subject to history expansion AGAIN upon accept-line.  (I suppose the
fact this has never been mentioned shows how rare it is in practice.)

Let me see if I can produce a patch for this (and back out the changes
to _expand_alias) before you do 5.0.7.



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