From ee47e00f4e0a644a0948743ac43892710663b243 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 28 Mar 2020 21:20:02 -0400 Subject: [PATCH] Don't suggest setting face-remapping-alist to a literal (Bug#39812) * src/xfaces.c (syms_of_xfaces) : 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 91a7a8533e8..6ff252b0233 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 -- 2.39.5