summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2023-08-17 10:51:36 +0300
committerEli Zaretskii <eliz@gnu.org>2023-08-17 10:51:36 +0300
commitd9af79ae39d3216273faa923d91f586b0a16cc04 (patch)
tree9a7a59f6bf24e72532ac2d4960b47a4686765b4a
parent636fb267c46f62c89bc34b7de1c78a25c0b20f37 (diff)
downloademacs-d9af79ae39d3216273faa923d91f586b0a16cc04.tar.gz
Fix cloning 'face-remapping-alist' for indirect buffers
* lisp/face-remap.el (face-remap--copy-face): Remove. (face-attrs--make-indirect-safe): Use 'copy-tree'. Suggested by Stefan Monnier <monnier@iro.umontreal.ca>.
-rw-r--r--lisp/face-remap.el13
1 files changed, 1 insertions, 12 deletions
diff --git a/lisp/face-remap.el b/lisp/face-remap.el
index 3ec271b67a4..c5f7af37406 100644
--- a/lisp/face-remap.el
+++ b/lisp/face-remap.el
@@ -70,21 +70,10 @@
:foreground :background :stipple :overline :strike-through :box
:font :inherit :fontset :distant-foreground :extend :vector])
-(defun face-remap--copy-face (val)
- "Return a copy of the `face' property value VAL."
- ;; A `face' property can be either a face name (a symbol), or a face
- ;; property list like (:foreground "red" :inherit default),
- ;; or a list of such things.
- ;; FIXME: This should probably be shared to some extent with
- ;; `add-face-text-property'.
- (if (or (not (listp val)) (keywordp (car val)))
- val
- (copy-sequence val)))
-
(defun face-attrs--make-indirect-safe ()
"Deep-copy the buffer's `face-remapping-alist' upon cloning the buffer."
(setq-local face-remapping-alist
- (mapcar #'face-remap--copy-face face-remapping-alist)))
+ (mapcar #'copy-tree face-remapping-alist)))
(add-hook 'clone-indirect-buffer-hook #'face-attrs--make-indirect-safe)