From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53398: 29.0.50; narrow-to-region induces buffer recentering Date: Fri, 21 Jan 2022 09:07:52 +0200 Message-ID: <83fsphpnw7.fsf@gnu.org> References: <87tudy9l8y.fsf@gnus.jao.io> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36760"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 53398@debbugs.gnu.org To: Jose A Ortega Ruiz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 21 10:22:06 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nAq7S-0009E0-2I for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jan 2022 10:22:06 +0100 Original-Received: from localhost ([::1]:42112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nAq7Q-00026I-IP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 21 Jan 2022 04:22:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAo2g-0005kr-Pv for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2022 02:09:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nAo2f-0004HL-V1 for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2022 02:09:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nAo2f-0001qf-NL for bug-gnu-emacs@gnu.org; Fri, 21 Jan 2022 02:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Jan 2022 07:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53398 X-GNU-PR-Package: emacs Original-Received: via spool by 53398-submit@debbugs.gnu.org id=B53398.16427488827026 (code B ref 53398); Fri, 21 Jan 2022 07:09:01 +0000 Original-Received: (at 53398) by debbugs.gnu.org; 21 Jan 2022 07:08:02 +0000 Original-Received: from localhost ([127.0.0.1]:60064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAo1h-0001p6-L3 for submit@debbugs.gnu.org; Fri, 21 Jan 2022 02:08:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nAo1e-0001oh-Vq for 53398@debbugs.gnu.org; Fri, 21 Jan 2022 02:07:59 -0500 Original-Received: from [2001:470:142:3::e] (port=34864 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAo1Z-00044k-0d; Fri, 21 Jan 2022 02:07:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=IbaZcFVRnl4ZdDx1lKyFGw/H0jwFPiQ8gdwmP98W72s=; b=SViJFTHBhIzS RWsSybk+QseCBY0e1P0L3dVhUr/omtcMmKKluyY4OE77rMU+TE/hzwUnKKfxh+ZJCyjuAUA3zgvZV tXedOrEgnXC/laEuA7De8ppnrfGTeE8vSycbvDAY6VG6RwupTI75CguyfkB9C25zZ3dNz/hPSLTsW cU+55VhWKXNEQHiVDiuc5/t3BXvuii73pzyUBwuU5v7qH02ARC85S32zwGyPoSr7OEgSMHgk3NWKW D+HaOLbDbRQuMsTN7Di57b864JanuTkeesOjYGDUSoSOXKXfqg/0gfkFvXH+4XfdmktARjSJUGKpt x7bnDyyvvawv0rD3GOJ3yA==; Original-Received: from [87.69.77.57] (port=2213 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nAo1X-0005ni-6L; Fri, 21 Jan 2022 02:07:52 -0500 In-Reply-To: <87tudy9l8y.fsf@gnus.jao.io> (message from Jose A Ortega Ruiz on Thu, 20 Jan 2022 20:59:25 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:224724 Archived-At: > From: Jose A Ortega Ruiz > 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.