# HG changeset patch # User Thien-Thi Nguyen # Date 1184605065 0 # Node ID fbf992fc24638dd3eb760fe571dd9d9be3d5aa0e # Parent bf55b9b62e578a29191b49e8e69249f5f6d9a3bf (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. diff -r bf55b9b62e57 -r fbf992fc2463 lisp/bookmark.el --- 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)