GNU bug report logs -
#13411
24.2.91; Sorting in Buffer Menu Mode
Previous Next
Reported by: "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Date: Thu, 10 Jan 2013 22:11:02 UTC
Severity: normal
Found in version 24.2.91
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 13411 in the body.
You can then email your comments to 13411 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13411
; Package
emacs
.
(Thu, 10 Jan 2013 22:11:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
"Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Thu, 10 Jan 2013 22:11:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The old Buffer Menu Mode would sort only on 4 columns:
M-x buffer-menu -- sort by display time
M-2 M-x Buffer-menu-sort -- sort by name
M-3 M-x Buffer-menu-sort -- sort by size (ascending)
M-4 M-x Buffer-menu-sort -- sort by mode
M-5 M-x Buffer-menu-sort -- sort by file name
M-x Buffer-menu-sort -- go back to sorting by display time
The new Bufer Menu Mode can sort on 7 fields:
M-x buffer-menu -- sort by display time
M-0 M-x Buffer-menu-sort -- sort by current buffer (there is none!)
M-1 M-x Buffer-menu-sort -- sort by read-only
M-2 M-x Buffer-menu-sort -- sort by modification flag
M-3 M-x Buffer-menu-sort -- sort by name
M-4 M-x Buffer-menu-sort -- sort by size (descending)
M-5 M-x Buffer-menu-sort -- sort by mode
M-6 M-x Buffer-menu-sort -- sort by file name
M-x Buffer-menu-sort -- sort by the column at point
Repeating any of these twice reverses the order. If sorting by size
descending, then sorting by size again switches to ascending.
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? The
only way to do is to kill the buffer for Buffer Menu and run C-x C-b
to reopen it.
M-x buffer-menu -- update the list, but keep the sort
C-x k RET M-x buffer-menu -- go back to sorting by display time
Maybe it could with the M-0 argument since it's not being used. Or
maybe a M-- argument since negative columns don't exist? Although,
with 7 columns to remember now, maybe sorting the second to last
column with M-- M-2 should be available.
Otherwise looking forward to Emacs 24.3!
aaron
--
In general, we reserve the right to have a poor
memory--the computer, however, is supposed to
remember! Poor computer. -- Guy Lewis Steele Jr.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13411
; Package
emacs
.
(Wed, 30 Jan 2013 19:55:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 13411 <at> debbugs.gnu.org (full text, mbox):
"Aaron S. Hawley" wrote:
> How do I disable sorting so that it goes back to the default order of
> buffer-list?
This is a tabulated list mode issue.
Maybe you can just (setq tabulated-list-sort-key nil); followed by g.
There's no UI for that at present AFAICS.
If the list of items is slow to generate, it may be better to cached the
original order and restore it.
> Maybe it could with the M-0 argument since it's not being used. Or
> maybe a M-- argument since negative columns don't exist? Although,
> with 7 columns to remember now, maybe sorting the second to last
> column with M-- M-2 should be available.
Maybe 0 S is a good suggestion.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13411
; Package
emacs
.
(Fri, 01 Feb 2013 02:42:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 13411 <at> debbugs.gnu.org (full text, mbox):
>> How do I disable sorting so that it goes back to the default order of
>> buffer-list?
>
> This is a tabulated list mode issue.
> Maybe you can just (setq tabulated-list-sort-key nil); followed by g.
Nice hack! I also noticed another hack where you can reset the buffer
list by doing M-0 M-x Bufer-menu-sort RET and then followed by g as
well.
>> Maybe it could with the M-0 argument since it's not being used. Or
>> maybe a M-- argument since negative columns don't exist? Although,
>> with 7 columns to remember now, maybe sorting the second to last
>> column with M-- M-2 should be available.
>
> Maybe 0 S is a good suggestion.
Agreed. Unfortunately, tabulated-list-mode is 0-based. So other
modes based on t-l-m might want to sort on the first column (in my
last email I pointed out at the sorting on the current buffer is
pointless). I'd suggest making it 1-based. This would affect Buffer
Menu
M-x buffer-menu -- sort by display time
M-1 M-x Buffer-menu-sort -- sort by current buffer (there is none!)
M-2 M-x Buffer-menu-sort -- sort by read-only
M-3 M-x Buffer-menu-sort -- sort by modification flag
M-4 M-x Buffer-menu-sort -- sort by name
M-5 M-x Buffer-menu-sort -- sort by size (descending)
M-6 M-x Buffer-menu-sort -- sort by mode
M-7 M-x Buffer-menu-sort -- sort by file name
M-x Buffer-menu-sort -- sort by the column at point
I forgot to mention the `tabulated-list-sort' command doesn't even
understand a bare C-u argument. Just numeric ones. That should be
fixed as well.
I can work on a patch for all this if it sounds good.
/a
--
In general, we reserve the right to have a poor
memory--the computer, however, is supposed to
remember! Poor computer. -- Guy Lewis Steele Jr.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#13411
; Package
emacs
.
(Thu, 15 Jul 2021 15:38:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 13411 <at> debbugs.gnu.org (full text, mbox):
"Aaron S. Hawley" <aaron.s.hawley <at> 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
bug marked as fixed in version 28.1, send any further explanations to
13411 <at> debbugs.gnu.org and "Aaron S. Hawley" <aaron.s.hawley <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Thu, 15 Jul 2021 15:39:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 13 Aug 2021 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 4 years and 30 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.