zsh-users
 help / color / mirror / code / Atom feed
* Disabling an option for a single statement
@ 2022-08-22 17:46 Zach Riggle
  2022-08-23  4:18 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Zach Riggle @ 2022-08-22 17:46 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 359 bytes --]

Hello all!

It's not uncommon that I want to disable a specific option (in my case,
cdablevars) for a single statement.

Currently, I do something like:

( setopt no_cdable_vars; echo "${(D)variable}" )


Or use an anonymous function

() { setopt local_options un_cdable_vars; echo "${(D)variable}"


Are there any easier ways to achieve this?

*Zach Riggle*

[-- Attachment #2: Type: text/html, Size: 871 bytes --]

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

end of thread, other threads:[~2022-08-23  4:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-22 17:46 Disabling an option for a single statement Zach Riggle
2022-08-23  4:18 ` 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).