From unknown Sat Jun 21 03:27:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23857: Emacs 25.0.94: Info-read-node-name fails outside of Info buffers; patch to fix included Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 27 Jun 2016 20:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23857 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 23857@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Reply-To: rswgnu@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.146705791031743 (code B ref -1); Mon, 27 Jun 2016 20:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 27 Jun 2016 20:05:10 +0000 Received: from localhost ([127.0.0.1]:58517 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHcmM-0008Fu-4t for submit@debbugs.gnu.org; Mon, 27 Jun 2016 16:05:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56421) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bHcmL-0008Fh-5D for submit@debbugs.gnu.org; Mon, 27 Jun 2016 16:05:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHcmB-0006tG-7v for submit@debbugs.gnu.org; Mon, 27 Jun 2016 16:05:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_50,HTML_MESSAGE, RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:41940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHcmB-0006tA-4S for submit@debbugs.gnu.org; Mon, 27 Jun 2016 16:04:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47360) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHcm5-0007s9-8R for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 16:04:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bHclz-0006s8-6Q for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 16:04:52 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:40136) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bHclz-0006s0-3W for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 16:04:47 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:35658) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bHclx-0001Z9-HW for bug-gnu-emacs@gnu.org; Mon, 27 Jun 2016 16:04:45 -0400 Received: by mail-oi0-f43.google.com with SMTP id r2so215782977oih.2 for ; Mon, 27 Jun 2016 13:04:45 -0700 (PDT) X-Gm-Message-State: ALyK8tJQZeLWxoeoMq3lVaKZ9N8TUTV9bKaB30SgzvI4IlXqwBUZ+4IrGaBmRWatWQ/JmsI69kzaU8nE6YIDIA== X-Received: by 10.202.72.137 with SMTP id v131mr1896834oia.22.1467057884599; Mon, 27 Jun 2016 13:04:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.212.143 with HTTP; Mon, 27 Jun 2016 13:04:15 -0700 (PDT) From: Robert Weiner Date: Mon, 27 Jun 2016 16:04:15 -0400 X-Gmail-Original-Message-ID: Message-ID: Content-Type: multipart/alternative; boundary=001a113e55a6139e2b053648080b X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.3 (------) --001a113e55a6139e2b053648080b Content-Type: text/plain; charset=UTF-8 Info-read-node-name is useful even when the current buffer is not an Info buffer because it can be used to specify a file from which to read Info node name completions, e.g. if you want to produce a link within an Emacs Lisp file to a specific Info node. Unfortunately, when this function is called outside of an Info buffer, it produces an error when it calls `Info-build-node-completions' and that calls `Info-build-node-completions-1' which fails to produce any completions. By wrapping that last call in a condition-case to catch the error, the problem is solved and Info-read-node-name works properly in any buffer. At first, it will report there are no completions, then when you specify an Info file, it will complete for that file as desired. For example, try the unpatched and then the patched code in an Emacs Lisp buffer, evaluating this expression: (Info-read-node-name "(File)Node: ") The patch is included below. Bob -------- *** info-orig.el.gz 2016-06-27 15:57:29.000000000 -0400 --- info.el.gz 2016-06-27 15:57:29.000000000 -0400 *************** *** 1882,1888 **** (push (cons filename Info-current-file-completions) Info-file-completions) Info-current-file-completions)) (or Info-current-file-completions ! (Info-build-node-completions-1)))) (defun Info-build-node-completions-1 () (let ((compl nil) --- 1882,1890 ---- (push (cons filename Info-current-file-completions) Info-file-completions) Info-current-file-completions)) (or Info-current-file-completions ! (condition-case nil ! (Info-build-node-completions-1) ! (error nil))))) (defun Info-build-node-completions-1 () (let ((compl nil) --001a113e55a6139e2b053648080b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Info-= read-node-name is useful even when the current buffer is not an
<= /div>
Info buffer because it can be used to specify a file from which to re= ad
Info node name completions, e.g. if you want to produce a l= ink within an
Emacs Lisp file to a specific Info node.<= /div>

Unfortunately, when this function is called outsi= de of an Info buffer,
<= font face=3D"monospace, monospace">it produces an error when it calls `Info= -build-node-completions' and
that calls `Info-build-node-c= ompletions-1' which fails to produce any
completions.=C2= =A0 By wrapping that last call in a condition-case to catch
th= e error, the problem is solved and Info-read-node-name works properly
in any buffer.=C2=A0 At first, it will report there are no completi= ons, then
when you specify an Info file, it will complete for = that file as
desired.=C2=A0 For example, try the unpatched and= then the patched code
= in an Emacs Lisp buffer, evaluating thi= s expression:

(Info-read-node-name "(Fi= le)Node: ")

The patch is included below= .

Bob
--------
*** info-orig.el.gz 2016-06-27 15:57:29.000000000 -0400
--- info.el.gz <= span class=3D"" style=3D"white-space:pre"> 2016-06-27 15:57:29.0000= 00000 -0400
***************
*** 1882,1888 ****
=C2=A0 =C2= =A0 =C2=A0(push (cons filename Info-current-file-completions) Info-file-com= pletions)
=C2=A0 <= /span> =C2=A0 =C2=A0Info-current-file-completions))
=C2=A0 = =C2=A0 =C2=A0 (or Info-current-file-completions
! (Info-build-node-completions-1))))<= /font>
=C2=A0=C2=A0
=C2=A0 (defun Info-build-node-comple= tions-1 ()
=C2=A0 =C2=A0 (let ((compl nil)
--- = 1882,1890 ----
=C2=A0 =C2=A0 =C2=A0(push (cons filename Info-current-file-completions= ) Info-file-completions)
=C2=A0 =C2=A0 =C2=A0Info-current-file-completions))
=C2=A0 =C2=A0 =C2=A0 (or Info-current-file-completions
! = (condition-case nil
! =C2=A0 =C2= =A0(Info-build-node-completions-1)
! =C2=A0(error nil)))))
=C2=A0=C2=A0<= /font>
=C2=A0 (defun Info-build-node-completions-1 ()
= =C2=A0 =C2=A0 (let ((compl nil)


<= /div> --001a113e55a6139e2b053648080b-- From unknown Sat Jun 21 03:27:06 2025 X-Loop: help-debbugs@gnu.org Subject: bug#23857: Emacs 25.0.94: Info-read-node-name fails outside of Info buffers; patch to fix included Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jun 2019 12:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23857 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Robert Weiner Cc: 23857@debbugs.gnu.org, rswgnu@gmail.com Received: via spool by 23857-submit@debbugs.gnu.org id=B23857.156146537319396 (code B ref 23857); Tue, 25 Jun 2019 12:23:01 +0000 Received: (at 23857) by debbugs.gnu.org; 25 Jun 2019 12:22:53 +0000 Received: from localhost ([127.0.0.1]:58846 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfkTN-00052l-4R for submit@debbugs.gnu.org; Tue, 25 Jun 2019 08:22:53 -0400 Received: from quimby.gnus.org ([80.91.231.51]:48024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfkTL-00052a-JX for 23857@debbugs.gnu.org; Tue, 25 Jun 2019 08:22:52 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfkTH-0007vY-9b; Tue, 25 Jun 2019 14:22:49 +0200 From: Lars Ingebrigtsen References: Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEU1FE1lOW4mCUNMJVul brQHWCMmAAACTUlEQVQ4jW1TgZHcIAwUKAWAoQAsUoBALiB83H9NWWH/z/9MfDe2T4tW0q6ORr7/ exHl91q1/gA0lJLHg/0AEuWSrWSA40l57hSIQzJDvNgTyvfCC7EZ45MGECdzcO3izGTEiUdJT4d1 5V2cVAfhEQrp8ON1pxFrSKxEod7KuK1cX6rESRMFZ1atfh5kpRKKJCJwrOtePLIDaGOQNH0G8Iop uAQZI2dqhV+58rxWGEXHloBODS+QhG9oYJjWAZ/vAY4GxmJzZLvTRZb0BWb3UoFZeSUGFTtrwRjk wB+0OWoy6sxp+ID3ehL5CBY0UwiNVSg2y5/NZar5ovOMGkmjSAtb9r+qNgBYU5LhgEjgzRWNc6UZ 24TuG2i7/MdJGI0odpSWndK2UuuwHAvNroyQkQPjtbvA8aQqOK1O1lJ1O/52SkI8teEw776yRYy/ ODahc3JwYGeYMqosamjotP4LIUYDMK1dXsRGxH5EU2/0ufhxcBxwUFr8isNj12Wpj8Ei34CtWKIR /ZB85/IUuIhyetpnTkMDcG1hDSY6O7tPCCQ6xJDWOgPg8K0MMFZsgffegnKc7YmCgAEVvEdh+IS9 a5sq4hnKwDvssckkcVPBY6GwclIf0BU/eUZIJ/hikY0mYYbC1/wt28N9XUtlQnap+COf9zGfcBTs L5hbipy9tERtUzqEC4mQARP42QQsiYVa3DT4RFF7cE2E2vlRuRRpPfEBOdHT8VmY9p19GPIf7Qm/ 1aXNeU4faZ+L7avdnmaf2OboLQJo0RkxZj9A8w/nDo/m8ZWbrQAAAABJRU5ErkJggg== Mail-Copies-To: never Date: Tue, 25 Jun 2019 14:22:47 +0200 In-Reply-To: (Robert Weiner's message of "Mon, 27 Jun 2016 16:04:15 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Robert Weiner writes: > Info-read-node-name is useful even when the current buffer is not an > Info buffer because it can be used to specify a file from which to read > Info node name completions, e.g. if you want to produ [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Robert Weiner writes: > Info-read-node-name is useful even when the current buffer is not an > Info buffer because it can be used to specify a file from which to read > Info node name completions, e.g. if you want to produce a link within an > Emacs Lisp file to a specific Info node. (Info-read-node-name "(File)Node: ") => "Top This is the top of the INFO tree" It seems like a very mode-specific function to me... [...] > ! (condition-case nil > ! (Info-build-node-completions-1) > ! (error nil))))) And just catching all errors isn't a good way to solve these things, because it may be covering up other errors we want to catch. Given both these things, I don't think this is a good idea, and I'm closing this bug report. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 25 08:23:04 2019 Received: (at control) by debbugs.gnu.org; 25 Jun 2019 12:23:04 +0000 Received: from localhost ([127.0.0.1]:58850 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfkTY-00053o-Ey for submit@debbugs.gnu.org; Tue, 25 Jun 2019 08:23:04 -0400 Received: from quimby.gnus.org ([80.91.231.51]:48042) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hfkTX-00053g-2y for control@debbugs.gnu.org; Tue, 25 Jun 2019 08:23:03 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=stories) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hfkTU-0007vg-Hz for control@debbugs.gnu.org; Tue, 25 Jun 2019 14:23:02 +0200 Date: Tue, 25 Jun 2019 14:23:00 +0200 Message-Id: To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #23857 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 23857 wontfix close 23857 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 23857 wontfix close 23857 quit