unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: "Aaron S. Hawley" <aaron.s.hawley@gmail.com>
Cc: 13411@debbugs.gnu.org
Subject: bug#13411: 24.2.91; Sorting in Buffer Menu Mode
Date: Thu, 15 Jul 2021 17:37:43 +0200	[thread overview]
Message-ID: <8735sfk2pk.fsf@gnus.org> (raw)
In-Reply-To: <CAFw1JJ6Xa_O0v-j_195KyPzrL=1r2gTTrxdwOq2mNNs+-fxevg@mail.gmail.com> (Aaron S. Hawley's message of "Thu, 10 Jan 2013 13:40:39 -0500")

"Aaron S. Hawley" <aaron.s.hawley@gmail.com> writes:

> I can live with these changes except for one:  How do I disable
> sorting so that it goes back to the default order of buffer-list?

This is a general issue with tabulated-list-mode -- there's no way to
get back to the original order after sorting.

That is, the caller will put the data in `tabulated-list-entries', and
it'll be displayed in that order.  When sorting, tabulated-list-mode
will then sort on the data in a column, and that destructively modifies
`tabulated-list-entries'.

So to get back to the original order, we can't rely on re-sorting -- we
really have to know what the original order was, which means that we
have to store that somewhere.  I've now done so in Emacs 28 (stashing it
in a hash table instead of making a copy of the list itself, in case
that has had elements removed in the meantime).

It takes up some extra memory, but it's not done until the user issues a
sorting command, so I think it should be OK.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





      parent reply	other threads:[~2021-07-15 15:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10 18:40 bug#13411: 24.2.91; Sorting in Buffer Menu Mode Aaron S. Hawley
2013-01-30 19:53 ` Glenn Morris
2013-02-01  2:41   ` Aaron S. Hawley
2021-07-15 15:37 ` Lars Ingebrigtsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735sfk2pk.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=13411@debbugs.gnu.org \
    --cc=aaron.s.hawley@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).