about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-07-20 18:59:15 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-07-20 18:59:15 +0000
commitc42ae31a190834df88af3339465e4ee2429b7592 (patch)
tree92f9307b5b76cae36cce58d07178db7fe6b7507b /Doc
parentbaee5347e4b099ae2306cd119cba4d5059b8b6f3 (diff)
downloadzsh-c42ae31a190834df88af3339465e4ee2429b7592.tar.gz
zsh-c42ae31a190834df88af3339465e4ee2429b7592.tar.xz
zsh-c42ae31a190834df88af3339465e4ee2429b7592.zip
28081: cdr tweaks
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/contrib.yo18
1 files changed, 17 insertions, 1 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index ca00ad118..e33ac9b9e 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -453,12 +453,28 @@ are shown first.  The special value tt(+) can appear in the list to
 indicate the default file should be read at that point.  This allows
 effects like the following:
 
-example(zstyle recent-dirs-file ':chpwd:*' \ 
+example(zstyle ':chpwd:*' recent-dirs-file \ 
 ~/.chpwd-recent-dirs-${TTY##*/} +)
 
 Recent directories are read from a file numbered according to
 the terminal.  If there are insufficient entries the list
 is supplemented from the default file.
+
+It is possible to use tt(zstyle -e) to make the directory configurable
+at run time:
+
+example(zstyle -e ':chpwd:*' recent-dirs-file pick-recent-dirs-file
+pick-recent-dirs-file() {
+  if [[ $PWD = ~/text/writing(|/*) ]]; then
+    reply=(~/.chpwd-recent-dirs-writing)
+  else
+    reply=(+)
+  fi
+})
+
+In this example, if the current directory is tt(~/text/writing) or a
+directory under it, then use a special file for saving recent
+directories, else use the default.
 )
 item(tt(recent-dirs-insert))(
 Used by completion.  If tt(recent-dirs-default) is true, then setting