diff options
| author | Karl Fogel | 2022-03-17 21:18:26 -0500 |
|---|---|---|
| committer | Karl Fogel | 2022-03-17 21:18:26 -0500 |
| commit | 530c3491e89bd316e628f67d5cebb7db6e7d470a (patch) | |
| tree | e6e459eb85bab3d191b64f08013ee8d072f9e8e8 | |
| parent | 11492259b1a7bfd9a8615ffe7148323e9e568d47 (diff) | |
| download | emacs-530c3491e89bd316e628f67d5cebb7db6e7d470a.tar.gz emacs-530c3491e89bd316e628f67d5cebb7db6e7d470a.zip | |
Improve documentation of bookmark default sorting
* lisp/bookmark.el (bookmark-alist, bookmark-store,
bookmark-maybe-sort-alist): Update doc strings and comments.
| -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 d568f643d9b..cc9956c80a9 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el | |||
| @@ -249,11 +249,13 @@ functions have a binding in this keymap.") | |||
| 249 | Bookmark functions update the value automatically. | 249 | Bookmark functions update the value automatically. |
| 250 | You probably do NOT want to change the value yourself. | 250 | You probably do NOT want to change the value yourself. |
| 251 | 251 | ||
| 252 | The value is an alist with bookmarks of the form | 252 | The value is an alist whose elements are of the form |
| 253 | 253 | ||
| 254 | (BOOKMARK-NAME . PARAM-ALIST) | 254 | (BOOKMARK-NAME . PARAM-ALIST) |
| 255 | 255 | ||
| 256 | or the deprecated form (BOOKMARK-NAME PARAM-ALIST). | 256 | or the deprecated form (BOOKMARK-NAME PARAM-ALIST). The alist is |
| 257 | ordered from most recently created bookmark at the front to least | ||
| 258 | recently created bookmark at the end. | ||
| 257 | 259 | ||
| 258 | BOOKMARK-NAME is the name you gave to the bookmark when creating it. | 260 | BOOKMARK-NAME is the name you gave to the bookmark when creating it. |
| 259 | 261 | ||
| @@ -577,10 +579,10 @@ old one." | |||
| 577 | ;; Modify using the new (NAME . ALIST) format. | 579 | ;; Modify using the new (NAME . ALIST) format. |
| 578 | (setcdr bm alist)) | 580 | (setcdr bm alist)) |
| 579 | 581 | ||
| 580 | ;; otherwise just cons it onto the front (either the bookmark | 582 | ;; Otherwise just put it onto the front of the list. Either the |
| 581 | ;; doesn't exist already, or there is no prefix arg. In either | 583 | ;; bookmark doesn't exist already, or there is no prefix arg. |
| 582 | ;; case, we want the new bookmark consed onto the alist...) | 584 | ;; In either case, we want the new bookmark on the front of the |
| 583 | 585 | ;; list, since the list is kept in reverse order of creation. | |
| 584 | (push (cons stripped-name alist) bookmark-alist)) | 586 | (push (cons stripped-name alist) bookmark-alist)) |
| 585 | 587 | ||
| 586 | ;; Added by db | 588 | ;; Added by db |
| @@ -1138,7 +1140,9 @@ it to the name of the bookmark currently being set, advancing | |||
| 1138 | 1140 | ||
| 1139 | (defun bookmark-maybe-sort-alist () | 1141 | (defun bookmark-maybe-sort-alist () |
| 1140 | "Return `bookmark-alist' for display. | 1142 | "Return `bookmark-alist' for display. |
| 1141 | If `bookmark-sort-flag' is non-nil, then return a sorted copy of the alist." | 1143 | If `bookmark-sort-flag' is non-nil, then return a sorted copy of the alist. |
| 1144 | Otherwise, just return `bookmark-alist', which by default is ordered | ||
| 1145 | from most recently created to least recently created bookmark." | ||
| 1142 | (if bookmark-sort-flag | 1146 | (if bookmark-sort-flag |
| 1143 | (sort (copy-alist bookmark-alist) | 1147 | (sort (copy-alist bookmark-alist) |
| 1144 | (lambda (x y) (string-lessp (car x) (car y)))) | 1148 | (lambda (x y) (string-lessp (car x) (car y)))) |