]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't suggest setting face-remapping-alist to a literal (Bug#39812)
authorNoam Postavsky <npostavs@gmail.com>
Sun, 29 Mar 2020 01:20:02 +0000 (21:20 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Sun, 29 Mar 2020 01:22:49 +0000 (21:22 -0400)
* src/xfaces.c (syms_of_xfaces) <face-remapping-alist>: Use copy-tree
in the costring example code, and note why.

src/xfaces.c

index 91a7a8533e872d7929036984759eed3a1c436c08..6ff252b02336d05be9378382e295013835d8ca50 100644 (file)
@@ -6953,10 +6953,13 @@ could define a face `my-mode-default', and then in the mode setup
 function, do:
 
    (set (make-local-variable \\='face-remapping-alist)
-       \\='((default my-mode-default)))).
+        (copy-tree \\='((default my-mode-default)))).
 
 You probably want to use the face-remap package included in Emacs
-instead of manipulating face-remapping-alist directly.
+instead of manipulating face-remapping-alist directly.  Note that many
+of the functions inthat package modify the list destructively, so make
+sure to set it to a fresh value (for instance, use `copy-tree' as in
+the example above).
 
 Because Emacs normally only redraws screen areas when the underlying
 buffer contents change, you may need to call `redraw-display' after