summaryrefslogtreecommitdiff
path: root/lisp/bookmark.el
diff options
context:
space:
mode:
authorLeo Liu <sdl.web@gmail.com>2013-07-23 08:58:28 +0800
committerLeo Liu <sdl.web@gmail.com>2013-07-23 08:58:28 +0800
commitc35120929bcfe55e9faddc028e3e3de7cd8cfc5a (patch)
treed98476c01228025ce4602c43ae50b1e57fb21e8a /lisp/bookmark.el
parent7d22ce18d44b3639e5644ed72c2bfc54ca8b91d2 (diff)
downloademacs-c35120929bcfe55e9faddc028e3e3de7cd8cfc5a.tar.gz
* bookmark.el (bookmark-make-record): Restore NAME as a default
value. Fixes: debbugs:14933
Diffstat (limited to 'lisp/bookmark.el')
-rw-r--r--lisp/bookmark.el15
1 files changed, 7 insertions, 8 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index cab81c3b135..b1cdedb83c5 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -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.