[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PATCH: bookmark.el LIFO preservation
From: |
Karl Fogel |
Subject: |
Re: PATCH: bookmark.el LIFO preservation |
Date: |
Mon, 16 Jul 2007 09:02:56 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) |
Thien-Thi Nguyen <address@hidden> writes:
> 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?
Thank you for the clear explanation and the fix! It'd be great if you
would install it, yes.
-Karl