From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7101 invoked by alias); 16 Oct 2013 05:24:42 -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: 31826 Received: (qmail 29145 invoked from network); 16 Oct 2013 05:24:36 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 From: Bart Schaefer Message-id: <131015222504.ZM3017@torch.brasslantern.com> Date: Tue, 15 Oct 2013 22:25:04 -0700 In-reply-to: <20131015175838.19f0256d@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Re: Finer control over what gets written to the history file" (Oct 15, 5:58pm) References: <131015094100.ZM2399@torch.brasslantern.com> <20131015175838.19f0256d@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: Finer control over what gets written to the history file MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Incidentally ... On Oct 15, 5:58pm, Peter Stephenson quoted the docs: > > zshaddhistory > The following example function first adds the history line to > the normal history with the newline stripped, which is usually > the correct behaviour. Then it switches the history context so > that the line will be written to a history file in the current > directory. > > zshaddhistory() { > print -sr -- ${1%%$'\n'} > fc -p .zsh_local_history > } This doesn't quite work, does it? The missing bit being that you also must have INC_APPEND_HISTORY set, otherwise the stack is popped before anything is written.