emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running external info within Emacs


From: Eli Zaretskii
Subject: Re: Running external info within Emacs
Date: Thu, 30 Mar 2023 16:17:59 +0300

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]