help-gnu-emacs
[Top][All Lists]
Advanced

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

face-remap-add-relative and map-apply in mode hook


From: Oscar Brink
Subject: face-remap-add-relative and map-apply in mode hook
Date: Sat, 21 Nov 2020 15:33:05 +0000

I want to add a hook to a major mode to change how some faces look in the mode.

I do not understand why the following does not work

(1)
;; This does NOT work
(lambda ()
  (map-apply (lambda (face specs) (face-remap-add-relative face specs))
          '(('font-lock-comment-delimiter-face . (:foreground "#6EDA8D"))
            ('font-lock-comment-face . (:foreground "#6EDA8D")))))

AFAICT using the debugger, (1) does run face-remap-add-relative but nothing 
happens visually.

(2)
;; This does work
(lambda ()
  (progn
    (face-remap-add-relative 'font-lock-comment-delimiter-face :foreground 
"#6EDA8D")
    (face-remap-add-relative 'font-lock-comment-face :foreground "#6EDA8D"))

(2) works. It seems to me to be roughly equivalent to (1).

Regards,
Oscar



reply via email to

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