emacs-devel
[Top][All Lists]
Advanced

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

Re: [ELPA] Add fontaine package?


From: Eli Zaretskii
Subject: Re: [ELPA] Add fontaine package?
Date: Fri, 29 Apr 2022 10:15:33 +0300

> From: Protesilaos Stavrou <info@protesilaos.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 29 Apr 2022 10:02:16 +0300
> 
> >> >  . It uses internal-set-lisp-face-attribute, which is an internal
> >> >    primitive, something I'd suggest to avoid.  Why can't it use
> >> >    set-lisp-face-attribute instead?
> >> 
> >> I do not have 'set-lisp-face-attribute' on my end (Emacs 29, GNU/Linux).
> >
> > Sorry, I meant set-face-attribute, of course.
> 
> The reason I did not use it is due to what we discussed in bug#45920.
> Basically, set-face-attribute needs to be evaluated twice when (i) we
> change the :family, (ii) change the :weight, and (iii) the new family
> does not have the weight of the previous one.
> 
> The example I used in that bug report, which I can still reproduce with
> emacs -Q:
> 
>    ;; Sample 1
>    (set-face-attribute 'default nil
>                        :family "Source Code Pro"
>                        :weight 'light)
> 
>    ;; Sample 2
>    (set-face-attribute 'default nil
>                        :family "Hack"
>                        :weight 'normal)
> 
> Evaluate sample 1.  It works.  Now evaluate sample 2.  Notice that it
> does not yield the expected result.  Evaluate sample 2 again: the result
> is the desired one.
> 
> By using internal-set-lisp-face-attribute, I specify the sequence of
> events that always works.
> 
> Perhaps there is a better way to handle this edge case?

What exactly is the "edge case", and why do you need it in this
package?



reply via email to

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