From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: [PATCH] Clarifying "hash" and "whence" documentation
Date: Mon, 31 Oct 2022 16:44:06 -0700 [thread overview]
Message-ID: <CAH+w=7ZEgD9qsQTyQNVakxpPoa_vyRe0t7t6wFoc1L0udfQmCg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 32 bytes --]
See users/28295 and users/28296
[-- Attachment #2: hashing.txt --]
[-- Type: text/plain, Size: 2932 bytes --]
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index dd54a0fc8..b6217f66d 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -1052,9 +1052,11 @@ The choice of hash table to work on is determined by the tt(-d) option;
without the option the command hash table is used, and with the option the
named directory hash table is used.
-A command var(name) starting with a tt(/) is never hashed, whether by
-explicit use of the tt(hash) command or otherwise. Such a command
-is always found by direct look up in the file system.
+A command var(name) starting with a tt(/) or with a relative path
+starting with tt(./) or tt(../) is never executed by lookup in
+the command hash table, and these can only be added to the table by
+explicit use of the tt(hash) command. Such a command is always
+found by direct look up in the file system.
Given no arguments, and neither the tt(-r) or tt(-f) options,
the selected hash table will be listed in full.
@@ -1063,9 +1065,11 @@ The tt(-r) option causes the selected hash table to be emptied.
It will be subsequently rebuilt in the normal fashion.
The tt(-f) option causes the selected hash table to be fully
rebuilt immediately. For the command hash table this hashes
-all the absolute directories in the tt(PATH),
-and for the named directory hash table this adds all users' home directories.
+all (and em(only)) the absolute directories in the tt(PATH),
+and for the named directory hash table this adds all users' home
+directories.
These two options cannot be used with any arguments.
+Both options remove any explicitly-added elements.
The tt(-m) option causes the arguments to be taken as patterns
(which should be quoted) and the elements of the hash table
@@ -2523,11 +2527,14 @@ item(tt(-a))(
Do a search for all occurrences of var(name)
throughout the command path.
Normally only the first occurrence is printed.
+When combined with tt(-m), only names appearing in the command hash
+table are searched, but all occurrences of those names are printed.
)
item(tt(-m))(
The arguments are taken as patterns (pattern characters should be
-quoted), and the information is displayed for each command matching one
-of these patterns.
+quoted), and the information is displayed for each entry in the command
+hash table matching one of these patterns. The hash table is first
+refilled, in case of changes to tt(PATH).
)
item(tt(-s))(
If a pathname contains symlinks, print the symlink-free pathname as well.
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index b543d1c38..2a30085a8 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -1414,6 +1414,7 @@ An array (colon-separated list)
of directories to search for commands.
When this parameter is set, each directory is scanned
and all files found are put in a hash table.
+Directories named by relative path are not scanned for hashing.
)
vindex(POSTEDIT)
item(tt(POSTEDIT) <S>)(
reply other threads:[~2022-10-31 23:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAH+w=7ZEgD9qsQTyQNVakxpPoa_vyRe0t7t6wFoc1L0udfQmCg@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@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).