From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#32848: 26.1; follow-mode cursor move breaks with frame-resize-pixelwise Date: Sun, 30 Sep 2018 14:09:21 +0000 Message-ID: <20180930140921.GD6305@ACM> References: <83sh1s61mj.fsf@gnu.org> <20180929112520.GA5008@ACM> <83r2hc5sbf.fsf@gnu.org> <20180929144846.GC5008@ACM> <83k1n45onn.fsf@gnu.org> <20180929202545.GE5008@ACM> <83efdb5z73.fsf@gnu.org> <8336tr5j6j.fsf@gnu.org> <20180930121618.GB6305@ACM> <83sh1r3zz9.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1538316851 2719 195.159.176.226 (30 Sep 2018 14:14:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Sep 2018 14:14:11 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) Cc: 32848@debbugs.gnu.org, andlind@gmail.com, darkfeline@felesatra.moe To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 30 16:14:06 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6cU2-0000c8-2k for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2018 16:14:06 +0200 Original-Received: from localhost ([::1]:55543 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6cW8-0003TH-GO for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Sep 2018 10:16:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6cVy-0003Rs-1C for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 10:16:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6cVu-00008X-Rj for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 10:16:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55828) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6cVu-00008R-LW for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 10:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6cVu-0003tQ-Cl for bug-gnu-emacs@gnu.org; Sun, 30 Sep 2018 10:16:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 30 Sep 2018 14:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32848 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32848-submit@debbugs.gnu.org id=B32848.153831690514879 (code B ref 32848); Sun, 30 Sep 2018 14:16:02 +0000 Original-Received: (at 32848) by debbugs.gnu.org; 30 Sep 2018 14:15:05 +0000 Original-Received: from localhost ([127.0.0.1]:60086 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6cUy-0003ru-QZ for submit@debbugs.gnu.org; Sun, 30 Sep 2018 10:15:05 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:30484 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1g6cUw-0003rQ-JZ for 32848@debbugs.gnu.org; Sun, 30 Sep 2018 10:15:03 -0400 Original-Received: (qmail 39291 invoked by uid 3782); 30 Sep 2018 14:15:01 -0000 Original-Received: from acm.muc.de (p5B14620D.dip0.t-ipconnect.de [91.20.98.13]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 30 Sep 2018 16:15:00 +0200 Original-Received: (qmail 8325 invoked by uid 1000); 30 Sep 2018 14:09:21 -0000 Content-Disposition: inline In-Reply-To: <83sh1r3zz9.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de 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: 208.118.235.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:150817 Archived-At: Hello again, Eli. On Sun, Sep 30, 2018 at 15:56:58 +0300, Eli Zaretskii wrote: > > Date: Sun, 30 Sep 2018 12:16:18 +0000 > > Cc: 32848@debbugs.gnu.org, andlind@gmail.com, darkfeline@felesatra.moe > > From: Alan Mackenzie > > > Now done on the master branch. > > Great! > > My bit is now ready, too, and I was just about to commit it. But... > > There's a problem. If you move point with C-n from the LH window to the > > RH window, LH point stays on the partially visible line. If you now do > > C-x o, point moves to that position, but follow-mode decides that the RH > > window is appropriate for displaying that point, so C-x o appears not to > > be working. > I see this before the change, just by setting > make-cursor-line-fully-visible to nil. So it's not because of these > changes. > > I'll see what I can come up with to sort this out. > Yes, probably follow-mode needs to apply some smarts here. The problem was that LH point was "straddling" the window "edge". The solution appears to be to copy what happens when LH point is outside the window, i.e. allow redisplay to move it back to the centre of the window. For this, a simple (forward-line) suffices. The trouble is, all the make-cursor-line-fully-visible stuff we've done then becomes redundant, since point will never be left inside a partially displayed line, except possibly at EOB. Here's my current patch. What do you think? diff --git a/lisp/follow.el b/lisp/follow.el index 7aa7b51473..6300be1909 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -1382,7 +1387,13 @@ follow-adjust-window (unless (eq win (selected-window)) (let ((p (window-point win))) (set-window-start win (window-start win) nil) - (set-window-point win p)))) + (if (nth 2 (pos-visible-in-window-p p win t)) + ;; p is in a partially visible line. We can't leave + ;; window-point there, because C-x o back into WIN + ;; would then fail. + (with-selected-window win + (forward-line)) ; redisplay will recenter it in WIN. + (set-window-point win p))))) (unless visible ;; If point may not be visible in the selected window, -- Alan Mackenzie (Nuremberg, Germany).