From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Dr. Werner Fink" Newsgroups: gmane.emacs.bugs Subject: bug#25228: 25.1; GNU emacs 25.1: custom-set-faces from init file ~/.emacs ignored Date: Tue, 20 Dec 2016 17:41:39 +0100 Message-ID: <20161220164139.mx5zfjp3tuueeqnh@boole.suse.de> References: <83oa074y73.fsf@gnu.org> <5858289B.2070500@gmx.at> <83fulj4uhu.fsf@gnu.org> <58584121.1070404@gmx.at> <83d1gn4pl2.fsf@gnu.org> <20161220111858.gp723ihyr2ylqr7a@boole.suse.de> <83tw9y37b6.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s7k7mvtkdjzezh2i" X-Trace: blaine.gmane.org 1482252144 6337 195.159.176.226 (20 Dec 2016 16:42:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Dec 2016 16:42:24 +0000 (UTC) User-Agent: Mutt/1.6.2 (2016-07-01) Cc: 25228@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 20 17:42:19 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJNUV-0000Fr-Td for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2016 17:42:16 +0100 Original-Received: from localhost ([::1]:52184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJNUa-0001Zg-Ay for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2016 11:42:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJNUN-0001Xn-51 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2016 11:42:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJNUI-0004CC-D5 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2016 11:42:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33785) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cJNUI-0004C6-98 for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2016 11:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cJNUI-0005nS-4D for bug-gnu-emacs@gnu.org; Tue, 20 Dec 2016 11:42:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Dr. Werner Fink" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 20 Dec 2016 16:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 25228 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 25228-submit@debbugs.gnu.org id=B25228.148225210622254 (code B ref 25228); Tue, 20 Dec 2016 16:42:02 +0000 Original-Received: (at 25228) by debbugs.gnu.org; 20 Dec 2016 16:41:46 +0000 Original-Received: from localhost ([127.0.0.1]:49184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJNU1-0005ms-Na for submit@debbugs.gnu.org; Tue, 20 Dec 2016 11:41:45 -0500 Original-Received: from mx2.suse.de ([195.135.220.15]:35440) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJNTz-0005me-OE for 25228@debbugs.gnu.org; Tue, 20 Dec 2016 11:41:44 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Original-Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 20674AAC7; Tue, 20 Dec 2016 16:41:42 +0000 (UTC) Content-Disposition: inline In-Reply-To: <83tw9y37b6.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:127248 Archived-At: --s7k7mvtkdjzezh2i Content-Type: multipart/mixed; boundary="a5sj6aomlduini4x" Content-Disposition: inline --a5sj6aomlduini4x Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 20, 2016 at 06:15:57PM +0200, Eli Zaretskii wrote: > > Date: Tue, 20 Dec 2016 12:18:58 +0100 > > From: "Dr. Werner Fink" > > Cc: martin rudalics , 25228@debbugs.gnu.org > >=20 > > > Can you describe how that mechanism is triggered by the offending > > > change? > >=20 > > Just play around with eval-region/expression ... that is that I can swi= tch with > >=20 > > (font-setting-change-default-font ":0" t) > >=20 > > or > >=20 > > (font-setting-change-default-font ":0" nil) > >=20 > > to the system default font settings and then with > >=20 > > (custom-set-faces '(default ((t (:family "B&H LucidaTypewriter" > > :foundry "B&H" :slant normal :weight normal :height 110 :width norm= al))))) >=20 > Thanks. However, I don't have easy access to systems where this > problem happens, so I must examine the source code instead. That is > why I asked to describe which code triggers this and how it started > affecting us after commit e65c307. 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. Werner --=20 "Having a smoking section in a restaurant is like having a peeing section in a swimming pool." -- Edward Burr --a5sj6aomlduini4x Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: attachment; filename="emacs-25.1-custom-fonts.patch" Content-Transfer-Encoding: quoted-printable Work around openSUSE bug #1016172 =20 -- lisp/dynamic-setting.el | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) --- lisp/dynamic-setting.el +++ lisp/dynamic-setting.el 2016-12-20 16:17:30.100242946 +0000 @@ -33,6 +33,7 @@ ;;; Customizable variables =20 (declare-function font-get-system-font "xsettings.c" ()) +(declare-function font-face-attributes "font.c" (font &optional frame)) =20 (defvar font-use-system-font) =20 @@ -42,28 +43,29 @@ If DISPLAY-OR-FRAME is a frame, the disp =20 If SET-FONT is non-nil, change the font for frames. Otherwise re-apply the current form for the frame (i.e. hinting or somesuch changed)." - (let ((new-font (and (fboundp 'font-get-system-font) - (font-get-system-font))) - (frame-list (frames-on-display-list display-or-frame))) - (when (and new-font (display-graphic-p display-or-frame)) + (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)) ;; Just redraw the existing fonts on all frames: (dolist (f frame-list) - (let ((frame-font - (or (font-get (face-attribute 'default :font f 'default) - :user-spec) - (frame-parameter f 'font-parameter)))) + ;; (apply 'font-spec (font-face-attributes (font-get-system-font))) + (let* ((frame-font + (or (face-attribute 'default :font f 'default) + (frame-parameter f 'font-parameter))) + (font-attr (font-face-attributes frame-font))) (when frame-font (set-frame-parameter f 'font-parameter frame-font) - (set-face-attribute 'default f - :width 'normal - :weight 'normal - :slant 'normal - :font frame-font)))))))) + (apply #'set-face-attribute 'default f=20 + (set-face-attribute 'default font-attr))))))))) =20 (defun dynamic-setting-handle-config-changed-event (event) "Handle config-changed-event on the display in EVENT. --a5sj6aomlduini4x-- --s7k7mvtkdjzezh2i Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABAgAGBQJYWV9DAAoJEFDpDVUdwWsukkAP/RGcZT6NVk50DfEVFREg2/2G DclMkSkM5hkw6ABEqnnSCPrjtf4kYK21kQB2ZdZcvAwZsUYtxSi5HaWtgOt1krWD R/WELRoKREEqxfeoQDiVwdooj6s/8FiCb4YaYCAuXYhkly9f/hF2buXBVBSa5EMI dQLnBPtJ+5if2SzHf90DgRCfLWH1KeB4nOQpVtPxqCEXDxdftoIHSlRWsj3Kx2BC f3vssDI1a0fNITl7zuYWsuerUX6YC3lqby/jnhaVhQd01wA01Hfs/ZgLa700uYZl QRijRc1YX/hi2W29BJPguDTxhP8C5avoIVIUhB6TAHeZxvTuzH4DKYg8jpJXX58B R9FzUSpOpL7mXbwfUpsMNGt5tz5+y0yCcSBPlgGyQa+vI8bWD6vQtyZY7aqmajBv Bge5qCvNyoR9j2lvkoikGnzLOyd/KfHTWxP1mFnNTDkTo6miv6XeVYThnMEoXj8p htYV++jQ2p+DgN+4deiKlD3fpVJm97O/fSEwRrpdGczWCfzRJCYjYQ7agVmeorXz bJL7s3B32YfCrRz5RL1cgNJZilfDE9CygYw6TyqYNJFleuGbXpYirvH+Y6Dp8JNa jrrx789mHNKXN+i+yY5+vR0IMZvTNLGxif8Qd3J6ZHLJLfj1JwPLva+kmZP/kQ1V ZfoUY+EZjy9xFk5LGDlQ =rE28 -----END PGP SIGNATURE----- --s7k7mvtkdjzezh2i--