zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: whence (was Re: local unfunction)
Date: Wed, 4 Apr 2018 18:41:53 -0700	[thread overview]
Message-ID: <f41055e7-6ad9-b54f-2b95-0e60f0b98d3c@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7a=5F31DYVdXH5HRJVS7V_BYCkJihznYo2TFhBMVX+BFA@mail.gmail.com>

On 04/04/18 05:20 PM, Bart Schaefer wrote:
>
> It's important to note that "whence -m" is doing pattern matching on
> strings, not filename generation.  It's not meant to search for files
> in $PATH, it's meant to do "hash -m

But what is the real world relevance of 'hash -m'?  From almost the 
beginning of my experience with Linux and zsh one has the need to know 
what " $ [command] ENTER " is likely to do, especially in tricky 
situations where there  are scripts and aliases and links and functions 
and builtins and files that might share the same name.  One is pointed 
to whence as the utility that answers that question, but it does not 
answer it accurately when it comes to files.  One way or another, the 
dot directory is simply mishandled, I think that's inescapable.  And the 
other strange things might seem rational as far as the hash table goes, 
but they sure aren't rational as far as using whence for what everyone 
says it is supposed to do and which it almost does do except for the 
anomalies -- find things that execute.  Perhaps whence should be left as 
a curiosity and another builtin developed that does what I think whence 
should do and what needs to be done -- show everything executable named 
[PATTERN] ... all the time.  The pie can be sliced into three clearly 
understandable, non overlapping pieces: 1) Non-file stuff: aliases, 
builtins, etc. 2) Executable files and links on the path.  3) Non 
executable files on the path that zsh will search for in case of " $ 
source [name] ".  Patterns matched if patterns supplied.  Throw in a few 
verbosity levels and that's that.  It could be so simple.



  reply	other threads:[~2018-04-05  2:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31 15:25 Bart Schaefer
2018-03-31 17:21 ` Ray Andrews
2018-04-01  1:18   ` Bart Schaefer
2018-04-01  4:29     ` Ray Andrews
2018-04-01 17:33     ` Daniel Shahaf
2018-04-01 18:17       ` Bart Schaefer
2018-04-04 18:10         ` Daniel Shahaf
2018-04-05  0:20           ` Bart Schaefer
2018-04-05  1:41             ` Ray Andrews [this message]
2018-04-05  5:08               ` Bart Schaefer
2018-04-05 14:28                 ` Ray Andrews

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=f41055e7-6ad9-b54f-2b95-0e60f0b98d3c@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --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).