diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-03-18 07:01:18 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-03-18 07:01:18 +0100 |
commit | ff89d27c07de4ac2efc695b06e8aa1faec5d65d1 (patch) | |
tree | 78bfa1b09796ffe3d38edbd7793a8574642d49a7 /lisp/bookmark.el | |
parent | a96f6de5447f296dbadc90de9a1157062e9ba491 (diff) | |
parent | 530c3491e89bd316e628f67d5cebb7db6e7d470a (diff) | |
download | emacs-ff89d27c07de4ac2efc695b06e8aa1faec5d65d1.tar.gz emacs-ff89d27c07de4ac2efc695b06e8aa1faec5d65d1.tar.bz2 emacs-ff89d27c07de4ac2efc695b06e8aa1faec5d65d1.zip |
Merge from origin/emacs-28
530c3491e8 Improve documentation of bookmark default sorting
11492259b1 ; * doc/lispref/display.texi (Overlay Arrow): More accurat...
Diffstat (limited to 'lisp/bookmark.el')
-rw-r--r-- | lisp/bookmark.el | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 80fb1cdfc78..e3baa7607d2 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -246,11 +246,13 @@ functions have a binding in this keymap." Bookmark functions update the value automatically. You probably do NOT want to change the value yourself. -The value is an alist with bookmarks of the form +The value is an alist whose elements are of the form (BOOKMARK-NAME . PARAM-ALIST) -or the deprecated form (BOOKMARK-NAME PARAM-ALIST). +or the deprecated form (BOOKMARK-NAME PARAM-ALIST). The alist is +ordered from most recently created bookmark at the front to least +recently created bookmark at the end. BOOKMARK-NAME is the name you gave to the bookmark when creating it. @@ -583,10 +585,10 @@ old one." ;; Modify using the new (NAME . ALIST) format. (setcdr bm alist)) - ;; otherwise just cons it onto the front (either the bookmark - ;; doesn't exist already, or there is no prefix arg. In either - ;; case, we want the new bookmark consed onto the alist...) - + ;; Otherwise just put it onto the front of the list. Either the + ;; bookmark doesn't exist already, or there is no prefix arg. + ;; In either case, we want the new bookmark on the front of the + ;; list, since the list is kept in reverse order of creation. (push (cons stripped-name alist) bookmark-alist)) ;; Added by db @@ -1140,7 +1142,9 @@ it to the name of the bookmark currently being set, advancing (defun bookmark-maybe-sort-alist () "Return `bookmark-alist' for display. -If `bookmark-sort-flag' is non-nil, then return a sorted copy of the alist." +If `bookmark-sort-flag' is non-nil, then return a sorted copy of the alist. +Otherwise, just return `bookmark-alist', which by default is ordered +from most recently created to least recently created bookmark." (if bookmark-sort-flag (sort (copy-alist bookmark-alist) (lambda (x y) (string-lessp (car x) (car y)))) |