From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27415 invoked by alias); 21 Oct 2011 15:34:56 -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: 29841 Received: (qmail 16243 invoked from network); 21 Oct 2011 15:34:43 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at klanderman.net does not designate permitted sender hosts) From: Greg Klanderman To: zsh-workers@zsh.org Subject: Re: reading/saving history file dependent on isset(RCS) Reply-To: gak@klanderman.net Date: Fri, 21 Oct 2011 11:26:14 -0400 In-Reply-To: <111021054029.ZM15446@torch.brasslantern.com> (Bart Schaefer's message of "Fri, 21 Oct 2011 05:40:29 -0700") Message-ID: User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.17 (linux) References: <20127.6190.501587.50858@gargle.gargle.HOWL> <111020001018.ZM9637@torch.brasslantern.com> <111021054029.ZM15446@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >>>>> On October 21, 2011 Bart Schaefer wrote: > On Oct 20, 12:55pm, Greg Klanderman wrote: > } > } Based on there being no default setting for HISTFILE, can the > } isset(RCS) check can be safely removed for the readhistfile() call? > Something you said tripped a synapse. > No, this can't be safely removed. > I now seem to recall that this was added when sourcing /etc/zshenv was > exempted from NO_RCS. If the system zshenv sets HISTFILE or SAVEHIST, > then you can get bad side-effects even with "zsh -f" unless NO_RCS > suppresses history file management. Thank you for looking into this Bart. Do you still object if both the guard against reading and saving are removed? In that case, if /etc/zshenv were to set HISTFILE/SAVEHIST, then the HISTFILE should not get clobbered. I guess given the multitude of ways one could get shot in the foot via stuff in /etc/zshenv, guarding against just this one seems a bit pointless, but I can deal with it. Hmm one other proposal for you to consider - how about changing the logic to use the value of isset(RCS) from *before* any init scripts were loaded to condition reading/saving the history file? In that case, 'zsh -f' would inhibit history reading/saving, but having 'setopt norcs' in one of your init scripts would not. thanks, Greg