summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2013-10-16 09:49:55 +0100
committerPeter Stephenson <pws@zsh.org>2013-10-16 09:49:55 +0100
commit441c19c16147f6ce9d0748b4495892ea353a30fb (patch)
tree75b51efc5ca10cda42ab6f3a05650004c9a0ca7d
parentf6967bb745d8b44236bc32c460983d93f23d6cd9 (diff)
downloadzsh-441c19c16147f6ce9d0748b4495892ea353a30fb.tar.gz
zsh-441c19c16147f6ce9d0748b4495892ea353a30fb.zip
31872: zshaddhistory hook example needs options.
Only works with INCAPPENDHISTORY or SHAREHISTORY set.
-rw-r--r--ChangeLog5
-rw-r--r--Doc/Zsh/func.yo11
2 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a1b1f14e2..5e6333524 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-16 Peter Stephenson <p.stephenson@samsung.com>
+
+ * 31827: Doc/Zsh/func.yo: options needed for example. Only
+ works with INCAPPENDHISTORY or SHAREHISTORY.
+
2013-10-15 Peter Stephenson <p.stephenson@samsung.com>
* unposted: Doc/Zsh/func.yo: trivial typo in zshaddhistory doc.
diff --git a/Doc/Zsh/func.yo b/Doc/Zsh/func.yo
index 78bdfc0fa..1f58df86a 100644
--- a/Doc/Zsh/func.yo
+++ b/Doc/Zsh/func.yo
@@ -274,10 +274,13 @@ that in the global tt(HISTFILE) parameter. This is handled specially:
the history context is automatically restored after the processing
of the history line is finished.
-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.
+The following example function works with one of the options
+tt(INC_APPEND_HISTORY) or tt(SHARE_HISTORY) set, in order that the line
+is written out immediately after the history entry is added. It 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.
example(zshaddhistory+LPAR()RPAR() {
print -sr -- ${1%%$'\n'}