GNU bug report logs - #24573
25.1; Setting bookmark in buffer *Help* makes bookmarks non-loadable

Previous Next

Package: emacs;

Reported by: Dmitri Paduchikh <dpaduchikh <at> gmail.com>

Date: Fri, 30 Sep 2016 14:14:02 UTC

Severity: normal

Tags: fixed, patch

Found in version 25.1

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

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 24573 in the body.
You can then email your comments to 24573 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#24573; Package emacs. (Fri, 30 Sep 2016 14:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitri Paduchikh <dpaduchikh <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 30 Sep 2016 14:14:02 GMT) Full text and rfc822 format available.

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

From: Dmitri Paduchikh <dpaduchikh <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1; Setting bookmark in buffer *Help* makes bookmarks non-loadable
Date: Fri, 30 Sep 2016 19:13:28 +0500
Hello,

I start emacs -q, open the *Help* buffer, set a bookmark there, and save
bookmarks to file. After this I get the following error message while
trying to load bookmarks back.

Saving bookmarks to file ~/.emacs.d/bookmarks...done
Loading bookmarks from ~/.emacs.d/bookmarks...
bookmark-alist-from-buffer: Invalid read syntax: "#"

And indeed, the file contains text #<buffer *GNU Emacs*>. Replacing this
by nil manually fixes the problem.

;;;; Emacs Bookmark Format Version 1 ;;;;
;;; This format is meant to be slightly human-readable;
;;; nevertheless, you probably don't want to edit it.
;;; -*- End Of Bookmark File Format Version Stamp -*-
(("car"
 (position . 49)
 (help-fn .
	  #[514 "\301.!\205.\211.\302.!)\207"
		[describe-function-orig-buffer buffer-live-p describe-function]
		4 "\n\n(fn FUNCTION BUFFER)"])
 (help-args car #<buffer *GNU Emacs*>)
 (position . 49)
 (handler . help-bookmark-jump))
)


In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.20.9)
 of 2016-09-18 built on juergen

Regards,
Dmitri Paduchikh




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24573; Package emacs. (Sat, 28 Oct 2017 18:57:03 GMT) Full text and rfc822 format available.

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

From: Win Treese <treese <at> acm.org>
To: 24573 <at> debbugs.gnu.org
Cc: Win Treese <treese <at> acm.org>
Subject: Re: 25.1; Setting bookmark in buffer *Help* makes bookmarks
 non-loadable
Date: Sat, 28 Oct 2017 14:53:59 -0400
I ran into the same problem.

To reproduce:

1. C-h f find-file

2. In the *Help* buffer:

    C-x r m  ; create a bookmark to the help for find-file

3. Exit Emacs (which should save the bookmark)

4. In a fresh Emacs,
   C-x r b    ; to visit any bookmark

This results in an error:

   bookmark-alist-from-buffer: Invalid read syntax: "#"

Note that the bookmark works fine until Emacs attempts to restore
the bookmarks saved to a file. In normal use, it only shows up after
Emacs is restarted.

Finding the problem:

The problem appears to be in the definition for describe-function i
help-fns.el. help-setup-xref is called with a lambda instead of a
function symbol (as it was before this code was changed).
When the bookmark is saved, the syntax for the lambda is not
parsable by read to restore it.

I don't understand the code well enough to propose an appropriate change.

I am using Aquamacs, but the code noted is the same in the master git
branch now. Version information;

Aquamacs 3.4 development
Emacs version 25.2.1

Regards,

Win Treese
treese <at> acm.org






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24573; Package emacs. (Sat, 28 Oct 2017 19:49:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: Win Treese <treese <at> acm.org>
Cc: Dmitri Paduchikh <dpaduchikh <at> gmail.com>, 24573 <at> debbugs.gnu.org
Subject: Re: bug#24573: 25.1;
 Setting bookmark in buffer *Help* makes bookmarks non-loadable
Date: Sat, 28 Oct 2017 15:48:17 -0400
Win Treese <treese <at> acm.org> writes:

> Finding the problem:
>
> The problem appears to be in the definition for describe-function i
> help-fns.el. help-setup-xref is called with a lambda instead of a
> function symbol (as it was before this code was changed).
> When the bookmark is saved, the syntax for the lambda is not
> parsable by read to restore it.

The lambda is fine, it's the buffer which uses the unreadable print
synax: #<...>.  The following which swaps buffer objects with their name
seems to fix it, although I haven't really tested this much.

--- i/lisp/help-mode.el
+++ w/lisp/help-mode.el
@@ -756,7 +756,9 @@ help-bookmark-make-record
     (error "Cannot create bookmark - help command not known"))
   `(,@(bookmark-make-record-default 'NO-FILE 'NO-CONTEXT)
       (help-fn     . ,(car help-xref-stack-item))
-      (help-args   . ,(cdr help-xref-stack-item))
+      (help-args   . ,(mapcar (lambda (a)
+                                (if (bufferp a) (buffer-name a) a))
+                              (cdr help-xref-stack-item)))
       (position    . ,(point))
       (handler     . help-bookmark-jump)))
 






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24573; Package emacs. (Tue, 02 Jul 2019 16:24:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: Dmitri Paduchikh <dpaduchikh <at> gmail.com>, 24573 <at> debbugs.gnu.org,
 Win Treese <treese <at> acm.org>
Subject: Re: bug#24573: 25.1; Setting bookmark in buffer *Help* makes
 bookmarks non-loadable
Date: Tue, 2 Jul 2019 18:22:46 +0200
[Message part 1 (text/plain, inline)]
tags 24573 patch
quit

Noam Postavsky <npostavs <at> users.sourceforge.net> writes:

> The lambda is fine, it's the buffer which uses the unreadable print
> synax: #<...>.  The following which swaps buffer objects with their name
> seems to fix it, although I haven't really tested this much.
>
> --- i/lisp/help-mode.el
> +++ w/lisp/help-mode.el
> @@ -756,7 +756,9 @@ help-bookmark-make-record
>      (error "Cannot create bookmark - help command not known"))
>    `(,@(bookmark-make-record-default 'NO-FILE 'NO-CONTEXT)
>        (help-fn     . ,(car help-xref-stack-item))
> -      (help-args   . ,(cdr help-xref-stack-item))
> +      (help-args   . ,(mapcar (lambda (a)
> +                                (if (bufferp a) (buffer-name a) a))
> +                              (cdr help-xref-stack-item)))
>        (position    . ,(point))
>        (handler     . help-bookmark-jump)))

I can confirm this bug, which I've recently stumbled into myself.

I can also confirm that Noam Postavsky's fix works.

In the interest of getting it merged as soon as possible, I'm sending
it here as a diff to be easier to apply.  I could send it as a patch
too if that will get it merged faster.  But the credit for fixing this
should fully go to Noam Postavsky.

Thanks,
Stefan Kangas
[bug24573.diff (text/x-patch, attachment)]

Added tag(s) patch. Request was from Stefan Kangas <stefan <at> marxist.se> to control <at> debbugs.gnu.org. (Tue, 02 Jul 2019 16:24:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#24573; Package emacs. (Sat, 06 Jul 2019 18:43:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Dmitri Paduchikh <dpaduchikh <at> gmail.com>, 24573 <at> debbugs.gnu.org,
 Win Treese <treese <at> acm.org>
Subject: Re: bug#24573: 25.1;
 Setting bookmark in buffer *Help* makes bookmarks non-loadable
Date: Sat, 06 Jul 2019 14:42:35 -0400
tags 24573 fixed
close 24573 27.1
quit

Stefan Kangas <stefan <at> marxist.se> writes:
>> -      (help-args   . ,(cdr help-xref-stack-item))
>> +      (help-args   . ,(mapcar (lambda (a)
>> +                                (if (bufferp a) (buffer-name a) a))
>> +                              (cdr help-xref-stack-item)))

> I can confirm this bug, which I've recently stumbled into myself.
>
> I can also confirm that Noam Postavsky's fix works.

Ah right, kind of forgot about this.  Now pushed to master.

8d43315cfa 2019-07-06T14:34:47-04:00 "Use buffer's name for help-mode bookmarks (Bug#24573)"
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=8d43315cfa3db295736826272472ec1e394ecb60





Added tag(s) fixed. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 06 Jul 2019 18:43:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 27.1, send any further explanations to 24573 <at> debbugs.gnu.org and Dmitri Paduchikh <dpaduchikh <at> gmail.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 06 Jul 2019 18:43: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. (Sun, 04 Aug 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 34 days ago.

Previous Next


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