bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14933: 24.3; [PATCH] bookmark-set default changed


From: Leo Liu
Subject: bug#14933: 24.3; [PATCH] bookmark-set default changed
Date: Mon, 22 Jul 2013 21:12:49 +0800

Before this change:

,----
| revno: 109508
| fixes bug: http://debbugs.gnu.org/12107
| committer: Juri Linkov <address@hidden>
| 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

=== 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]