From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Running external info within Emacs Date: Thu, 30 Mar 2023 16:17:59 +0300 Message-ID: <831ql65qew.fsf@gnu.org> References: <864jq2cxsv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32784"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Arash Esbati Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Mar 30 15:18:58 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1phsB6-0008Ff-Sw for ged-emacs-devel@m.gmane-mx.org; Thu, 30 Mar 2023 15:18:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phsA3-0005uA-R1; Thu, 30 Mar 2023 09:17:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phsA1-0005tZ-On for emacs-devel@gnu.org; Thu, 30 Mar 2023 09:17:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phsA1-0001dx-9s for emacs-devel@gnu.org; Thu, 30 Mar 2023 09:17:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=jGS2T23f0gnREZiUb8fX4/zco8PZGl4nrN2vuX5RjuY=; b=WIR52r3hm5AqGOYkLJYL 4XemSLiU0Y4POi0zt+r6o6cd97HwBF7jTubBnm2EqxybaFHPQC5LtIUdGK1pQFoo54OcC7wIPmPEL lvk7/oG06sPJoNIVTAgIMkG3ILvEZnUyolpiOkf53h1SJHwxbZwMBf0RV+GciHbDr8E0ovbShS+UP xrCpU5bFC8Q+wwfDZAMQKLoZNWuNn2tQQGiC9eBaOrBrFCl3yBC1cjA0vLkd8CvDfgVOESsiRcGxz Htn7gUboFQHtu60npN00+mw9m/K13uKMAcBDPcBpfruh+cbmcr39rDoFF7WhKxikGEcDTClO13RcR 55HtbmS/WP0coA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phsA0-0001Wm-LO; Thu, 30 Mar 2023 09:17:48 -0400 In-Reply-To: <864jq2cxsv.fsf@gnu.org> (message from Arash Esbati on Thu, 30 Mar 2023 12:56:32 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:304863 Archived-At: > From: Arash Esbati > 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.