unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Juri Linkov <juri@linkov.net>
Cc: 69993@debbugs.gnu.org
Subject: bug#69993: Wrap window buffers while cycling
Date: Wed, 27 Mar 2024 09:48:38 +0100	[thread overview]
Message-ID: <5c71ea64-0f97-4b90-af61-1156fe33f1ea@gmx.at> (raw)
In-Reply-To: <86h6gs2lk7.fsf@mail.linkov.net>

 >> I'm not sure I understand.  IIRC 'window-next-buffers' always returns
 >> nil unless you invoked 'switch-to-prev-buffer' before.  It serves to
 >> "navigate" a window's buffer list, in particular, to "undo" preceding
 >> 'previous-buffer' calls when overshooting.  'switch-to-buffer' is not
 >> part of such a scenario.
 >
 > A new option should always keep the fixed order, even when users use C-x b
 > to visit a buffer that appeared in the window before.

What is the "fixed order"?  When I use C-x b, that buffer becomes the
one most recently shown in that window.

 > The problem is that there is no function that is called after
 > set-window-buffer to reset the order of prev/next-buffers.
 >
 > set-window-buffer works that way that before changing the window buffer
 > it calls record-window-buffer.  But record-window-buffer has
 > no information about new-buffer.  So it can't reorder prev/next-buffers
 > based on new-buffer that will be displayed in this window.
 >
 > Then later set-window-buffer sets window's buffer,
 > but after that it doesn't call any function like
 > record-window-buffer that could reorder prev/next-buffers.
 >
 > Then maybe possible to add such reordering after calling
 > set-window-buffer?  I mean such places as after calling
 > set-window-buffer in window--display-buffer, and after calling
 > set-window-buffer in switch-to-buffer.

Then give 'record-window-buffer' a second argument - the new buffer to
be shown.  I'm a bit reluctant to work in this area - the introduction
of 'push-window-buffer-onto-prev' has obfuscated the code considerably
for no apparent use (at least one that I could understand).

 > Ok, here is the current patch that supports the fixed order
 > for 'C-x C-left' and 'C-x C-right' but still not for 'C-x b':

I see no problems with it.  After C-x b *foo* I want to return to *foo*
via 'previous-buffer' after switching to *bar* via a second C-x b.  What
would you want to see instead?  Maybe I still misunderstand you.

I think 'switch-to-prev-buffer-wrap' already confuses things.  Wrapping,
for me, means to wrap around like when navigating on a ring of buffers.
Whether this should include buffers never shown in the window before is
a different issue IMO.  And whether C-x b should change the order is yet
another issue.  So maybe we need three options instead of one...

martin






  reply	other threads:[~2024-03-27  8:48 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25  7:42 bug#69993: Wrap window buffers while cycling Juri Linkov
2024-03-25  9:41 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-25 17:16   ` Juri Linkov
2024-03-26  9:56     ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-27  7:20       ` Juri Linkov
2024-03-27  8:48         ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-03-28  7:54           ` Juri Linkov
2024-03-28  9:19             ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28 17:57               ` Juri Linkov
2024-03-29  8:45                 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-29 16:35                   ` Juri Linkov
2024-03-30  9:37                     ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30 18:24                       ` Juri Linkov
2024-03-31  8:32                         ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-02  6:37                           ` Juri Linkov
2024-04-02  8:22                             ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-02 16:28                               ` Juri Linkov
2024-04-03  8:24                                 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-03 17:45                                   ` Juri Linkov
2024-04-04  8:03                                     ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-05  6:45                                       ` Juri Linkov
2024-04-05  9:08                                         ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-05 16:32                                           ` Juri Linkov
2024-04-06 18:43                                             ` Juri Linkov
2024-04-07  8:23                                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09  6:35                                                 ` Juri Linkov
2024-04-09  9:04                                                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-09 16:37                                                     ` Juri Linkov
2024-04-10  8:46                                                       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-10 17:45                                                         ` Juri Linkov
2024-04-11  9:18                                                           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-12  6:35                                                             ` Juri Linkov
2024-04-12  8:37                                                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-12 16:23                                                                 ` Juri Linkov
2024-04-14 16:15                                                                   ` Juri Linkov
2024-04-16  6:38                                                                     ` Juri Linkov
2024-04-17 17:56                                                                       ` Juri Linkov
2024-04-24 16:39                                                                         ` Juri Linkov
2024-04-25  8:31                                                                           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-25 17:40                                                                             ` Juri Linkov
2024-04-02 16:34                               ` Juri Linkov
2024-04-03  8:24                                 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-03 17:44                                   ` Juri Linkov
2024-04-04  6:22                                 ` Juri Linkov
2024-04-02 16:40                               ` Juri Linkov

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=5c71ea64-0f97-4b90-af61-1156fe33f1ea@gmx.at \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69993@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=rudalics@gmx.at \
    /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).