Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

bug#9761: proposed list-buffers change -- revert buffer if point is in *Buffer List* buffer

1 view
Skip to first unread message

martin rudalics

unread,
Oct 15, 2011, 6:27:38 AM10/15/11
to Zachary Kanfer, 97...@debbugs.gnu.org
> ! (if (string= (buffer-name)
> ! "*Buffer List*")
> ! (revert-buffer)

This doesn't strike me as TRT when "*Buffer List*" is currently not
visible in any window. So you probably want something like

(if (and (string= (buffer-name) "*Buffer List*")
(get-buffer-window (buffer-name) 0))
(revert-buffer)
(display-buffer (list-buffers-noselect files-only)))

here (but I don't use `list-buffers').

> ! (display-buffer (list-buffers-noselect files-only))))

martin



Chong Yidong

unread,
Oct 15, 2011, 1:14:49 PM10/15/11
to Zachary Kanfer, 97...@debbugs.gnu.org
Zachary Kanfer <zka...@gmail.com> writes:

> The command list-buffers always puts point at the end of the
> buffer. This patch changes the list-buffers command to simply revert
> the buffer if point is inside the *Buffer List* buffer. Since point is
> kept at the same line, the user can more easily see what changes have
> occurred.

This doesn't seem like a good idea. It is better for `list-buffers' to
behave as unsurprisingly as possible, i.e. regardless of whether it's
called from a buffer list.

After all, the user can always call revert-buffer if that's what's
desired.




Zachary Kanfer

unread,
Oct 15, 2011, 2:00:55 PM10/15/11
to Chong Yidong, 97...@debbugs.gnu.org
I agree -- less surprising is better. To me, that means *not* moving point when it's called again. It makes it easier for the user to answer the question "what's changed?", which, at least for me, is a common question when I already have a buffer list window open. Would you be in favor of this change if I can use Martin's suggestion so that the behavior is the same no matter if point is in the Buffer List buffer or not?

You are right, though -- the user can call revert-buffer (which is bound to 'g' in Buffer Menu mode) if desired. But for calling `list-buffers', I think that for the vast majority of cases, keeping point where it is is either superior to putting it at the bottom, or just as good. I can't think of too many cases where moving point to the bottom of the buffer is better.

-Zachary

Stefan Monnier

unread,
Oct 16, 2011, 11:50:28 AM10/16/11
to Zachary Kanfer, 97...@debbugs.gnu.org
> ! (display-buffer (list-buffers-noselect files-only)))
[...]
> ! (if (string= (buffer-name)
> ! "*Buffer List*")
> ! (revert-buffer)
> ! (display-buffer (list-buffers-noselect files-only))))

I don't think calling revert-buffer is right. Much better would be for
list-buffer-noselect to try to preserve point when reusing a buffer
rather than creating a new one.


Stefan



Lars Ingebrigtsen

unread,
Feb 25, 2016, 1:41:10 AM2/25/16
to Zachary Kanfer, 97...@debbugs.gnu.org
Zachary Kanfer <zka...@gmail.com> writes:

> The command list-buffers always puts point at the end of the
> buffer. This patch changes the list-buffers command to simply revert
> the buffer if point is inside the *Buffer List* buffer. Since point is
> kept at the same line, the user can more easily see what changes have
> occurred.

I think it makes sense to have `M-x list-buffers' always place the point
in the same place. If the user wants to update the list, then the `g'
command is available and handy, and doesn't move the point around. So
I'm closing this bug report.

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



0 new messages