all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Axel Svensson <mail@axelsvensson.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 35049@debbugs.gnu.org
Subject: bug#35049: 25.1; ibuffer-do-sort-by-filename does not sort all buffers
Date: Sat, 30 Mar 2019 16:01:00 +0000	[thread overview]
Message-ID: <CAJ40yayCzkc5owdNc-cEh8okML2Cse=-JMBo+66fZi6fZXdccA@mail.gmail.com> (raw)
In-Reply-To: <83d0m8if0c.fsf@gnu.org>

On Sat, Mar 30, 2019 at 3:00 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Axel Svensson <mail@axelsvensson.com>
> > Date: Sat, 30 Mar 2019 13:36:08 +0000
> >
> > To reproduce:
> >  1) In a shell, run: mkdir ~/dir-a ~/dir-b ~/dir-c
> >  2) In a shell, run: touch ~/dir-a/filea1 ~/dir-c/filec1 ~/dir-c/filc2
> >  3) find-file ~/a and enter 20 characters in this buffer.
> >  4) find-file ~/c and enter 30 characters in this buffer.
> >  5) find-file ~/b and enter 10 characters in this buffer.
> >  6) find-file ~/dir-a
> >  7) find-file ~/dir-c
> >  8) find-file ~/dir-b
> >  9) M-x ibuffer. You should see three Fundamental buffers named a, b,
> >     and c, as well as three "Dired by name" buffers named dir-a, dir-b
> >     and dir-c.
> > 10) Press s s
> > 11) The modeline says "IBuffer by size", and the buffers are ordered by
> >     size, i.e. b,a,c,dir-b,dir-a,dir-c.
> > 12) Press s f
> > 13) The modeline says "IBuffer by filename/process", but not all the
> >     buffers are ordered. The Fundamental buffers are ordered a,b,c
> >     correctly, but the Dired buffers are ordered dir-b,dir-a,dir-c as
> >     before pressing s f.
>
> Dired buffers have the buffer-file-name as nil, which is why their
> order is not changed by "s f".

Thank you, that is a good explanation as to how the current behaviour
came about. I suppose this then becomes a feature request to change the
sorting behaviour to take dired directory into account. Motivation:
A) After pressing s f, the modeline reads "IBuffer by filename/process",
   which the user will undoubtedly interpret as a reference to the
   "Filename/Process" column.
B) The column named Filename/Process is defined in terms of
   ibuffer-buffer-file-name which handles dired buffers as a special
   case, see definition below:
     (defun ibuffer-buffer-file-name ()
       (cond
        ((buffer-file-name))
        ((bound-and-true-p list-buffers-directory))
        ((let ((dirname (and (boundp 'dired-directory)
                             (if (stringp dired-directory)
                                 dired-directory
                               (car dired-directory)))))
             (and dirname (expand-file-name dirname))))))
C) Beyond concerns of consistency and expectation, taking dired
   directories into account when sorting would be quite useful.
   Directories would appear adjacent to files contained within them and
   sorting would depend less on the previous ordering.
D) I would expect this change to be unlikely to break any existent
   workflow.





  reply	other threads:[~2019-03-30 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-30 13:36 bug#35049: 25.1; ibuffer-do-sort-by-filename does not sort all buffers Axel Svensson
2019-03-30 15:00 ` Eli Zaretskii
2019-03-30 16:01   ` Axel Svensson [this message]
2021-08-11 19:08 ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to='CAJ40yayCzkc5owdNc-cEh8okML2Cse=-JMBo+66fZi6fZXdccA@mail.gmail.com' \
    --to=mail@axelsvensson.com \
    --cc=35049@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.