]> git.eshelyaron.com Git - emacs.git/commitdiff
* bookmark.el (bookmark-make-record): Restore NAME as a default
authorLeo Liu <sdl.web@gmail.com>
Tue, 23 Jul 2013 00:58:28 +0000 (08:58 +0800)
committerLeo Liu <sdl.web@gmail.com>
Tue, 23 Jul 2013 00:58:28 +0000 (08:58 +0800)
value.

Fixes: debbugs:14933
lisp/ChangeLog
lisp/bookmark.el

index 660ea562910e096857766a9bc9995136aba4c37c..597c50899c0b3804b0401655b0a4bbe4f5708cfb 100644 (file)
@@ -1,3 +1,8 @@
+2013-07-23  Leo Liu  <sdl.web@gmail.com>
+
+       * bookmark.el (bookmark-make-record): Restore NAME as a default
+       value.  (Bug#14933)
+
 2013-07-22  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/autoload.el (autoload--setup-output): New function,
index cab81c3b135409025f55b2e35d5f16bb2f5d2fe5..b1cdedb83c5e2fd90d9814680f9da8072edbedc0 100644 (file)
@@ -481,19 +481,18 @@ equivalently just return ALIST without NAME.")
 (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)
+                                          (bookmark-buffer-name))))))
+    record))
 
 (defun bookmark-store (name alist no-overwrite)
   "Store the bookmark NAME with data ALIST.