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: "Dr. Werner Fink" <werner <at> suse.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: martin rudalics <rudalics <at> gmx.at>, 25228 <at> debbugs.gnu.org
Subject: bug#25228: 25.1; GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored
Date: Tue, 20 Dec 2016 12:18:58 +0100
[Message part 1 (text/plain, inline)]
On Mon, Dec 19, 2016 at 10:43:37PM +0200, Eli Zaretskii wrote:
> > Date: Mon, 19 Dec 2016 21:20:49 +0100
> > From: martin rudalics <rudalics <at> gmx.at>
> > CC: werner <at> suse.de, 25228 <at> debbugs.gnu.org
> > 
> > IIUC all this ‘dynamic-setting-handle-config-changed-event’ mechanism is
> > about detecting changes applied to GConf and/or GSettings on the fly and
> > applying them to the running Emacs session.  Such configuration settings
> > should never override anything specified by the user in her .emacs.  The
> > mechanism was virtually inoperative for four years until Paul changed an
> > innocuous parameter descriptor.  So this mechanism has never been tested
> > in all those years ...
> 
> Can you describe how that mechanism is triggered by the offending
> change?

Just play around with eval-region/expression ... that is that I can switch with

  (font-setting-change-default-font ":0" t)

or

  (font-setting-change-default-font ":0" nil)

to the system default font settings and then with

  (custom-set-faces '(default ((t (:family "B&H LucidaTypewriter"
    :foundry "B&H" :slant normal :weight normal :height 110 :width normal)))))

IMHO it would be enough if the API below (custom-set-faces) would set
the default font used by (font-setting-change-default-font) ... or the
otherway around that (font-setting-change-default-font) would respect
the values specified by (custom-set-faces).

Debugging the code (font-setting-change-default-font) function shows with

   (setq frame-list (frames-on-display-list ":0"))
   (setq f (nth 0 frame-list))

to get the frame f that the face attribute is set correct

   (face-attribute 'default :font f 'default)

   #<font-object "-B&H-B&H LucidaTypewriter-normal-normal-normal-Sans-14-*-*-*-m-90-iso10646-1"> [2 times]

but using the outer call of font-get

   (font-get (face-attribute 'default :font f 'default) :user-spec)

results in

   "Monospace 11"

which is *not*  LucidaTypewriter. And as the call

   (frame-parameter f 'font-parameter)

returns nil the full call of the or switch

  (or (font-get (face-attribute 'default :font f 'default)
                               :user-spec)
                     (frame-parameter f 'font-parameter))

does return

   "Monospace 11"



Werner

-- 
  "Having a smoking section in a restaurant is like having
          a peeing section in a swimming pool." -- Edward Burr
[signature.asc (application/pgp-signature, inline)]

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.