GNU bug report logs - #14933
24.3; [PATCH] bookmark-set default changed

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Mon, 22 Jul 2013 13:32:02 UTC

Severity: normal

Tags: patch

Found in version 24.3

Done: Leo Liu <sdl.web <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 14933 in the body.
You can then email your comments to 14933 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 juri <at> jurta.org, bug-gnu-emacs <at> gnu.org:
bug#14933; Package emacs. (Mon, 22 Jul 2013 13:32:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Liu <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to juri <at> jurta.org, bug-gnu-emacs <at> gnu.org. (Mon, 22 Jul 2013 13:32:03 GMT) Full text and rfc822 format available.

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

From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3; [PATCH] bookmark-set default changed
Date: Mon, 22 Jul 2013 21:12:49 +0800
[Message part 1 (text/plain, inline)]
Before this change:

,----
| revno: 109508
| fixes bug: http://debbugs.gnu.org/12107
| committer: Juri Linkov <juri <at> jurta.org>
| branch nick: trunk
| timestamp: Wed 2012-08-08 11:48:57 +0300
| message:
|   * lisp/bookmark.el: Add `defaults' property to the bookmark record.
|   (bookmark-current-buffer): Doc fix.
|   (bookmark-make-record): Add `defaults' property with default values
|   to the bookmark record.
|   (bookmark-minibuffer-read-name-map): Remove key binding "\C-u"
|   with `bookmark-insert-current-bookmark'.
|   (bookmark-set): Get `defaults' property from the bookmark record
|   and use it in `read-from-minibuffer'.
|   (bookmark-insert-current-bookmark): Remove function.
| 
|   * lisp/info.el (Info-bookmark-make-record): Add `defaults' property
|   with values of canonical Info node name, the current Info file name
|   and the current Info node name.
`----

bookmark-set used to (at least in 24.2) use (car record) i.e. NAME as
the default bookmark name when read from minibuffer. Now I am seeing
buffer name instead. Is this change intentional? Any objection to
applying the attached patch?

Thanks,
Leo

[Message part 2 (text/x-patch, inline)]
=== modified file 'lisp/bookmark.el'
--- lisp/bookmark.el	2013-05-09 01:40:20 +0000
+++ lisp/bookmark.el	2013-07-22 13:04:48 +0000
@@ -481,19 +481,17 @@
 (defun bookmark-make-record ()
   "Return a new bookmark record (NAME . ALIST) for the current location."
   (let ((record (funcall bookmark-make-record-function)))
+    ;; Set up default name if the function does not provide one.
+    (unless (stringp (car record))
+      (if (car record) (push nil record))
+      (setcar record (or bookmark-current-bookmark (bookmark-buffer-name))))
     ;; Set up defaults.
     (bookmark-prop-set
      record 'defaults
      (delq nil (delete-dups (append (bookmark-prop-get record 'defaults)
 				    (list bookmark-current-bookmark
-					  (bookmark-buffer-name))))))
-    ;; Set up default name.
-    (if (stringp (car record))
-        ;; The function already provided a default name.
-        record
-      (if (car record) (push nil record))
-      (setcar record (or bookmark-current-bookmark (bookmark-buffer-name)))
-      record)))
+					  (car record))))))
+    record))
 
 (defun bookmark-store (name alist no-overwrite)
   "Store the bookmark NAME with data ALIST.


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#14933; Package emacs. (Mon, 22 Jul 2013 20:02:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> jurta.org>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 14933 <at> debbugs.gnu.org
Subject: Re: bug#14933: 24.3; [PATCH] bookmark-set default changed
Date: Mon, 22 Jul 2013 23:00:05 +0300
> bookmark-set used to (at least in 24.2) use (car record) i.e. NAME as
> the default bookmark name when read from minibuffer. Now I am seeing
> buffer name instead. Is this change intentional? Any objection to
> applying the attached patch?

(car record) is used in `bookmark-set' when a specific
bookmark-make-record-function doesn't provide default values.

OTOH, (bookmark-buffer-name) in `bookmark-make-record' is intended
to do what `bookmark-insert-current-bookmark' used to do,
i.e. instead of typing a non-standard `C-u' binding,
now you can type `M-n' to insert the value of (bookmark-buffer-name)
to the minibuffer.

Your patch looks right, but please include
(bookmark-buffer-name) after (car record) as well,
i.e. you could use such code fragment in your patch:

     (delq nil (delete-dups (append (bookmark-prop-get record 'defaults)
				    (list bookmark-current-bookmark
					  (car record)
					  (bookmark-buffer-name)))))

Then `M-n' will insert (car record) to the minibuffer,
and `M-n M-n' will insert (bookmark-buffer-name).




Reply sent to Leo Liu <sdl.web <at> gmail.com>:
You have taken responsibility. (Tue, 23 Jul 2013 01:04:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Liu <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Tue, 23 Jul 2013 01:04:02 GMT) Full text and rfc822 format available.

Message #13 received at 14933-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: Juri Linkov <juri <at> jurta.org>
Cc: 14933-done <at> debbugs.gnu.org
Subject: Re: bug#14933: 24.3; [PATCH] bookmark-set default changed
Date: Tue, 23 Jul 2013 09:03:28 +0800
Fixed in trunk.

On 2013-07-23 04:00 +0800, Juri Linkov wrote:
> Your patch looks right, but please include
> (bookmark-buffer-name) after (car record) as well

Thanks and done as suggested.

Leo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 20 Aug 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 272 days ago.

Previous Next


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