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

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

Re: face-remap-add-relative versus set-face-attribute


From: goncholden
Subject: Re: face-remap-add-relative versus set-face-attribute
Date: Sun, 13 Feb 2022 02:12:39 +0000

------- Original Message -------
On Sunday, February 13th, 2022 at 12:59 AM, Emanuel Berg via Users list for the 
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> goncholden via Users list for the GNU Emacs text editor wrote:
>
> > What is superior? Using (face-remap-add-relative 'default :weight 'bold)
> > or using (set-face-attribute 'font-lock-comment-face nil :weight normal) ?
>
> They don't do the same thing ...  But the second is good, except I don't
> think one needs to `quote' font-lock-comment-face.

face-remap-add-relative could be buffer local.  Would one prefer buffer local 
for customising
comments?

> It is however needed for font-lock-regexp-grouping-backslash
> and font-lock-regexp-grouping-construct - I don't know why
> this discrepancy is ...

> Don't forget about font-lock-comment-delimiter-face BTW ...

What is its use?

> And try this ...

> (defun set-all-faces (fg &optional bg weight)
> (let ((backg (or bg "black"))
> (wght (or weight 'normal))
> (faces) )
>
> (mapatoms (lambda (s)
> (when (facep s)
> (push (symbol-name s) faces) )))
> (dolist (f faces)
> (set-face-attribute (intern f) nil
> :foreground fg)
> :background backg
> :weight wght
> :italic nil) ))

> (set-all-faces "red")




reply via email to

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