zsh-workers
 help / color / mirror / code / Atom feed
From: Vincent Lefevre <vincent@vinc17.net>
To: zsh-workers@zsh.org
Subject: Re: completion for "info -f" does not work
Date: Tue, 22 Mar 2022 14:32:22 +0100	[thread overview]
Message-ID: <20220322133222.GB708813@cventin.lip.ens-lyon.fr> (raw)
In-Reply-To: <420E9029-D5DB-4621-80E2-3BF7A86997B0@kba.biglobe.ne.jp>

On 2022-03-22 18:46:13 +0900, Jun T wrote:
> > zira% touch for-test-only.info
> > zira% info -f for-test-only
> > info: for-test-only: No such file or directory
> 
> I can't reproduce this. Which version of info are you using?

info (GNU texinfo) 6.8

from the info 6.8-4+b1 Debian package (Debian/unstable).

But I've just found that this is due to my INFOPATH environment
variable, which is set to "$HOME/share/info". See below.

> info command has an (undocumented) option -x for setting the
> debug level.
> 
> % info -x 1 -f for-test-only    # use -x 2 for more verbose output
> info: looking for file "for-test-only"
> info: looking for file for-test-only in /usr/share/info
> info: looking for file for-test-only in /home/takimoto/.local/share/info
> info: looking for file for-test-only in .
> info: found file ./for-test-only.info

cventin% info -x 1 -f for-test-only
info: looking for file "for-test-only"
info: looking for file for-test-only in /home/vlefevre/share/info
info: looking for file for-test-only in /usr/share/info
info: for-test-only: No such file or directory

cventin% unset INFOPATH
cventin% info -x 1 -f for-test-only
info: looking for file "for-test-only"
info: looking for file for-test-only in /usr/share/info
info: looking for file for-test-only in /home/vlefevre/share/info
info: looking for file for-test-only in .
info: found file ./for-test-only.info

This actually behaves as documented:

     Directories specified in the environment variable 'INFOPATH' are
     added to the directories specified with '--directory', if any.  The
     value of 'INFOPATH' is a list of directories usually separated by a
     colon; on MS-DOS/MS-Windows systems, the semicolon is used.  If the
     value of 'INFOPATH' ends with a colon (or semicolon on
     MS-DOS/MS-Windows), the initial list of directories is constructed
     by appending the build-time default to the value of 'INFOPATH'.

     If you do not define 'INFOPATH', Info uses a default path defined
     when Info was built as the initial list of directories.

     Regardless of whether 'INFOPATH' is defined, the default
     documentation directory defined when Info was built is added to the
     search path.  If you do not want this directory to be included, set
     the 'infopath-no-defaults' variable to 'On' (*note
     infopath-no-defaults::).

(BTW, I'm wondering whether there could be a security issue with "."
in the default info path.)

> PS
> I've surprised that 'info for-test-only' (without -f) also gives the
> same result. So I wonder what is the difference between 'info foo ...'
> and 'info -f foo ...' ?

It seems that without "-f", info first looks for menu items and
converts the argument to a filename prefix as with -f:

Example:

cventin% info -x 1 -f ls
info: looking for file "ls"
info: looking for file ls in /home/vlefevre/share/info
info: looking for file ls in /usr/share/info
info: ls: No such file or directory

cventin% info -x 1 ls
info: found file /home/vlefevre/share/info/dir
info: found file /usr/share/info/dir
info: looking for file "coreutils"
info: looking for file coreutils in /home/vlefevre/share/info
info: looking for file coreutils in /usr/share/info
info: found file /usr/share/info/coreutils.info.gz

Here, the error message is different:

cventin% info -x 1 -f does-not-exist
info: looking for file "does-not-exist"
info: looking for file does-not-exist in /home/vlefevre/share/info
info: looking for file does-not-exist in /usr/share/info
info: does-not-exist: No such file or directory

cventin% info -x 1 does-not-exist
info: found file /home/vlefevre/share/info/dir
info: found file /usr/share/info/dir
info: looking for file "does-not-exist"
info: looking for file does-not-exist in /home/vlefevre/share/info
info: looking for file does-not-exist in /usr/share/info
info: No menu item 'does-not-exist' in node '(dir)Top'

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


  reply	other threads:[~2022-03-22 13:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 17:13 Vincent Lefevre
2022-03-15 18:05 ` Peter Stephenson
2022-03-16  8:46   ` Jun T
2022-03-16 15:06     ` Peter Stephenson
2022-03-16 15:13       ` Bart Schaefer
2022-03-16 15:28       ` Jun. T
2022-03-17 16:29         ` Peter Stephenson
2022-03-18 13:59     ` Vincent Lefevre
2022-03-18 14:09       ` Vincent Lefevre
2022-03-22  9:46         ` Jun T
2022-03-22 13:32           ` Vincent Lefevre [this message]
2022-03-22  9:35       ` Peter Stephenson

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=20220322133222.GB708813@cventin.lip.ens-lyon.fr \
    --to=vincent@vinc17.net \
    --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).