* lisp/org-agenda.el: Do not modify string constant " "

(org-agenda-highlight-todo): Use `propertize' that copies the argument
string instead of `org-add-props'.  Otherwise, if the compiler
optimizes string constants into a single object, the properties may
populate in unexpected places.

Reported-by: Gustavo Barros <gusbrs.2016@gmail.com>
Link: https://orgmode.org/list/CAM9ALR95F_ZHV2_WsqAz0-35-S2rwxbHqsA5VGftvq51Yz3ZAQ@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2023-04-16 13:18:42 +02:00
parent f1fd1f22f4
commit a8a95b6c2c
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 1 additions and 2 deletions

View File

@ -7724,8 +7724,7 @@ The optional argument TYPE tells the agenda type."
(unless (string= org-agenda-todo-keyword-format "")
;; Remove `display' property as the icon could leak
;; on the white space.
(org-add-props " " (org-plist-delete (text-properties-at 0 x)
'display)))
(apply #'propertize " " (org-plist-delete (text-properties-at 0 x) 'display)))
(substring x (match-end 3)))))))
x)))