From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lompik@voila.fr Newsgroups: gmane.emacs.bugs Subject: bug#18545: 24.4.50: Bug - forward-line inside with-selected-window Date: Tue, 30 Sep 2014 00:56:38 +0200 (CEST) Message-ID: <1431677111.300361412031398151.JavaMail.www@wwinf7125> References: <1107752996.69181411565675842.JavaMail.www@wwinf7125> Reply-To: lompik@voila.fr NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1412031456 20241 80.91.229.3 (29 Sep 2014 22:57:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Sep 2014 22:57:36 +0000 (UTC) Cc: 18545@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 30 00:57:30 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 1XYjsf-0001Lw-Ke for geb-bug-gnu-emacs@m.gmane.org; Tue, 30 Sep 2014 00:57:21 +0200 Original-Received: from localhost ([::1]:39593 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYjsf-0005zs-9J for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Sep 2014 18:57:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYjsX-0005zd-FJ for bug-gnu-emacs@gnu.org; Mon, 29 Sep 2014 18:57:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYjsR-0002Vi-QN for bug-gnu-emacs@gnu.org; Mon, 29 Sep 2014 18:57:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35836) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYjsR-0002UZ-Mv for bug-gnu-emacs@gnu.org; Mon, 29 Sep 2014 18:57:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XYjsM-0004Oc-Dh for bug-gnu-emacs@gnu.org; Mon, 29 Sep 2014 18:57:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: lompik@voila.fr Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Sep 2014 22:57: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.141203140516873 (code B ref 18545); Mon, 29 Sep 2014 22:57:02 +0000 Original-Received: (at 18545) by debbugs.gnu.org; 29 Sep 2014 22:56:45 +0000 Original-Received: from localhost ([127.0.0.1]:55633 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XYjs4-0004O3-Qp for submit@debbugs.gnu.org; Mon, 29 Sep 2014 18:56:45 -0400 Original-Received: from smtpout1.voila.fr ([193.252.22.125]:37920 helo=smtpout.voila.fr) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XYjs1-0004Ns-6w for 18545@debbugs.gnu.org; Mon, 29 Sep 2014 18:56:42 -0400 Original-Received: from wwinf7125 ([10.232.48.92]) by mwinf5d28 with ME id xAwe1o00A1zLhPN03Awe95; Tue, 30 Sep 2014 00:56:38 +0200 X-ME-Helo: wwinf7125 X-ME-Auth: bG9tcGlrQHZvaWxhLmZy X-ME-Date: Tue, 30 Sep 2014 00:56:38 +0200 X-ME-IP: 108.79.16.77 In-Reply-To: <838ul2mkxi.fsf@gnu.org> X-Originating-IP: [108.79.16.77] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-CC: |~| X-WUM-REPLYTO: |~| 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:93883 Archived-At: I tested revno 117521. No more issues.=20 I also experimented with increased font size + tall lines (which were trunc= ated) in buffer and was unable to reproduce the issue.=20 Thanks again ! > Thanks for testing. I would actually like to commit a slightly > different patch below, which should be safer, as it won't fail with > very tall lines which are taller than the window in which you scroll. >=20 > So if you have time, please try the patch below. I already verified > that it works with all 3 of your recipes, but I understand that your > real use case is with Helm, which I don't have and couldn't try. >=20 > Thanks. >=20 > =3D=3D=3D modified file 'src/window.c' > --- src/window.c 2014-09-11 08:47:34 +0000 > +++ src/window.c 2014-09-29 06:03:36 +0000 > @@ -5897,6 +5897,8 @@ and redisplay normally--don't erase and=20 > w->start_at_line_beg =3D (bytepos =3D=3D BEGV_BYTE || > FETCH_BYTE (bytepos - 1) =3D=3D '\n'); >=20 > + wset_redisplay (w); > + > set_buffer_internal (obuf); > return Qnil; > } >=20 > =3D=3D=3D modified file 'src/xdisp.c' > --- src/xdisp.c 2014-09-18 15:10:33 +0000 > +++ src/xdisp.c 2014-09-29 16:35:45 +0000 > @@ -15027,6 +15027,10 @@ run_window_scroll_functions (Lisp_Object > If FORCE_P is non-zero, return 0 even if partial visible cursor row > is higher than window. >=20 > + If CURRENT_MATRIX_P is non-zero, use the information from the > + window's current glyph matrix; otherwise uze the desired glyph > + matrix. > + > A value of 0 means the caller should do scrolling > as if point had gone off the screen. */ >=20 > @@ -16136,26 +16140,48 @@ redisplay_window (Lisp_Object window, bo >=20 > /* If someone specified a new starting point but did not insist, > check whether it can be used. */ > - if (w->optional_new_start > + if ((w->optional_new_start || window_frozen_p (w)) > && CHARPOS (startp) >=3D BEGV > && CHARPOS (startp) <=3D ZV) > { > + ptrdiff_t it_charpos; > + > w->optional_new_start =3D 0; > start_display (&it, w, startp); > move_it_to (&it, PT, 0, it.last_visible_y, -1, > MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); > - if (IT_CHARPOS (it) =3D=3D PT) > - w->force_start =3D 1; > - /* IT may overshoot PT if text at PT is invisible. */ > - else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <=3D PT) > - w->force_start =3D 1; > + /* Record IT's position now, since line_bottom_y might change > + that. */ > + it_charpos =3D IT_CHARPOS (it); > + /* Make sure we set the force_start flag only if the cursor row > + will be fully visible. Otherwise, the code under force_start > + label below will try to move point back into view, which is > + not what the code which sets optional_new_start wants. */ > + if ((it.current_y =3D=3D 0 || line_bottom_y (&it) < it.last_visible_y) > + && !w->force_start) > + { > + if (it_charpos =3D=3D PT) > + w->force_start =3D 1; > + /* IT may overshoot PT if text at PT is invisible. */ > + else if (it_charpos > PT && CHARPOS (startp) <=3D PT) > + w->force_start =3D 1; > +#ifdef GLYPH_DEBUG > + if (w->force_start) > + { > + if (window_frozen_p (w)) > + debug_method_add (w, "set force_start from frozen window start"); > + else > + debug_method_add (w, "set force_start from optional_new_start"); > + } > +#endif > + } > } >=20 > force_start: >=20 > /* Handle case where place to start displaying has been specified, > unless the specified location is outside the accessible range. */ > - if (w->force_start || window_frozen_p (w)) > + if (w->force_start) > { > /* We set this later on if we have to adjust point. */ > int new_vpos =3D -1; > @@ -16200,7 +16226,7 @@ redisplay_window (Lisp_Object window, bo > goto need_larger_matrices; > } >=20 > - if (w->cursor.vpos < 0 && !window_frozen_p (w)) > + if (w->cursor.vpos < 0) > { > /* If point does not appear, try to move point so it does > appear. The desired matrix has been built above, so we > @@ -16293,6 +16319,11 @@ redisplay_window (Lisp_Object window, bo > } > */ > } > + if (w->cursor.vpos < 0 || !cursor_row_fully_visible_p (w, 0, 0)) > + { > + clear_glyph_matrix (w->desired_matrix); > + goto try_to_scroll; > + } >=20 > #ifdef GLYPH_DEBUG > debug_method_add (w, "forced window start"); > @@ -16357,7 +16388,8 @@ redisplay_window (Lisp_Object window, bo > || CHARPOS (startp) =3D=3D BEGV > || !window_outdated (w))) > { > - int d1, d2, d3, d4, d5, d6; > + int d1, d2, d5, d6; > + int rtop, rbot; >=20 > /* If first window line is a continuation line, and window start > is inside the modified region, but the first change is before > @@ -16382,14 +16414,20 @@ redisplay_window (Lisp_Object window, bo > && compute_window_start_on_continuation_line (w) > /* It doesn't make sense to force the window start like we > do at label force_start if it is already known that point > - will not be visible in the resulting window, because > + will not be fully visible in the resulting window, because > doing so will move point from its correct position > instead of scrolling the window to bring point into view. > See bug#9324. */ > - && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) > + && pos_visible_p (w, PT, &d1, &d2, &rtop, &rbot, &d5, &d6) > + /* A very tall row could need more than the window height, > + in which case we accept that it is partially visible. */ > + && (rtop !=3D 0) =3D=3D (rbot !=3D 0)) > { > w->force_start =3D 1; > SET_TEXT_POS_FROM_MARKER (startp, w->start); > +#ifdef GLYPH_DEBUG > + debug_method_add (w, "recomputed window start in continuation line"); > +#endif > goto force_start; > } >=20 >=20 >=20 ___________________________________________________________ Mode, hifi, maison,=E2=80=A6 J'ach=C3=A8te malin. Je compare les prix avec = Voila.fr http://shopping.voila.fr/