From: Eli Zaretskii Date: Thu, 17 Aug 2023 07:51:36 +0000 (+0300) Subject: Fix cloning 'face-remapping-alist' for indirect buffers X-Git-Tag: emacs-29.1.90~195 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d9af79ae39d3216273faa923d91f586b0a16cc04;p=emacs.git 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 . --- 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)