From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#18545: 24.4.50: Bug - forward-line inside with-selected-window Date: Sat, 27 Sep 2014 22:25:30 +0300 Message-ID: <83tx3ssw5x.fsf@gnu.org> References: <290964377.56621411668876487.JavaMail.www@wwinf7125> <83a95nv9fm.fsf@gnu.org> <542668BA.6010800@gmx.at> <838ul5tpfu.fsf@gnu.org> <54268B0B.1020203@gmx.at> <8361g9tijj.fsf@gnu.org> <5426BD71.4000705@gmx.at> <83zjdlrqti.fsf@gnu.org> <5427099F.6080406@gmx.at> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1411845987 2861 80.91.229.3 (27 Sep 2014 19:26:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Sep 2014 19:26:27 +0000 (UTC) Cc: lompik@voila.fr, 18545@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 27 21:26:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XXxdM-0004hl-UE for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Sep 2014 21:26:21 +0200 Original-Received: from localhost ([::1]:57139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXxdM-0003In-HC for geb-bug-gnu-emacs@m.gmane.org; Sat, 27 Sep 2014 15:26:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXxdE-0003Cy-Sb for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2014 15:26:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXxdA-00040F-3B for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2014 15:26:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:34132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXxd9-0003xQ-VO for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2014 15:26:08 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XXxd4-00015t-AR for bug-gnu-emacs@gnu.org; Sat, 27 Sep 2014 15:26:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Sep 2014 19:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18545 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18545-submit@debbugs.gnu.org id=B18545.14118459504183 (code B ref 18545); Sat, 27 Sep 2014 19:26:02 +0000 Original-Received: (at 18545) by debbugs.gnu.org; 27 Sep 2014 19:25:50 +0000 Original-Received: from localhost ([127.0.0.1]:53929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XXxcr-00015O-Fu for submit@debbugs.gnu.org; Sat, 27 Sep 2014 15:25:49 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:58991) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XXxcn-00015D-Qj for 18545@debbugs.gnu.org; Sat, 27 Sep 2014 15:25:47 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NCK00L00QT9OA00@a-mtaout20.012.net.il> for 18545@debbugs.gnu.org; Sat, 27 Sep 2014 22:25:44 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NCK00LFRRAVAU60@a-mtaout20.012.net.il>; Sat, 27 Sep 2014 22:25:44 +0300 (IDT) In-reply-to: <5427099F.6080406@gmx.at> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:93805 Archived-At: > Date: Sat, 27 Sep 2014 21:01:51 +0200 > From: martin rudalics > CC: lompik@voila.fr, 18545@debbugs.gnu.org > > >> 117 > >> 122 [28 times] > > > > This says point doesn't move, which I don't understand how can > > happen. forward-line doesn't care about anything except moving point > > to the next line. > > But after 28 times point moves which is even less understandable. I don't think this is relevant. It could be related to blink-cursor-mode or some other feature that triggers a more thorough redisplay. (Try typing "M-x", for example.) The code part that seems to be involved in this is an optimization, so when it is not taken, you don't see the problem. > > But if new_vpos is 426 and row->height is 16, then the last row, which > > starts at y = 426, will end at y = 442, i.e. it's fully visible. This > > contradicts what you said earlier, that the last line is only > > partially visible. > > Then why does cursor_row_fully_visible_p return 0 here? Because w->cursor.y is 432, only 10 pixels from the window bottom, which is less than 16 pixels we need for the row. Hmm, I think I see the problem in the logic behind this part: if (!cursor_row_fully_visible_p (w, 0, 0)) { /* Point does appear, but on a line partly visible at end of window. Move it back to a fully-visible line. */ new_vpos = window_box_height (w); /* But if window_box_height suggests a Y coordinate that is not less than we already have, that line will clearly not be fully visible, so give up and scroll the display. This can happen when the default face uses a font whose dimensions are different from the frame's default font. */ if (new_vpos >= w->cursor.y) { w->cursor.vpos = -1; clear_glyph_matrix (w->desired_matrix); goto try_to_scroll; } What I think happens is that window_box_height tells us to put the cursor at y = 426, but the first row that fits that is too far down, due to the window size being not an integral multiple of the font height. So the condition to goto try_to_scroll needs to become smarter. Can you show all the values of MATRIX_ROW_BOTTOM_Y that are examined in this loop, after we determine that new_vpos should be 426: row = MATRIX_FIRST_TEXT_ROW (w->desired_matrix); while (MATRIX_ROW_BOTTOM_Y (row) < new_vpos) ++row; > You probably mean I should answer that myself but honestly I don't > understand cursor_row_fully_visible_p much. Which part of it do you not understand?