From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Bug in vertical-motion vs overlay with display property Date: Sat, 13 Apr 2013 12:03:12 +0300 Message-ID: <83haja950v.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1365843886 10306 80.91.229.3 (13 Apr 2013 09:04:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 13 Apr 2013 09:04:46 +0000 (UTC) Cc: alp.tekin.aker@gmail.com, emacs-devel@gnu.org To: Karl Chen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 13 11:04:50 2013 Return-path: Envelope-to: ged-emacs-devel@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 1UQwO5-0002CH-P5 for ged-emacs-devel@m.gmane.org; Sat, 13 Apr 2013 11:04:45 +0200 Original-Received: from localhost ([::1]:36097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQwO5-0007Q9-8n for ged-emacs-devel@m.gmane.org; Sat, 13 Apr 2013 05:04:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQwMc-0005i8-Dk for emacs-devel@gnu.org; Sat, 13 Apr 2013 05:03:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UQwMZ-0001m8-3M for emacs-devel@gnu.org; Sat, 13 Apr 2013 05:03:14 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:46080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UQwMY-0001lg-Rp for emacs-devel@gnu.org; Sat, 13 Apr 2013 05:03:11 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0ML600500RPHFK00@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Sat, 13 Apr 2013 12:03:09 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0ML60043TRT8QJF0@a-mtaout20.012.net.il>; Sat, 13 Apr 2013 12:03:08 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:158879 Archived-At: > From: Karl Chen > CC: alp.tekin.aker@gmail.com, > Emacs Developement List > Date: Fri, 12 Apr 2013 19:34:24 -0400 > > Hi Eli/Emacs-devel, > > I believe I've discovered a small bug in `vertical-motion' in > indent.c. It affects movement past blank lines when there is an > overlay with a display/cursor property. Thanks. But such reports should go to bug-gnu-emacs@gnu.org. > When using `fci-mode' from fill-column-indicator.el, > `previous-line' sometimes goes past two blank lines instead of > one. > > Affected Emacs versions: > - Good: 24.2 > - BAD: 24.3 > - BAD: 24.3.50 as of 2013-04-08 > > 1. One can reproduce the problem using fill-column-indicator.el: > > $ wget https://raw.github.com/alpaker/Fill-Column-Indicator/master/fill-column-indicator.el > $ emacs -Q > > M-x load-file fill-column-indicator.el > M-x fci-mode > > > ;; BAD: this moves up 2 lines instead of 1 line > > > 2. I minimized the above down to the following self-contained test > case: > > $ cat > aa.el < (defun fci-redraw-region (start end _ignored) > (save-match-data > (save-excursion > (goto-char start) > (while > (search-forward "\n" end t) > (setq eol-str "X") > (setq o (make-overlay (match-beginning 0) (match-beginning 0))) > (overlay-put o 'after-string > (propertize eol-str 'display (propertize eol-str 'cursor t))) > )))) > (add-hook 'after-change-functions 'fci-redraw-region) > (insert "\n\n\n\n") > (vertical-motion -1) > (vertical-motion -1) > (kill-emacs (+ 100 (line-number-at-pos))) > EOF > > $ emacs-24.2 -nw -Q --load aa.el ; echo $? > 103 # good > > $ emacs-24.3 -nw -Q --load aa.el ; echo $? > 102 # BAD Thanks for the test case. This is fixed in trunk revision 112274. The fixed code works correctly both with fill-column-indicator and with the simplified recipe above. > 3. Using the above I bisected the changes between 24.2 and 24.3 > down to the following commit: > > commit b65a46be5055c338a9f8e7640ad97b8e592d5977 > Refs: HEAD, refs/bisect/bad > Author: Eli Zaretskii > AuthorDate: 2012-11-21 21:28:14 +0200 > Commit: Eli Zaretskii > CommitDate: 2012-11-21 21:28:14 +0200 Thanks, but in the future please try to identify the bzr revision number or revision id of the offending commit. For the record: revision-id: eliz@gnu.org-20121121192814-1p9f510g94zc10e1 revision number on the trunk: 110764.1.170 > Thoughts? It's a bug. The code I committed back then to fix another bug considered a display string to be always set on buffer text. But in this case, the display string was set on an after-string, a possibility that the code I wrote back then didn't take into consideration.