Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: emulate zsh *except* pushd related options
- X-seq: zsh-users 21097
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: emulate zsh *except* pushd related options
- Date: Tue, 22 Dec 2015 20:57:47 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=Od72YJ+ze2vL4mSy3T91q+tPZS5Cm8lsiF9J+dRcVvg=; b=L34QBrj/xKlXYFQo5+emsMhNFnOAYtn06DYdKNyo9uc+D7dxao80rkOPZvUZ9yhNpR 0aICNe2YhkLvzdPa4R3wvxanL38n/1E4yNfzBBdunsEbx7liW0jPtdiSJbJIGe5ZlJu7 uDn1OvFWstpUWRB4eG791Hxxfl1Vxzw+v2wokx9uGWEt4+gSNvRTCgXFr4NNHEsqYUC9 opdXUX+ilfw+mDBK+u6ibaaT4z/5uDU8h+ut3qxsjIRBRbZcaflqN25HAYjNc56ToBj+ tR4+u+LncemvKeS3fFYGEKie5vlWkfYWDCxjgP5EU+7qR6Q9SJZ7LtZtIC6NvVRNOGR/ GnNg==
- In-reply-to: <20151222083043.GA6457@linux.vnet.ibm.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20151222083043.GA6457@linux.vnet.ibm.com>
On Dec 22, 9:30am, Dominik Vogt wrote:
}
} Is there a (safe!) way to say "emulate zsh but don't touch certain options"?
The "emulate" command accepts the same "-o optionn_name" (or "+o") as
shell startup, so you can do
emulate -L zsh -o shwordsplit ...
For your specific use case, the current state of the pushd and cd options
can be enumerated this way:
${(Oa)${${(kv)options[(I)*pushd*|cd*|*cd]/off/+o}/on/-o}}
That won't work in general because some options have "on" as a substring
of the option name.
So if your autoloaded function begins with:
emulate -L zsh -o shwordsplit \
${(Oa)${${(kv)options[(I)*pushd*|cd*|*cd]/off/+o}/on/-o}}
you should get what you want.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author