about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2015-02-03 17:12:41 +0000
committerPeter Stephenson <pws@zsh.org>2015-02-03 17:13:26 +0000
commit79378d4acde71db54c4ed6636a0695741bb467fc (patch)
tree4521ec16ffb4a17625b0fb269d08ee8f5a41a5f1 /Doc
parent1f62d8d0be7290883991fb4de640fbecb7714917 (diff)
downloadzsh-79378d4acde71db54c4ed6636a0695741bb467fc.tar.gz
zsh-79378d4acde71db54c4ed6636a0695741bb467fc.tar.xz
zsh-79378d4acde71db54c4ed6636a0695741bb467fc.zip
users/19800: more help for $HISTORY_IGNORE
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/params.yo23
1 files changed, 19 insertions, 4 deletions
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index 391a5fb0a..ee7c05412 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1052,10 +1052,25 @@ item(tt(HISTORY_IGNORE))(
 If set, is treated as a pattern at the time history files are written.
 Any potential history entry that matches the pattern is skipped.  For
 example, if the value is `tt(fc *)' then commands that invoke the
-interactive history editor are never written to the history file (compare
-the tt(HIST_NO_STORE) option or the tt(zshaddhistory) hook, either of
-which would prevent such commands from being added to the interactive
-history at all).
+interactive history editor are never written to the history file.
+
+Note that tt(HISTORY_IGNORE) defines a single pattern: to
+specify alternatives use the `tt(+LPAR()first|second|...+RPAR())'
+syntax.
+
+Compare the tt(HIST_NO_STORE) option or the tt(zshaddhistory) hook,
+either of which would prevent such commands from being added to the
+interactive history at all.  If you wish to use tt(HISTORY_IGNORE) to
+stop history being added in the first place, you can define the
+following hook:
+
+example(zshaddhistory+LPAR()RPAR() {
+  emulate -L zsh
+  ## uncomment if HISTORY_IGNORE
+  ## should use EXTENDED_GLOB syntax
+  # setopt extendedglob
+  [[ $1 != ${~HISTORY_IGNORE} ]]
+})
 )
 vindex(HISTSIZE)
 item(tt(HISTSIZE) <S>)(