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#19307: 24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it Date: Mon, 02 Feb 2015 18:29:23 +0200 Message-ID: <83k300gtuk.fsf@gnu.org> References: <86d27uw3zj.fsf@yandex.ru> <54CEF33F.3030704@yandex.ru> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1422894626 28569 80.91.229.3 (2 Feb 2015 16:30:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 2 Feb 2015 16:30:26 +0000 (UTC) Cc: 19307@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 02 17:30:21 2015 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 1YIJtE-0008Is-DI for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Feb 2015 17:30:20 +0100 Original-Received: from localhost ([::1]:55362 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIJtC-00074a-Pn for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Feb 2015 11:30:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIJt4-00072s-3E for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2015 11:30:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YIJsy-000108-Ed for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2015 11:30:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41095) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YIJsy-0000zi-BJ for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2015 11:30:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YIJsx-0002JA-Q7 for bug-gnu-emacs@gnu.org; Mon, 02 Feb 2015 11:30:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Feb 2015 16:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19307 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19307-submit@debbugs.gnu.org id=B19307.14228945878820 (code B ref 19307); Mon, 02 Feb 2015 16:30:03 +0000 Original-Received: (at 19307) by debbugs.gnu.org; 2 Feb 2015 16:29:47 +0000 Original-Received: from localhost ([127.0.0.1]:60568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YIJsg-0002IB-Jx for submit@debbugs.gnu.org; Mon, 02 Feb 2015 11:29:46 -0500 Original-Received: from mtaout28.012.net.il ([80.179.55.184]:41465) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YIJsd-0002Hw-Ck for 19307@debbugs.gnu.org; Mon, 02 Feb 2015 11:29:44 -0500 Original-Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il (HyperSendmail v2007.08) id <0NJ500L00KDLNY00@mtaout28.012.net.il> for 19307@debbugs.gnu.org; Mon, 02 Feb 2015 18:27:49 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NJ500B1GKEDJV90@mtaout28.012.net.il>; Mon, 02 Feb 2015 18:27:49 +0200 (IST) In-reply-to: <54CEF33F.3030704@yandex.ru> 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:98984 Archived-At: > Date: Mon, 02 Feb 2015 05:47:11 +0200 > From: Dmitry Gutov > > Eli, > > Could you look into this? Sorry, I somehow missed your original report. > In the example below, the `after-string' value is propertized with a > face. > > But as long as there is ellipsis at its beginning, the after-string is > rendered using the default face. > > (defun test () > (interactive) > (ignore-errors > (kill-buffer "test")) > (pop-to-buffer "test") > (add-to-invisibility-spec '(... . t)) > (insert (propertize "foo" 'invisible '...)) > (let ((ov (make-overlay (point) (point)))) > (overlay-put ov 'invisible t) > (overlay-put ov 'window (selected-window)) > (overlay-put ov 'after-string > (propertize "xxx" 'face 'highlight)))) This bug was introduced in Emacs 23, 10 years(!) ago. Now fixed in commit 27e11c0 on the emacs-24 branch. > And here's a somewhat related scenario, with a surprising result: > > (defun testt () > (interactive) > (ignore-errors > (kill-buffer "testt")) > (pop-to-buffer "testt") > (add-to-invisibility-spec '(... . t)) > (insert " ") > (let ((ov (make-overlay (1- (point)) (point)))) > (overlay-put ov 'invisible t) > (overlay-put ov 'window (selected-window)) > (overlay-put ov 'after-string > (propertize "xxx" 'face 'highlight))) > (insert (propertize "foo" 'invisible '...))) This is unrelated, AFAICT, and is not a bug: what you have here is 2 chunks of invisible text, one after another. The display engine skips all of that, and never examines any additional properties or overlays in the middle of the invisible text. Emacs always worked like that. > If I modify the scenario to make the overlay empty (and maybe omit > inserting the space at the beginning, though this makes no difference), > then "xxx" is displayed and even highlighted as expected. Each one of the measures you describe either removes one of the invisible chunks of text or makes it visible. That's why the overlay string becomes displayed then. (As for it being highlighted, the above bug affected the highlight only when the overlay string _follows_ the ellipsis; if it comes before the ellipsis, the bug won't rear its ugly head.) Is there some important real-life use case that bumped into this surprise? If so, please describe it. Thanks.