unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 19307@debbugs.gnu.org
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	[thread overview]
Message-ID: <83k300gtuk.fsf@gnu.org> (raw)
In-Reply-To: <54CEF33F.3030704@yandex.ru>

> Date: Mon, 02 Feb 2015 05:47:11 +0200
> From: Dmitry Gutov <dgutov@yandex.ru>
> 
> 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.





  reply	other threads:[~2015-02-02 16:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 15:33 bug#19307: 24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it Dmitry Gutov
     [not found] ` <handler.19307.B.1418052841706.ack@debbugs.gnu.org>
2015-02-02  3:47   ` bug#19307: Acknowledgement (24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it) Dmitry Gutov
2015-02-02 16:29     ` Eli Zaretskii [this message]
2015-02-03  3:33       ` bug#19307: 24.4.51; Ellipsis created with `invisible' removes highlighting from overlay after-string after it Dmitry Gutov
2015-02-03 18:54         ` Eli Zaretskii
2015-02-03 20:30           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k300gtuk.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=19307@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).