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

Re: PATCH: WORDCHARS and emulate



On Dec 5,  2:55am, Phil Pennock wrote:
} Subject: PATCH: WORDCHARS and emulate
}
} This patch sets wordchars on startup according to emulation mode and
} resets it upon an 'emulate' command.  Yes, it gets totally clobbered by
} emulate.

This is not a reasonable side-effect of "emulate."  LOTS of shell functions,
including those in the zsh distribution that are used for completions etc.,
call "emulate".  If it's going to change anything like WORDCHARS, it has to
save it and restore it when the emulation mode ceases to be in effect.  And
since the only thing that tracks emulation mode is "setopt localoptions",
it's in effect impossible to save and restore anything other than options
during emulation.

So you could conceivably do this by having an option to turn WORDCHARS on
and off, and arrange that "emulate -R" always unsets that option; and then
have values for the internal wordchars array that are independent of the
WORDCHARS variable and which get switched in depending on the emulation.
But you can't stomp WORDCHARS itself.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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