emacs-diffs
[Top][All Lists]
Advanced

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

emacs-27 ee47e00: Don't suggest setting face-remapping-alist to a litera


From: Noam Postavsky
Subject: emacs-27 ee47e00: Don't suggest setting face-remapping-alist to a literal (Bug#39812)
Date: Sat, 28 Mar 2020 21:31:56 -0400 (EDT)

branch: emacs-27
commit ee47e00f4e0a644a0948743ac43892710663b243
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Don't suggest setting face-remapping-alist to a literal (Bug#39812)
    
    * src/xfaces.c (syms_of_xfaces) <face-remapping-alist>: Use copy-tree
    in the costring example code, and note why.
---
 src/xfaces.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/xfaces.c b/src/xfaces.c
index 91a7a85..6ff252b 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -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



reply via email to

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