GNU bug report logs -
#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
Previous Next
Reported by: Dmitry <dgutov <at> yandex.ru>
Date: Sun, 17 Aug 2014 22:36:02 UTC
Severity: normal
Found in version 24.3.92
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 18285 <at> debbugs.gnu.org (full text, mbox):
On 08/21/2014 06:57 PM, Eli Zaretskii wrote:
>> Hmm. Maybe the fix could be to make the `invisible' property disable
>> `display': as long as former is present, the latter won't work.
>
> That would undoubtedly cause complaints from heavy users of those,
> like Org, magit, etc.
Some change in code might be required, but the resulting code can be
made backward-compatible, aside from the pathological examples, which
might improve.
>> 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.
>
> Yes, but not the other way around.
If the `invisible' starts even one character earlier, it *is* the other
way around. So one might say that in general case it already disables
`display'. Try this small modification of the original example:
(let ((pt (point)))
(insert (propertize "a" 'display "bbb"))
(let ((o (make-overlay (1- pt) (point))))
(overlay-put o 'invisible t)
(overlay-put o 'after-string "foo\nbar")))
The result looks like:
foo
bar
>> 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.
>
> I'm quite sure there's some use case somewhere that will break.
Maybe. But at least it's consistent with the overlay priority rules.
This bug report was last modified 3 years and 37 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.