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: Sat, 29 Sep 2018 08:35:51 +0000 Message-ID: <20180929083551.GA4139@ACM> References: <8336tv8iv7.fsf@gnu.org> <20180928203151.GB5172@ACM> <838t3l71ow.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 1538210411 6312 195.159.176.226 (29 Sep 2018 08:40:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 29 Sep 2018 08:40: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 Sat Sep 29 10:40:07 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 1g6AnF-0001WX-Rw for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 10:40:06 +0200 Original-Received: from localhost ([::1]:49961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6ApM-00059E-7s for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Sep 2018 04:42:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6ApB-00058x-Vr for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 04:42:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6Ap8-0000lq-Na for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 04:42:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:53993) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6Ap8-0000lm-Iq for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 04:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1g6Ap8-0006Lc-8p for bug-gnu-emacs@gnu.org; Sat, 29 Sep 2018 04:42: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: Sat, 29 Sep 2018 08:42: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.153821048724352 (code B ref 32848); Sat, 29 Sep 2018 08:42:02 +0000 Original-Received: (at 32848) by debbugs.gnu.org; 29 Sep 2018 08:41:27 +0000 Original-Received: from localhost ([127.0.0.1]:58251 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g6AoZ-0006Ki-Gq for submit@debbugs.gnu.org; Sat, 29 Sep 2018 04:41:27 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:34592 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1g6AoX-0006KY-Qj for 32848@debbugs.gnu.org; Sat, 29 Sep 2018 04:41:26 -0400 Original-Received: (qmail 49925 invoked by uid 3782); 29 Sep 2018 08:41:24 -0000 Original-Received: from acm.muc.de (p5B146BF5.dip0.t-ipconnect.de [91.20.107.245]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 29 Sep 2018 10:41:22 +0200 Original-Received: (qmail 6016 invoked by uid 1000); 29 Sep 2018 08:35:51 -0000 Content-Disposition: inline In-Reply-To: <838t3l71ow.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:150749 Archived-At: Hello, Eli. On Sat, Sep 29, 2018 at 00:27:11 +0300, Eli Zaretskii wrote: > > Date: Fri, 28 Sep 2018 20:31:51 +0000 > > Cc: Allen Li , Anders Lindgren , > > 32848@debbugs.gnu.org > > From: Alan Mackenzie > > (iv) Redisplay sees w->force_start true and > > make_cursor_line_fully_visible_p also true. These conflict with > > eachother here. Priority is given to make_cursor_...._p. > > Why does w->force_start not have priority here? > Because by default we don't want to show the cursor in a partial line, > ever: such a line might not be legible. Over the years, more and more > rare use cases were reported where such a situation happens, and we > fixed them one by one. Evidently, this is the popular demand. OK. > Follow-mode is special in this regard, because with it, showing a > partial line is not a flaw, as that same line will be fully visible in > the next window, and follow-mode actually switches to that next > window. So we need to tell the display engine to behave specially in > this case. I suggested 2 ways of doing that, the simple one actually > does what you expected, i.e. the force_start flag will win. This feels a bit like a workaround: there is a last follow mode window where the cursor, if it ends up in the last line, doesn't have a next window to move to. Also, the user can change make-cursor-line-fully-visible at any time, unlikely though this is. I propose the following solution: at the critical piece of code in follow mode's post-command-hook, follow mode should check make-cursor-...-p, and if non-nil, determine, using pos-visible-in-window-p whether the cursor is in the last partial line. If so, move it one line higher. In follow-mode, the positions of point in the non-selected windows are fairly random anyway. As an aside, make-cursor-...-p doesn't appear in either the Emacs manual or the Elisp manual, and the documentation for set-window-position doesn't mention it. I can feel a documentation writing urge coming on. -- Alan Mackenzie (Nuremberg, Germany).