GNU bug report logs - #23857
Emacs 25.0.94: Info-read-node-name fails outside of Info buffers; patch to fix included

Previous Next

Package: emacs;

Reported by: rswgnu <at> gmail.com

Date: Mon, 27 Jun 2016 20:06:02 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23857 in the body.
You can then email your comments to 23857 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23857; Package emacs. (Mon, 27 Jun 2016 20:06:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to rswgnu <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 27 Jun 2016 20:06:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Robert Weiner <rsw <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: Emacs 25.0.94: Info-read-node-name fails outside of Info buffers;
 patch to fix included
Date: Mon, 27 Jun 2016 16:04:15 -0400
[Message part 1 (text/plain, inline)]
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)
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23857; Package emacs. (Tue, 25 Jun 2019 12:23:01 GMT) Full text and rfc822 format available.

Message #8 received at 23857 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Robert Weiner <rsw <at> gnu.org>
Cc: 23857 <at> debbugs.gnu.org, rswgnu <at> gmail.com
Subject: Re: bug#23857: Emacs 25.0.94: Info-read-node-name fails outside of
 Info buffers; patch to fix included
Date: Tue, 25 Jun 2019 14:22:47 +0200
Robert Weiner <rsw <at> gnu.org> 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




Added tag(s) wontfix. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Jun 2019 12:24:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 23857 <at> debbugs.gnu.org and rswgnu <at> gmail.com Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 25 Jun 2019 12:24:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 24 Jul 2019 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 278 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.