emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

PATCH: bookmark.el LIFO preservation


From: Thien-Thi Nguyen
Subject: PATCH: bookmark.el LIFO preservation
Date: Mon, 16 Jul 2007 12:35:11 +0200

according to comments in bookmark.el, if `bookmark-sort-flag' is
non-nil, the entries in the menu list are to be displayed in LIFO order.

unfortunately, while `bookmark-maybe-sort-alist' currently does manage a
properly non-destructive sort, it then goes on to assign the result to
`bookmark-alist' anyway, thus losing the original order.  entries have
no timestamp, either, so the order cannot even be recovered.

to see this behavior:

  (setq bookmark-sort-flag t)         ; default t anyway
  (bookmark-bmenu-list)               ; note lexical ordering
  (setq bookmark-sort-flag nil)
  (bookmark-bmenu-list)               ; note lexical ordering
  (describe-variable 'bookmark-alist)

the last form is not strictly necessary; i include it to demonstrate the
lossage at the data-structure level.  below is a small patch that makes
the display option actually only affect display.  here is a ChangeLog
entry:

        * bookmark.el (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.

do you mind if i install it?

thi

________________________________________________________

Attachment: .ttn.bookmark.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]