org-replace-escapes: Fix compiler warning

* lisp/org-macs.el (org-replace-escapes): Do not modify constant
string.
This commit is contained in:
Ihor Radchenko 2023-06-25 14:05:36 +03:00
parent 421b443483
commit 39786a8dbf
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 3 deletions

View File

@ -1287,9 +1287,8 @@ so values can contain further %-escapes if they are define later in TABLE."
(dolist (e tbl)
(setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
(when (and (cdr e) (string-match re (cdr e)))
(let ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
(safe "SREF"))
(add-text-properties 0 3 (list 'sref sref) safe)
(let* ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
(safe (propertize "SREF" 'sref sref)))
(setcdr e (replace-match safe t t (cdr e)))))
(while (string-match re string)
(setq rpl (format (concat (substring (match-string 0 string) 0 -1) "s")