On Thursday, February 20, 2014, Phil Pennock < zsh-workers+phil.pennock@spodhuis.org> wrote: > On 2014-02-20 at 13:06 -0800, Dave Yost wrote: > > It would be nice to be able similarly to temporarily set an option. > > Anonymous function. > > (){ setopt localoptions xtrace; ls } > Also the emulate command: emulate zsh -o pushdSilent -c 'pushd Desktop' But in most cases a function with localoptions is what you want. Incidentally, note that the behavior of var=value command depends on what the command is. If it's an external command, the variable is not just temporarily set, it's temporarily exported into the environment. For certain builtins the variable becomes permanently set.