From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users@zsh.org
Subject: Re: zshaddhistory confusion
Date: Tue, 27 Sep 2011 07:17:36 -0700 [thread overview]
Message-ID: <110927071736.ZM25114@torch.brasslantern.com> (raw)
In-Reply-To: <alpine.LNX.2.01.1109261658500.10525@hp.internal>
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".
next prev parent reply other threads:[~2011-09-27 14:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 17:11 Jay Levitt
2011-09-27 3:01 ` Benjamin R. Haskell
2011-09-27 14:17 ` Bart Schaefer [this message]
2011-09-28 4:11 ` Benjamin R. Haskell
2011-10-01 20:44 ` Jay Levitt
2011-10-01 21:24 ` Benjamin R. Haskell
2011-10-02 0:21 ` Geoff Wing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=110927071736.ZM25114@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).