From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Bugfix Date: Thu, 28 Feb 2008 22:24:48 -0500 Message-ID: <87zltkmolb.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1204255603 11650 80.91.229.12 (29 Feb 2008 03:26:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Feb 2008 03:26:43 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 29 04:27:08 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JUvtr-0007yR-TL for ged-emacs-devel@m.gmane.org; Fri, 29 Feb 2008 04:27:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUvtL-0005oh-JA for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 22:26:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUvtH-0005oE-3Q for emacs-devel@gnu.org; Thu, 28 Feb 2008 22:26:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUvtF-0005nu-L7 for emacs-devel@gnu.org; Thu, 28 Feb 2008 22:26:30 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUvtF-0005nq-I8 for emacs-devel@gnu.org; Thu, 28 Feb 2008 22:26:29 -0500 Original-Received: from cyd.mit.edu ([18.115.2.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JUvtF-0002Yc-9e for emacs-devel@gnu.org; Thu, 28 Feb 2008 22:26:29 -0500 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 511334E3F9; Thu, 28 Feb 2008 22:24:48 -0500 (EST) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90819 Archived-At: Joe Wells wrote: > BUG #1: An overlay's after-string property that would appear at the > end of the buffer is not displayed, if the same overlay also has a > display property and an immediately preceding overlay also has an > after-string property. (Putting extra characters at the end of the > buffer works around this bug.) To reproduce: (progn (if (get-buffer "*test*") (kill-buffer "*test*")) (pop-to-buffer "*test*") (erase-buffer) (insert "ABCD") (let ((o1 (make-overlay 2 3)) (o2 (make-overlay 3 4)) (s " ")) (overlay-put o1 'after-string "1") (overlay-put o1 'display s) (overlay-put o2 'display s))) I believe is a pretty safe and straightforward fix, but since it's in the redisplay engine, it'd be good if someone double-checks before I check it into the branch. (It's already in the trunk.) The bug is due to an optimization in next_overlay_string that tells the iterator to stop scanning if we're at the end of the buffer and there are no more overlay strings to process. This fails when there's a display string, because it->end_charpos gives the length of the string instead of the length of the buffer. In this case, we simply shouldn't set overlay_strings_at_end_processed_p. *** emacs/src/xdisp.c.~1.1149.2.23.~ 2008-02-28 20:59:38.000000000 -0500 --- emacs/src/xdisp.c 2008-02-28 22:02:16.000000000 -0500 *************** *** 4677,4683 **** /* If we're at the end of the buffer, record that we have processed the overlay strings there already, so that next_element_from_buffer doesn't try it again. */ ! if (IT_CHARPOS (*it) >= it->end_charpos) it->overlay_strings_at_end_processed_p = 1; /* If we have to display `...' for invisible text, set --- 4677,4683 ---- /* If we're at the end of the buffer, record that we have processed the overlay strings there already, so that next_element_from_buffer doesn't try it again. */ ! if (NILP (it->string) && IT_CHARPOS (*it) >= it->end_charpos) it->overlay_strings_at_end_processed_p = 1; /* If we have to display `...' for invisible text, set