From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14599 invoked by alias); 21 Feb 2014 02:45:20 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32422 Received: (qmail 15596 invoked from network); 21 Feb 2014 02:45:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=Al6CSK3QfNslyu9QHAj/IJshi3RDX8InNRg5iIYbizo=; b=UnqH8A0aZCV7gqy13V/A3mZCHcZgt3HygHWwcxCE9ySde1QQ7ejS6rYIKQkIZ4HxPN ML8h8DGXlyI7V1OKF86DbNKu8peFs9gCKtgzCtkKNVLWsC+WIqesoU1QyP2cmxvrg4ZN CIUU657yDGpfQdrdkD8fxF4paSpBISAO7E4ey72KsDSrbgCycBs8QIT/bHZQDxsMvPFG EKBD4bbw9ebSFkWamDR1s1EoRty4LBKBcgg/F7tuf/YylECPY9O0/zo+K7ZJoNDV/wEz JK+mLgoB0wu4017uOyc5k81N9pGmeb/grTCpimwM1ZhK+kSYEuwmO0+CBgNs/CDPaham G56A== X-Gm-Message-State: ALoCoQn1nig8cXvNkZL8tXYxgqeDntfcV6T8Zrbro8mE9goJ5egWZ7shxgT/ZKyuDnKdeyZheQ6N MIME-Version: 1.0 X-Received: by 10.112.63.193 with SMTP id i1mr2771859lbs.54.1392950709396; Thu, 20 Feb 2014 18:45:09 -0800 (PST) In-Reply-To: <20140220233340.GA25786@redoubt.spodhuis.org> References: <8458DC5E-E862-462A-BFCF-FFA2BDEB29C8@yost.com> <20140220233340.GA25786@redoubt.spodhuis.org> Date: Thu, 20 Feb 2014 18:45:09 -0800 Message-ID: Subject: Re: setopt temporarily? From: Bart Schaefer To: Dave Yost , "zsh-workers@zsh.org" Content-Type: multipart/alternative; boundary=001a11c3fd103938e704f2e19cd2 --001a11c3fd103938e704f2e19cd2 Content-Type: text/plain; charset=ISO-8859-1 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. --001a11c3fd103938e704f2e19cd2--