emacs-devel
[Top][All Lists]
Advanced

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

add-face-text-property destructively modified properties


From: Lars Ingebrigtsen
Subject: add-face-text-property destructively modified properties
Date: Wed, 09 Oct 2019 20:14:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Up until yesterday, using this function on copies of strings would
modify the original string:

(progn
  (setq str1 (propertize "foo" 'face '(underline highlight)))
  (setq str2 (concat str1))
  (add-face-text-property 0 3 'foobar t str2)
  (pp str1 (current-buffer)))
->

#("foo" 0 3
  (face
   (underline highlight foobar)))

This didn't seem right to me, so I modified it to not do that, but only
modify str2 when I told it to modify str2.

Eli wanted comments about whether anybody thinks this is a surprising
change.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




reply via email to

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