bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48740: 28.0.50; Composition text property is not always honoured


From: Eli Zaretskii
Subject: bug#48740: 28.0.50; Composition text property is not always honoured
Date: Tue, 01 Jun 2021 18:25:17 +0300

> From: Ihor Radchenko <yantar92@gmail.com>
> CC: 48740@debbugs.gnu.org
> Date: Tue, 01 Jun 2021 22:28:50 +0800
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> >> The two intervals are there because other properties in the list are
> >> not same, as I understand.
> >
> > Exactly.  And that cannot work with the composition property.
> 
> Again, I feel that I miss something. Consider the following test case:
> 
> (switch-to-buffer "test")
> (insert "asdasd")
> (compose-region (point-min) (point-max) '(?a (bl . tl) ?| (bl . tl) ?b))
> (put-text-property 1 3 'test 1)
> (put-text-property 3 6 'test 2)
> (buffer-string)
> 
> The output is
> 
> #("asdasd" 0 2 (composition (43 6 [97 72 124 72 98]) test 1) 2 5 (composition 
> (43 6 [97 72 124 72 98]) test 2) 5 6 (composition (43 6 [97 72 124 72 98])))
> 
> Composition works fine here despite spanning over multiple intervals.
> Again, I feel that I miss something in your explanation.

We are mis-communicating.  You already stated correctly the reason for
the problem:

> The only possibility I can think about is that compositions in the two
> intervals are 'eq at step 6, but only 'equal at step 8. (How on Earth
> can one debug this???)

More accurately, it isn't the intervals that must be 'eq', it's the
values of the 'composition' property in the 2 adjacent intervals.  In
Step 6 (and in the example above) they are 'eq', in Step 8 they
aren't.  All the rest was my failed attempt to correct your inaccurate
description of what happens; forget about that if you want.

I don't know why the values of the 'composition' property become not
'eq'; perhaps some code does a copy-sequence or something?  Presumably
if you take a good look at what happens in org-agenda-redo-all and its
subroutines, you will find that code.  In general, when you are
dealing with static compositions, I'd suggest not to break the
composed region into several separate intervals with different
property lists: it's dangerous, as you see.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]