From: Alan Mackenzie <acm@muc.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32848@debbugs.gnu.org, andlind@gmail.com, darkfeline@felesatra.moe
Subject: bug#32848: 26.1; follow-mode cursor move breaks with frame-resize-pixelwise
Date: Sun, 30 Sep 2018 14:09:21 +0000 [thread overview]
Message-ID: <20180930140921.GD6305@ACM> (raw)
In-Reply-To: <83sh1r3zz9.fsf@gnu.org>
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 <acm@muc.de>
> > > 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).
next prev parent reply other threads:[~2018-09-30 14:09 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-26 22:49 bug#32848: 26.1; follow-mode cursor move breaks with frame-resize-pixelwise Allen Li
2018-09-27 6:04 ` Eli Zaretskii
2018-09-27 8:06 ` Eli Zaretskii
2018-09-28 20:31 ` Alan Mackenzie
2018-09-28 21:27 ` Eli Zaretskii
2018-09-29 8:35 ` Alan Mackenzie
2018-09-29 10:26 ` Eli Zaretskii
2018-09-29 11:25 ` Alan Mackenzie
2018-09-29 13:47 ` Eli Zaretskii
2018-09-29 13:56 ` Eli Zaretskii
2018-09-29 14:48 ` Alan Mackenzie
2018-09-29 15:06 ` Eli Zaretskii
2018-09-29 20:25 ` Alan Mackenzie
2018-09-30 5:30 ` Eli Zaretskii
2018-09-30 11:16 ` Eli Zaretskii
2018-09-30 12:16 ` Alan Mackenzie
2018-09-30 12:56 ` Eli Zaretskii
2018-09-30 14:09 ` Alan Mackenzie [this message]
2018-09-30 17:00 ` Eli Zaretskii
2018-10-01 12:33 ` Alan Mackenzie
2018-10-01 13:47 ` Eli Zaretskii
2018-10-15 9:23 ` Alan Mackenzie
2018-10-15 15:07 ` Eli Zaretskii
2018-10-15 17:26 ` Alan Mackenzie
2018-10-15 18:02 ` Eli Zaretskii
2018-09-30 11:02 ` Alan Mackenzie
2018-09-30 11:24 ` Eli Zaretskii
2018-09-30 13:55 ` Alan Mackenzie
2018-10-17 10:17 ` Alan Mackenzie
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=20180930140921.GD6305@ACM \
--to=acm@muc.de \
--cc=32848@debbugs.gnu.org \
--cc=andlind@gmail.com \
--cc=darkfeline@felesatra.moe \
--cc=eliz@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).