summaryrefslogtreecommitdiff
path: root/lisp/bookmark.el
diff options
context:
space:
mode:
authorThien-Thi Nguyen <ttn@gnuvola.org>2007-07-17 16:12:51 +0000
committerThien-Thi Nguyen <ttn@gnuvola.org>2007-07-17 16:12:51 +0000
commit63d96a7309751ce536526c2edf85583e61bb0f16 (patch)
tree0e563b241c2ba3b25d3f463cc00878e4127e2719 /lisp/bookmark.el
parent838536fce93a27cdf9f8eed1015995fdbf1b5711 (diff)
downloademacs-63d96a7309751ce536526c2edf85583e61bb0f16.tar.gz
(bookmark-maybe-sort-alist): Don't modify bookmark-alist.
Instead, if not sorting, simply return it. (bookmark-bmenu-list): Call bookmark-maybe-sort-alist for its return value, not for its side effect.
Diffstat (limited to 'lisp/bookmark.el')
-rw-r--r--lisp/bookmark.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index 816ed8b182e..d0c131e386e 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -1044,10 +1044,10 @@ For example, if this is a Info buffer, return the Info file's name."
;;Return the bookmark-alist for display. If the bookmark-sort-flag
;;is non-nil, then return a sorted copy of the alist.
(if bookmark-sort-flag
- (setq bookmark-alist
- (sort (copy-alist bookmark-alist)
- (function
- (lambda (x y) (string-lessp (car x) (car y))))))))
+ (sort (copy-alist bookmark-alist)
+ (function
+ (lambda (x y) (string-lessp (car x) (car y)))))
+ bookmark-alist))
(defvar bookmark-after-jump-hook nil
@@ -1568,7 +1568,6 @@ deletion, or > if it is flagged for displaying."
(insert "% Bookmark\n- --------\n")
(add-text-properties (point-min) (point)
'(font-lock-face bookmark-menu-heading))
- (bookmark-maybe-sort-alist)
(mapcar
(lambda (full-record)
;; if a bookmark has an annotation, prepend a "*"
@@ -1591,7 +1590,7 @@ deletion, or > if it is flagged for displaying."
help-echo "mouse-2: go to this bookmark in other window")))
(insert "\n")
)))
- bookmark-alist))
+ (bookmark-maybe-sort-alist)))
(goto-char (point-min))
(forward-line 2)
(bookmark-bmenu-mode)