GNU bug report logs - #25228
25.1; GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored

Previous Next

Package: emacs;

Reported by: werner <at> suse.de (Dr. Werner Fink)

Date: Mon, 19 Dec 2016 11:57:01 UTC

Severity: normal

Tags: patch

Merged with 24482, 26340, 40419, 40461

Found in versions 25.1, 26.0.50, 26.3

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Dr. Werner Fink" <werner <at> suse.de>
Cc: 25228 <at> debbugs.gnu.org
Subject: bug#25228: [emacs-bug] bug#25228: 25.1; GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored
Date: Tue, 20 Dec 2016 19:58:18 +0200
> Date: Tue, 20 Dec 2016 17:56:48 +0100
> From: "Dr. Werner Fink" <werner <at> suse.de>
> Cc: Eli Zaretskii <eliz <at> gnu.org>, 25228 <at> debbugs.gnu.org
> 
> > The only guess I have is that the correction had now enabled the :user-spec
> > key/attribute.  For a workaround I've change some lines of code in
> > lisp/dynamic-setting.el ... compare with the attached patch.
> > 
> > With this patch both the custom font if enabled in ~/.emacs as well as
> > the system font works here for GNU Emacs with GTK as well as with X11.
> 
> Wrong version of the patch, this one seems to be better one ;)

Thanks.  However, this doesn't look like the right fix, because this:

> +  (let ((system-font (and (fboundp 'font-get-system-font)
> +                       (font-get-system-font)))
> +        (frame-list (frames-on-display-list display-or-frame))
> +	(user-font (face-attribute 'default :font)))
> +    (when (and system-font (display-graphic-p display-or-frame))
>        (clear-font-cache)
>        (if set-font
>  	  ;; Set the font on all current and future frames, as though
>  	  ;; the `default' face had been "set for this session":
> -	  (set-frame-font new-font nil frame-list)
> +	  (if (not user-font)
> +	      (set-frame-font system-font nil frame-list)
> +	     (set-frame-font user-font nil frame-list))

effectively disables the system-font feature, because

   (face-attribute 'default :font)

will always return non-nil.

So if my suggestion of rounding the DPI values before comparing them
fixes this for you, it sounds like a better solution to me.




This bug report was last modified 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.