From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#35613: Cursor returns to wrong article! Date: Tue, 07 May 2019 14:10:47 +0100 Message-ID: <87sgtqbeaw.fsf@tcd.ie> References: <8736lrujlt.5.fsf@jidanni.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="73750"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: 35613@debbugs.gnu.org To: =?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue May 07 15:11:15 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hNzsJ-000J07-4d for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2019 15:11:15 +0200 Original-Received: from localhost ([127.0.0.1]:46643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNzsI-0007m1-3f for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 May 2019 09:11:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNzs8-0007km-Ga for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 09:11:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNzs7-0007T8-Dq for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 09:11:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44812) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNzs6-0007Sa-AG for bug-gnu-emacs@gnu.org; Tue, 07 May 2019 09:11:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hNzs5-00052S-LP; Tue, 07 May 2019 09:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Tue, 07 May 2019 13:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35613 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 35613-submit@debbugs.gnu.org id=B35613.155723466019361 (code B ref 35613); Tue, 07 May 2019 13:11:01 +0000 Original-Received: (at 35613) by debbugs.gnu.org; 7 May 2019 13:11:00 +0000 Original-Received: from localhost ([127.0.0.1]:58356 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNzs3-00052D-Je for submit@debbugs.gnu.org; Tue, 07 May 2019 09:10:59 -0400 Original-Received: from mail-ed1-f67.google.com ([209.85.208.67]:33195) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hNzrz-00051k-IL for 35613@debbugs.gnu.org; Tue, 07 May 2019 09:10:57 -0400 Original-Received: by mail-ed1-f67.google.com with SMTP id n17so18695448edb.0 for <35613@debbugs.gnu.org>; Tue, 07 May 2019 06:10:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jWpj5LS1rUzeoBAaN0jg9qEU/0TUPpdl6v4kxPnkC6Q=; b=ITsyBPjhcmc83kx7QdRTNC/s0kVKCeY4uBs+Xy7X7hUB1y5V1kLgdQ3KfPvtZyTLQD C40xonbr9nu6eJXtGP2B+bbN94hgebCS4zaBKjgM7SaAVkK6lx1dJSBY6xUlmIcRGbAX Pyws+b1b34fFtydPlHiM+rH2Fd/fHPRc4z98RY/zRLyobZbuc7l/tP+1nDTk3liYthkZ 5OGgGGbiyJQ6HFdqCh99XM0HG3JggyljCD+WlYQjyXKiLJ7QETRI0RW6eZKhkOcV3/Ia 4eqSbxHwNCT/UDYZaB/QZiijyWeGmghQbPORrhWvJWAp5Sq7/ZwZTv04+11CMrw06QBw PL7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=jWpj5LS1rUzeoBAaN0jg9qEU/0TUPpdl6v4kxPnkC6Q=; b=LqyYSBj3VGHGC6CggqbZWjxrzJVlNPHATCb66Fp993KcViC09Jgji2jZQ0xceykMx5 x5K2NAOIRXXc/YJcb7ZF7I5Cb9cEcue+ejfn7ZCFMNrKopeG6znGybnQXpYnYerR5hlT odOXlkvtL7VSxK4kiEwHCyV4UFnE5cj+XfEYhFd+SSiQHW2Jc6KSRmuReiQPsFbgIpNf Q3k7Pvw3djMj5EIoFRA+zLr+8CTWOaxY7qFlEhk3Oe8ZIf4mI0KKG6thdDZ8+YRw5Nl6 hq6xkD+mHcx90vlhLvZwBY2kVpxNQCz5iSqKHav8OWr5bBuc6eklxz80CpUxyKZJaF61 n2yg== X-Gm-Message-State: APjAAAXj120yHQOurNgQ/2+4pYTfEfB7RkfKpqkDUV59NF8AYCM8Bpyk SPDjata1aFqi5qMkeR1Aq5mgChTejO8= X-Google-Smtp-Source: APXvYqyJ5xetEXAo97ko3ad0IaOILa+PFpEPQysPzd/oNmEncXXQvjYh2LLfgsUVWmcF1jB2sK/+ZQ== X-Received: by 2002:a17:906:2447:: with SMTP id a7mr24314392ejb.235.1557234649642; Tue, 07 May 2019 06:10:49 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:6fa:38d6:1fce:ddb3]) by smtp.gmail.com with ESMTPSA id x40sm1628174edx.52.2019.05.07.06.10.48 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 07 May 2019 06:10:48 -0700 (PDT) In-Reply-To: <8736lrujlt.5.fsf@jidanni.org> ("=?UTF-8?Q?=E7=A9=8D=E4=B8=B9=E5=B0=BC?= Dan Jacobson"'s message of "Tue, 07 May 2019 09:41:18 +0800") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:158868 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable tags 35613 + patch quit =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson writes: > I discovered a massive bug. A bug that could cause the user to lose mail. > > In the *Summary* buffer use a few > [next-line] > until the cursor is upon call it, article A. > [gnus-summary-scroll-up] > [next-line] (once or more) > [gnus-summary-scroll-up] > [gnus-summary-widget-forward] > =3D [gnus-article-read-summary-keys] > Even though the ">" arrow at left and the underline are on a different ar= ticle, > but the cursor now returns to Article A!! > > Now if he hits e.g., the E key, he will mark the wrong article! > Or if he forwards it to his grandmother, she will die because he > forwarded the wrong article and she had a heart attack. See, gnus kills p= eople! > > Sure you will argue that that is a feature, however I used the same > [gnus-summary-scroll-up] > twice and for no good reason you remember the first one. > > Gnus v5.13 > GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.4) > of 2019-02-03, modified by Debian This is the user option switch-to-buffer-preserve-window-point in action. If you customise it to nil, the behaviour you describe should go away. This is why Elisp programs should usually use pop-to-buffer et al. instead of switch-to-buffer et al. The following patch should fix that for this case: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-gnus-summary-expand-window-placement-of-point.patch >From 1d7a51d2e3a1c3d5caa77587b3e612feda8bdd59 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 7 May 2019 13:46:22 +0100 Subject: [PATCH] Fix gnus-summary-expand-window placement of point * lisp/gnus/gnus-win.el (gnus-configure-frame): Replace switch-to-buffer with pop-to-buffer-same-window to avoid messing with point. (bug#35613) --- lisp/gnus/gnus-win.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index 5f7154c545..c6469f4937 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -284,7 +284,7 @@ gnus-configure-frame ;; from a hard-dedicated frame, it creates (and ;; configures) a new frame, leaving the dedicated frame alone. (pop-to-buffer buf)) - (t (switch-to-buffer buf))))) + (t (pop-to-buffer-same-window buf))))) (when (memq 'frame-focus split) (setq gnus-window-frame-focus window)) ;; We return the window if it has the `point' spec. -- 2.20.1 --=-=-= Content-Type: text/plain I'll push it to master in a week or so if there are no objections before then. Thanks, -- Basil --=-=-=--