From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24032 invoked by alias); 27 Sep 2011 14:17:57 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16446 Received: (qmail 22597 invoked from network); 27 Sep 2011 14:17:56 -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 closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <110927071736.ZM25114@torch.brasslantern.com> Date: Tue, 27 Sep 2011 07:17:36 -0700 In-reply-to: Comments: In reply to "Benjamin R. Haskell" "Re: zshaddhistory confusion" (Sep 26, 11:01pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: zshaddhistory confusion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Sep 26, 11:01pm, Benjamin R. Haskell wrote: } } The following doesn't seem to work, though I'd have thought it would } based on the documentation... } } zshaddhistory () { } fc -p ~/.zsh_history_detail } print -sr -- "${1%%$'\n'} ### ${PWD} $(date '+%Y-%m-%d %R')" } fc -P } } "Doesn't work" how? What does it [not] do that you were expecting? A hook function may call `fc -p ...' to switch the history context so that the history is saved in a different file from the that in the global HISTFILE parameter. This is handled specially: the history context is automatically restored after the processing of the history line is finished. What "handled specially" means here is that pushing the history stack when you are inside the history hook automatically disables writing to the normal history file, regardless of whether you "return 1" or call "fc -P" or anything else. That should probably be made more explicit in the doc, the only thing it's describing is the implicit "fc -pa".