all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18285@debbugs.gnu.org
Subject: bug#18285: 24.3.92; A combination of `display' on text and `invisible' and	`before/after-string' leads to the before/after string being	displayed twice
Date: Thu, 21 Aug 2014 18:07:07 +0400	[thread overview]
Message-ID: <53F5FD0B.1070800@yandex.ru> (raw)
In-Reply-To: <83k365defw.fsf@gnu.org>

On 08/18/2014 07:07 PM, Eli Zaretskii wrote:

> Believe it or not, but this is how the code was written 14 years ago,
> although perhaps this particular consequence wasn't intended.  But it
> follows logically from how the display engine works.

I can believe it all right. I guess the question is, could there be a 
modification of the current logic that would preserve most of the 
current behavior, except for the weird situations like this one.

If not, that's all right by me. The workaround of replacing 
`before-string' + `invisible' with just `display' seems to function just 
fine so far. For some reason, Nikolaj opted to render the completion 
tooltip in Company with the former option, so I tried not to change it 
too much. Maybe that worked around some bugs in older Emacs, which we 
don't support anymore.

> The fundamental issue here is that the 'invisible' property makes all
> the character positions between the start and the end of the overlay
> indistinguishable.  Therefore, the display engine considers the
> 'before-string' and 'after-string' of an overlay that spans invisible
> text to be applicable to both the start and the end of the overlay,
> something it wouldn't do if the 'invisible' property were not present.

Hmm. Maybe the fix could be to make the `invisible' property disable 
`display': as long as former is present, the latter won't work.

After all, that was the intention behind the code I encountered this bug 
in. And with the current logic, like you say, if `display' is set, 
`invisible' is redundant.

> I think it's not worth to try to fix this (by complicating the heck
> out of the display engine) on the account of this use case.

Maybe so, but see above.

> My crystal ball says ...
> ... IOW, without the 'invisible' property getting in the way,
> the 'before-string' is displayed before the display property, and
> the 'after-string' is displayed after it.

Yes, sure. I just meant that the bug is the same with `invisible' on.

> Btw, there was a discussion of a similar issue starting at
>
>    http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00674.html
>
> It was inconclusive.

Thanks. That looks very much like a bug as well, though maybe again, too 
expensive to fix. FWIW, for that issue, if myov2 has higher priority 
than myov1 (if only by virtue of being inside and shorter), I'd display 
just "STRING2" ("STRING1" would not be visible at all). But that's just 
going by logic; maybe there's a use case that would break.





  reply	other threads:[~2014-08-21 14:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-17 22:35 bug#18285: 24.3.92; A combination of `display' on text and `invisible' and `before/after-string' leads to the before/after string being displayed twice Dmitry
     [not found] ` <handler.18285.B.140831493931056.ack@debbugs.gnu.org>
2014-08-18  1:06   ` bug#18285: Acknowledgement (24.3.92; A combination of `display' on text and `invisible' and `before/after-string' leads to the before/after string being displayed twice) Dmitry Gutov
2014-08-18 15:07 ` bug#18285: 24.3.92; A combination of `display' on text and `invisible' and `before/after-string' leads to the before/after string being displayed twice Eli Zaretskii
2014-08-21 14:07   ` Dmitry Gutov [this message]
2014-08-21 14:57     ` Eli Zaretskii
2014-08-21 15:40       ` Dmitry Gutov
2014-08-21 16:06         ` Eli Zaretskii
2014-08-22  0:58           ` Dmitry Gutov
2014-08-22  6:41             ` Eli Zaretskii
2014-08-22 11:41               ` Dmitry Gutov
2014-08-22 13:31                 ` Eli Zaretskii
2014-08-22 20:01                   ` Dmitry Gutov
2014-08-22 20:55                     ` Eli Zaretskii
2014-08-24  1:28                       ` Dmitry Gutov
2014-08-24  2:44                         ` Eli Zaretskii
2014-08-23 23:21     ` Dmitry Gutov
2014-08-24  2:40       ` Eli Zaretskii
2014-08-24  2:48         ` Dmitry Gutov
2022-04-18 11:39   ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=53F5FD0B.1070800@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=18285@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.