From: Eli Zaretskii <eliz@gnu.org>
To: Jose A Ortega Ruiz <jao@gnu.org>
Cc: 53398@debbugs.gnu.org
Subject: bug#53398: 29.0.50; narrow-to-region induces buffer recentering
Date: Fri, 21 Jan 2022 09:07:52 +0200 [thread overview]
Message-ID: <83fsphpnw7.fsf@gnu.org> (raw)
In-Reply-To: <87tudy9l8y.fsf@gnus.jao.io> (message from Jose A Ortega Ruiz on Thu, 20 Jan 2022 20:59:25 +0000)
> From: Jose A Ortega Ruiz <jao@gnu.org>
> Date: Thu, 20 Jan 2022 20:59:25 +0000
>
> (defun message-kill-to-signature (&optional arg)
> "Kill all text up to the signature.
> If a numeric argument or prefix arg is given, leave that number
> of lines before the signature intact."
> (interactive "P" message-mode)
> (save-excursion
> (save-restriction
> (let ((point (point)))
> (narrow-to-region point (point-max)) ;;;;;; <------------------------
> (message-goto-signature)
> (unless (eobp)
> (if (and arg (numberp arg))
> (forward-line (- -1 arg))
> (end-of-line -1)))
> (unless (= point (point))
> (kill-region point (point))
> (unless (bolp)
> (insert "\n")))))))
>
> so i am (wild) guessing that the spurious recenter might be related with
> save-restriction workings in combination with narrow, but i don't really
> know what i'm talking about :)
Any chance of having a reproduction recipe that is simpler and
preferably doesn't include message.el at all? IOW, if your guess is
correct, and the problem is inside narrow-to-region, we shouldn't need
this elaborate setup to show the issue, right? Can you show such a
recipe?
Also, you say "previous behavior was", but when did you see that
previous behavior and in what Emacs version?
> The only variable related to scroll i can see changed from its default
> value in my config is scroll-preserve-screen-position, which i set to
> 'always, but changing its value doesn't affect the behaviour above in
> any way.
So you are saying that this recentering doesn't happen in "emacs -Q",
even if you do invoke that Message mode command? If so, please try
to find which of your customizations do affect it.
next prev parent reply other threads:[~2022-01-21 7:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-20 20:59 bug#53398: 29.0.50; narrow-to-region induces buffer recentering Jose A Ortega Ruiz
2022-01-21 7:07 ` Eli Zaretskii [this message]
2022-01-21 10:08 ` Lars Ingebrigtsen
2022-01-22 19:13 ` Jose A Ortega Ruiz
2022-01-23 6:08 ` Eli Zaretskii
2022-01-23 12:33 ` Lars Ingebrigtsen
2022-01-23 15:42 ` Jose A Ortega Ruiz
2022-01-23 16:12 ` Lars Ingebrigtsen
2022-01-23 16:34 ` Eli Zaretskii
2022-01-23 17:04 ` Jose A Ortega Ruiz
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=83fsphpnw7.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=53398@debbugs.gnu.org \
--cc=jao@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 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).