From debbugs-submit-bounces@debbugs.gnu.org Sun May 31 10:50:14 2015 Received: (at submit) by debbugs.gnu.org; 31 May 2015 14:50:14 +0000 Received: from localhost ([127.0.0.1]:35014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yz4Z2-0006UA-UX for submit@debbugs.gnu.org; Sun, 31 May 2015 10:50:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45772) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yz4Z0-0006Tv-4l for submit@debbugs.gnu.org; Sun, 31 May 2015 10:50:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yz4Yt-0002vn-Qt for submit@debbugs.gnu.org; Sun, 31 May 2015 10:50:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz4Yt-0002vd-OU for submit@debbugs.gnu.org; Sun, 31 May 2015 10:50:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz4Ys-0003Pi-Ji for bug-gnu-emacs@gnu.org; Sun, 31 May 2015 10:50:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yz4Yp-0002pD-Dp for bug-gnu-emacs@gnu.org; Sun, 31 May 2015 10:50:02 -0400 Received: from b2bfep12.mx.upcmail.net ([62.179.121.57]:35188) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yz4Yp-0002os-3p for bug-gnu-emacs@gnu.org; Sun, 31 May 2015 10:49:59 -0400 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep16.mx.upcmail.net (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20150531144926.QMXA23037.b2bfep16-int.chello.at@edge11.upcmail.net> for ; Sun, 31 May 2015 16:49:26 +0200 Received: from iznogoud.viz ([91.119.211.5]) by edge11.upcmail.net with edge id aepZ1q00U07YXJr0Bepalv; Sun, 31 May 2015 16:49:34 +0200 X-SourceIP: 91.119.211.5 Received: from wolfgang by iznogoud.viz with local (Exim 4.85 (FreeBSD)) (envelope-from ) id 1Yz4YP-0000nO-FG for bug-gnu-emacs@gnu.org; Sun, 31 May 2015 16:49:33 +0200 From: Wolfgang Jenkner To: bug-gnu-emacs@gnu.org Subject: 25.0.50; [PATCH] (vertical-motion 0) broken at display strings after newline Date: Sun, 31 May 2015 16:19:46 +0200 X-Debbugs-CC: Eli Zaretskii Message-ID: <85y4k47qf6.fsf@iznogoud.viz> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) If you run the following snippet in emacs -Q point will end up at the first line of the "Test" buffer, but it should stay at the second line. (with-current-buffer (generate-new-buffer "Test") (pop-to-buffer (current-buffer)) (insert "x\n") (save-excursion (insert (propertize "x" 'display "x"))) (sit-for 1) (vertical-motion 0)) On the other hand, non-zero arguments for vertical-motion seem to work correctly, as long as the buffer contains only ASCII characters before the propertized "x". Otherwise (with-current-buffer (generate-new-buffer "Test") (pop-to-buffer (current-buffer)) (insert "\n=C3=A9\n") (save-excursion (insert (propertize "x" 'display "x"))) (sit-for 1) (vertical-motion -1)) Here, point should go to the second line but it goes to the first line. The following patch tries to fix both issues. -- >8 -- Subject: [PATCH] * src/indent.c (Fvertical_motion): Fix a case of motion by= 0 lines. Starting from a display string after a newline, point went to the previous line. Also, correct an inadvertent use of a buffer position with FETCH_BYTE. --- src/indent.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/indent.c b/src/indent.c index ce78308..b4e6d74 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2134,17 +2134,20 @@ whether or not it is currently displayed in some wi= ndow. */) overshoot_handled =3D 1; } else if (IT_CHARPOS (it) =3D=3D PT - 1 - && FETCH_BYTE (PT - 1) =3D=3D '\n' - && nlines < 0) + && FETCH_BYTE (PT_BYTE - 1) =3D=3D '\n' + && nlines <=3D 0) { /* The position we started from was covered by a display property, so we moved to position before the string, and - backed up one line, because the character at PT - 1 is a - newline. So we need one less line to go up. */ + backed up one line, because the character at PT - 1 is + a newline. So we need one less line to go up (or exactly + one line to go down if nlines =3D=3D 0). */ nlines++; /* But we still need to record that one line, in order to return the correct value to the caller. */ vpos_init =3D -1; + + overshoot_handled =3D 1; } if (lcols_given) to_x =3D window_column_x (w, window, extract_float (lcols), lcols); @@ -2159,7 +2162,7 @@ whether or not it is currently displayed in some wind= ow. */) } else if (overshoot_handled) { - it.vpos =3D 0; + it.vpos =3D vpos_init; move_it_by_lines (&it, min (PTRDIFF_MAX, nlines)); } else --=20 2.4.1 From debbugs-submit-bounces@debbugs.gnu.org Sun May 31 11:08:41 2015 Received: (at 20701) by debbugs.gnu.org; 31 May 2015 15:08:41 +0000 Received: from localhost ([127.0.0.1]:35033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yz4qu-0006w8-EQ for submit@debbugs.gnu.org; Sun, 31 May 2015 11:08:41 -0400 Received: from mtaout24.012.net.il ([80.179.55.180]:46359) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yz4qq-0006vs-VE for 20701@debbugs.gnu.org; Sun, 31 May 2015 11:08:38 -0400 Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NP700A00YNZCW00@mtaout24.012.net.il> for 20701@debbugs.gnu.org; Sun, 31 May 2015 18:00:05 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NP7003FKZ04DI80@mtaout24.012.net.il>; Sun, 31 May 2015 18:00:05 +0300 (IDT) Date: Sun, 31 May 2015 18:08:20 +0300 From: Eli Zaretskii Subject: Re: bug#20701: 25.0.50; [PATCH] (vertical-motion 0) broken at display strings after newline In-reply-to: <85y4k47qf6.fsf@iznogoud.viz> X-012-Sender: halo1@inter.net.il To: Wolfgang Jenkner Message-id: <83k2vou6mz.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 8BIT References: <85y4k47qf6.fsf@iznogoud.viz> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 20701 Cc: 20701@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > Cc: Eli Zaretskii > From: Wolfgang Jenkner > Date: Sun, 31 May 2015 16:19:46 +0200 > > If you run the following snippet in emacs -Q point will end up at the > first line of the "Test" buffer, but it should stay at the second line. > > (with-current-buffer (generate-new-buffer "Test") > (pop-to-buffer (current-buffer)) > (insert "x\n") > (save-excursion > (insert (propertize "x" 'display "x"))) > (sit-for 1) > (vertical-motion 0)) > > On the other hand, non-zero arguments for vertical-motion seem to work > correctly, as long as the buffer contains only ASCII characters before > the propertized "x". > > Otherwise > > (with-current-buffer (generate-new-buffer "Test") > (pop-to-buffer (current-buffer)) > (insert "\né\n") > (save-excursion > (insert (propertize "x" 'display "x"))) > (sit-for 1) > (vertical-motion -1)) > > Here, point should go to the second line but it goes to the first line. > > The following patch tries to fix both issues. > > -- >8 -- > Subject: [PATCH] * src/indent.c (Fvertical_motion): Fix a case of motion by 0 > lines. > > Starting from a display string after a newline, point went to the > previous line. > > Also, correct an inadvertent use of a buffer position with FETCH_BYTE. Looks good to me, please push. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 03 09:57:17 2015 Received: (at 20701-done) by debbugs.gnu.org; 3 Jun 2015 13:57:17 +0000 Received: from localhost ([127.0.0.1]:39105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z09AS-0001vv-IV for submit@debbugs.gnu.org; Wed, 03 Jun 2015 09:57:16 -0400 Received: from b2bfep12.mx.upcmail.net ([62.179.121.57]:51513) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z09AO-0001vp-VR for 20701-done@debbugs.gnu.org; Wed, 03 Jun 2015 09:57:13 -0400 Received: from edge12.upcmail.net ([192.168.13.82]) by b2bfep12.mx.upcmail.net (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20150603135706.YBVL604.b2bfep12-int.chello.at@edge12.upcmail.net> for <20701-done@debbugs.gnu.org>; Wed, 3 Jun 2015 15:57:06 +0200 Received: from iznogoud.viz ([91.119.208.239]) by edge12.upcmail.net with edge id bpx51q02i5ASvkT0Cpx6vG; Wed, 03 Jun 2015 15:57:06 +0200 X-SourceIP: 91.119.208.239 Received: from wolfgang by iznogoud.viz with local (Exim 4.85 (FreeBSD)) (envelope-from ) id 1Z09AH-0005cM-MP; Wed, 03 Jun 2015 15:57:05 +0200 From: Wolfgang Jenkner To: Eli Zaretskii Subject: Re: bug#20701: 25.0.50; [PATCH] (vertical-motion 0) broken at display strings after newline Date: Wed, 03 Jun 2015 15:56:12 +0200 References: <85y4k47qf6.fsf@iznogoud.viz> <83k2vou6mz.fsf@gnu.org> Message-ID: <85wpzk3nf2.fsf@iznogoud.viz> User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 20701-done Cc: 20701-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Version: 25.1 On Sun, May 31 2015, Eli Zaretskii wrote: >> Subject: [PATCH] * src/indent.c (Fvertical_motion): Fix a case of motion by 0 >> lines. >> >> Starting from a display string after a newline, point went to the >> previous line. >> >> Also, correct an inadvertent use of a buffer position with FETCH_BYTE. > > Looks good to me, please push. Thank you very much for reviewing the patch. Pushed to master. From unknown Mon Jun 23 13:14:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 02 Jul 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator