unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Eli Zaretskii <eliz@gnu.org>, Phil Sainty <psainty@orcon.net.nz>
Cc: adam@alphapapa.net, 64911@debbugs.gnu.org
Subject: bug#64911: 30.0.50; switch-to-buffer-preserve-window-point not respected by switch-to-(next|prev)-buffer
Date: Sat, 29 Jul 2023 10:08:17 +0200	[thread overview]
Message-ID: <06f426ed-31e4-befe-f4a9-9b1ba70de1bd@gmx.at> (raw)
In-Reply-To: <83sf98jyc7.fsf@gnu.org>

 >> In practice this is a problem because the position stored in the
 >> `window-prev-buffers' data is a marker (or at least that is the case
 >> in the scenario I am dealing with), and the buffer in question is
 >> periodically erased and regenerated.  Erasing the buffer causes all
 >> its markers to be moved to position 1, so the end result is that the
 >> user loses their place.  (The buffer contents are rebuilt, but the
 >> new content is typically similar if not identical to the old content,
 >> and so maintaining the original position is desirable).
 >
 > This sounds like quite a unique use case to justify a global behavior
 > change of 2 commands.  Can't you achieve what you need by other means?
 > Stashing the value of point or window-point somewhere and then
 > restoring it doesn't sound too complicated to me.
 >
 > Adding martin, in case he has comments and suggestions.

The only idea I have is to handle the "erased and regenerated" case by
invalidating the point markers.  IIUC this means that we have to first
identify the "erased and regenerated" case in 'after-change-functions'
and then use 'window-prev-buffers' to update the POS field of all
entries for that buffer in every window it has shown it.  We will miss
occurrences in saved window configurations if the associated window is
not live.

martin





      reply	other threads:[~2023-07-29  8:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28  5:24 bug#64911: 30.0.50; switch-to-buffer-preserve-window-point not respected by switch-to-(next|prev)-buffer Phil Sainty
     [not found] ` <handler.64911.B.169052190417878.ack@debbugs.gnu.org>
2023-07-28  7:11   ` Phil Sainty
2023-07-28 11:04     ` Eli Zaretskii
2023-07-28  7:21 ` Eli Zaretskii
2023-07-29  8:08   ` martin rudalics [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=06f426ed-31e4-befe-f4a9-9b1ba70de1bd@gmx.at \
    --to=rudalics@gmx.at \
    --cc=64911@debbugs.gnu.org \
    --cc=adam@alphapapa.net \
    --cc=eliz@gnu.org \
    --cc=psainty@orcon.net.nz \
    /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).