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: Ihor Radchenko
Subject: bug#48740: 28.0.50; Composition text property is not always honoured
Date: Thu, 24 Jun 2021 22:35:45 +0800

Eli Zaretskii <eliz@gnu.org> writes:

> What I don't understand is why the property is broken into two
> intervals.  You have only one word, ONGOING, so why is the property
> divided into 2?

As I understand, the composition in the two intervals remains the same.
However, some other text properties differ, so the composition property
is "spread" across the two intervals.

>> 2. The following code in org-agenda-highlight-todo unexpectedly breaks
>>    the composition into two intervals with composition values becoming
>>    not eq:
>
> Why is this code needed?  And why not put the property on the word
> after concatenating, to avoid the issue?

The code formats todo keyword in agenda line according to
org-agenda-todo-keyword-format. The function does not know if the passed
string has composition property or not.

In any case, changing concat to format fixed the observed problem.

> It looks like some other use cases want to keep the compositions
> separate when a string is generated by 'concat'.
>
> I don't want to make low-level changes in how static compositions are
> treated, so I'd prefer that this problem be fixed on the application
> level.

I understand. However, the problem is quite unexpected. I do not see how
application can anticipate it. Probably, adding a note to docstring
would be useful? Something like in the attached patch.

Best,
Ihor

>From 4cf994cdb3cf9ca07ddfa53bc85d7daa07e7c9cc Mon Sep 17 00:00:00 2001
Message-Id: 
<4cf994cdb3cf9ca07ddfa53bc85d7daa07e7c9cc.1624545283.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Thu, 24 Jun 2021 22:33:08 +0800
Subject: [PATCH] src/fns.c (Fconcat): Update docstring

* src/fns.c (Fconcat): Note that composition values may not remain eq
in return value of concat.  See bug#48740.
---
 src/fns.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/fns.c b/src/fns.c
index a178216622..73669287c9 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -672,6 +672,9 @@ DEFUN ("concat", Fconcat, Sconcat, 0, MANY, 0,
        doc: /* Concatenate all the arguments and make the result a string.
 The result is a string whose elements are the elements of all the arguments.
 Each argument may be a string or a list or vector of characters (integers).
+
+Values of `composition' property of the result are not guaranteed to
+be `eq'.
 usage: (concat &rest SEQUENCES)  */)
   (ptrdiff_t nargs, Lisp_Object *args)
 {
-- 
2.31.1


reply via email to

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