Mercurial > emacs
changeset 81910:fbf992fc2463
(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.
author | Thien-Thi Nguyen <ttn@gnuvola.org> |
---|---|
date | Mon, 16 Jul 2007 16:57:45 +0000 |
parents | bf55b9b62e57 |
children | 2d5f4f5607c1 |
files | lisp/bookmark.el |
diffstat | 1 files changed, 5 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/bookmark.el Mon Jul 16 16:01:04 2007 +0000 +++ b/lisp/bookmark.el Mon Jul 16 16:57:45 2007 +0000 @@ -1045,10 +1045,10 @@ ;;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 @@ -1590,7 +1590,6 @@ (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 "*" @@ -1613,7 +1612,7 @@ 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)