From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Note on e65c307 breaks font-height Date: Sat, 28 May 2016 03:38:31 -0700 Organization: UCLA Computer Science Department Message-ID: <57497527.8050600@cs.ucla.edu> References: <5746D38F.4010203@gmx.at> <4cdc1b55-2fe2-2457-1115-33ff68a9a65d@cs.ucla.edu> <5748490A.6020906@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------000602090302020801020408" X-Trace: ger.gmane.org 1464431971 7810 80.91.229.3 (28 May 2016 10:39:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 28 May 2016 10:39:31 +0000 (UTC) To: martin rudalics , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 28 12:39:22 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b6beL-0005QX-CQ for ged-emacs-devel@m.gmane.org; Sat, 28 May 2016 12:39:21 +0200 Original-Received: from localhost ([::1]:52910 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6beH-0001T9-FT for ged-emacs-devel@m.gmane.org; Sat, 28 May 2016 06:39:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6bdk-0001Sr-97 for emacs-devel@gnu.org; Sat, 28 May 2016 06:38:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b6bdg-0004Oz-0w for emacs-devel@gnu.org; Sat, 28 May 2016 06:38:43 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:58513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b6bdf-0004Ov-Oi for emacs-devel@gnu.org; Sat, 28 May 2016 06:38:39 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 760BC1613E4; Sat, 28 May 2016 03:38:38 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id LnkUxT-tQGga; Sat, 28 May 2016 03:38:36 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 4F8CB1613E7; Sat, 28 May 2016 03:38:36 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 1Cjbm9LhfzNZ; Sat, 28 May 2016 03:38:35 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id C630F1613E4; Sat, 28 May 2016 03:38:35 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 In-Reply-To: <5748490A.6020906@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:204107 Archived-At: This is a multi-part message in MIME format. --------------000602090302020801020408 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable martin rudalics wrote: > > What exactly is in your .emacs file? That is, can you give a recipe = to > reproduce the problem? > > It's reproducible here with my > > (custom-set-faces > ;; custom-set-faces was added by Custom. > ;; If you edit it by hand, you could mess it up, so be careful. > ;; Your init file should contain only one such instance. > ;; If there is more than one, they won't work right. > '(default ((t (:stipple nil :background "grey92" :foreground "black" > :inverse-video nil :box nil :strike-through nil :overline nil :underlin= e nil > :slant normal :weight normal :height 98 :width normal :foundry "outline= " :family > "Courier New"))))) I'm afraid that's not enough of a recipe for me to reproduce the problem.= On=20 Ubuntu 16.04 x86-64 if I change my ~/.emacs file so that it contains just= the=20 abovementioned code, and then run the shell command 'src/emacs -q --eval=20 "(set-face-attribute 'default nil :height 80)"', I get a *scratch* buffer= where=20 evaluating (setq F (face-attribute 'default :font (car (car (cdr=20 (current-frame-configuration)))) 'default)) yields a font object F that p= rints=20 as #, and (font-get F=20 :user-spec) indeed yields "Ubuntu Mono 13" in emacs-25 whereas it yields = nil in=20 Emacs 24.5. OK, but what is the regression here? The display has the same= (ugly)=20 appearance in Emacs 24.5 that it does in emacs-25. And in both Emacs 24.5= and=20 emacs-25 if I reapply .emacs the display changes to the same (nicer) appe= arance. The emacs-25 value of (font-get F :user-spec) is what was intended by com= mit=20 42707278 as part of a fix for Bug#5157, by the way. > My analysis so far is as follows: In =E2=80=98font-setting-change-defau= lt-font=E2=80=99 > the disjunct (frame-parameter f 'font-parameter) always evaluates to > nil here. Before your patch, the disjunct > > (or (font-get (face-attribute 'default :font f 'default) > :user-spec) > > always evaluated to nil. After your patch it returns "Monospace 11" an= d > =E2=80=98frame-font=E2=80=99 gets set to that and the frame's default f= ont too. IIUC > the height of the default face gets set to that value too but a new > frame gets the value from my .emacs. As a consequence, customizing the > default face will present me different height values corresponding to > the frame where I start the customization from. That is awfully weird. I'm afraid I can't reproduce a problem from this informal description. Pe= rhaps=20 if you could say exactly which code to run.... That being said, does the= =20 attached experimental patch address the issue for you? Again, I'm not ser= iously=20 proposing installing this, just trying to understand the problem. --------------000602090302020801020408 Content-Type: text/x-diff; name="0001-Fix-face-attribute-default-settings.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Fix-face-attribute-default-settings.patch" =46rom 6e3fee06d9bbac50f843efb333d1e919b78299b1 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 28 May 2016 03:37:00 -0700 Subject: [PATCH] Fix face attribute default settings Problem reported by Martin Rudalics in: http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00557.html * lisp/dynamic-setting.el (font-setting-change-default-font): Don't confuse default face font user spec with frame font. --- lisp/dynamic-setting.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/dynamic-setting.el b/lisp/dynamic-setting.el index 6021a3b..854d3ad 100644 --- a/lisp/dynamic-setting.el +++ b/lisp/dynamic-setting.el @@ -53,17 +53,17 @@ font-setting-change-default-font (set-frame-font new-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)))) + (let ((user-spec (font-get (face-attribute 'default :font f 'default)= + :user-spec)) + (frame-font (frame-parameter f 'font-parameter))) (when frame-font - (set-frame-parameter f 'font-parameter frame-font) + (set-frame-parameter f 'font-parameter frame-font)) + (when default-face-font-user-spec (set-face-attribute 'default f :width 'normal :weight 'normal :slant 'normal - :font frame-font)))))))) + :font user-spec)))))))) =20 (defun dynamic-setting-handle-config-changed-event (event) "Handle config-changed-event on the display in EVENT. --=20 2.7.4 --------------000602090302020801020408--