unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Arash Esbati <arash@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Running external info within Emacs
Date: Thu, 30 Mar 2023 16:17:59 +0300	[thread overview]
Message-ID: <831ql65qew.fsf@gnu.org> (raw)
In-Reply-To: <864jq2cxsv.fsf@gnu.org> (message from Arash Esbati on Thu, 30 Mar 2023 12:56:32 +0200)

> From: Arash Esbati <arash@gnu.org>
> Date: Thu, 30 Mar 2023 12:56:32 +0200
> 
> I have an issue which I don't understand when running the external info
> within Emacs.  This is on Win10 with Msys2/MinGW64 and Emacs 30
> (bfa3500c3c).
> 
> I have an entry like this in my .bash_profile:
> 
>   export INFOPATH=$INFOPATH:/c/texlive/2023/texmf-dist/doc/info
> 
> and when I invoke 'emacs -Q' from a MinGW64 shell and eval:
> 
>   (async-shell-command "info dir")
> 
> I get:
> 
>   File: coreutils.info,  Node: dir invocation,  Next: vdir ...
> 
>   10.2 ‘dir’: Briefly list directory contents
>   ===========================================
> 
>   ‘dir’ is equivalent to ‘ls -C -b’; that is, by default files are listed
>   in columns, sorted vertically, and special characters are represented by
>   backslash escape sequences.
> 
>      *Note ‘ls’: ls invocation.
> 
> When I eval:
> 
>   (async-shell-command "info latex2e")
> 
> I get:
> 
>   info: No menu item 'latex2e' in node '(dir)Top'
> 
> When I run the command 'info latex2e' in the shell where I started
> Emacs, I get:
> 
>   Next: About this document,  Up: (dir)
> 
>   LaTeX2e: An unofficial reference manual
>   ***************************************
> 
>   This document is an unofficial reference manual (version of January
>   2023) for LaTeX2e, a document preparation system.
> 
> Emacs itself finds the manual as well when I hit 'C-h i'.  Any pointer
> why the shell-command version doesn't work?

It's hard to say.  What shell is being used to invoke commands via
async-shell-command?  What value of INFOPATH does the stand-alone Info
reader see when it is invoked like that?  What is the file name of the
latex2e Info file, and does it have a menu entry in the DIR file in
any of the directories mentioned in INFOPATH?

You are also hitting an ambiguity in commands such as "info foo": the
Info reader doesn't know whether you mean the file foo.info or the
menu entry "foo" in the Info directory file DIR.  Use "info -f foo" to
mean the former.

Bottom line: you mix up a native Windows build of Emacs with MSYS2
Bash and (presumably) MSYS2 build of the stand-alone Info reader, and
that adds quite a few factors that could influence the outcome.  In
particular, the INFOPATH variable gets transformed several times
before it gets to info.exe: once when you invoke Emacs from Bash, then
when Emacs calls the shell, then again when the subordinate shell
calls info.exe.



  reply	other threads:[~2023-03-30 13:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 10:56 Running external info within Emacs Arash Esbati
2023-03-30 13:17 ` Eli Zaretskii [this message]
2023-03-30 15:00   ` Arash Esbati
2023-03-30 15:56     ` Eli Zaretskii
2023-03-31  6:43       ` Arash Esbati
2023-03-31  7:10         ` Eli Zaretskii
2023-03-31 18:09           ` Arash Esbati
2023-03-31 19:07             ` Eli Zaretskii
2023-04-01 10:51               ` Arash Esbati
2023-04-01 11:37                 ` Eli Zaretskii
2023-04-01 14:45                   ` Arash Esbati
2023-04-01 15:34                     ` Eli Zaretskii
2023-04-02 17:04                       ` Arash Esbati
2023-04-02 17:14                         ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831ql65qew.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=arash@gnu.org \
    --cc=emacs-devel@gnu.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.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).