Subject: Re: bug#24573: 25.1; Setting bookmark in buffer *Help* makes bookmarks non-loadable

From: Stefan Kangas <[email-masked]>
Date: Tue, 2 Jul 2019 18:22:46 +0200

tags 24573 patch
quit

Noam Postavsky <[email-masked]> 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
diff --git a/lisp/help-mode.el b/lisp/help-mode.el
index dc2992cd4a..cd4138c365 100644
--- a/lisp/help-mode.el
+++ b/lisp/help-mode.el
@@ -787,7 +787,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)))