From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kirill Ignatiev Newsgroups: gmane.emacs.bugs Subject: bug#19408: 25.0.50; Incorrect handling of face-font-rescale-alist on startup mangles font settings Date: Thu, 18 Dec 2014 15:26:19 -0500 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=047d7beb9124c09852050a8367a9 X-Trace: ger.gmane.org 1418934439 18167 80.91.229.3 (18 Dec 2014 20:27:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Dec 2014 20:27:19 +0000 (UTC) To: 19408@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 18 21:27:12 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Y1hfB-000364-GJ for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Dec 2014 21:27:09 +0100 Original-Received: from localhost ([::1]:55667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1hfA-0005tq-Re for geb-bug-gnu-emacs@m.gmane.org; Thu, 18 Dec 2014 15:27:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1hf6-0005sz-HP for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 15:27:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1hf5-0007Bx-1P for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 15:27:04 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41212) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1hf4-0007Bs-Ru for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 15:27:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Y1hf4-0001IS-M4 for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 15:27:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Kirill Ignatiev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Dec 2014 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19408 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14189343904934 (code B ref -1); Thu, 18 Dec 2014 20:27:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Dec 2014 20:26:30 +0000 Original-Received: from localhost ([127.0.0.1]:50578 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1heX-0001HU-Uk for submit@debbugs.gnu.org; Thu, 18 Dec 2014 15:26:30 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:55424) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Y1heV-0001HG-NP for submit@debbugs.gnu.org; Thu, 18 Dec 2014 15:26:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1heU-00076E-5k for submit@debbugs.gnu.org; Thu, 18 Dec 2014 15:26:27 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:49497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1heU-00076A-2w for submit@debbugs.gnu.org; Thu, 18 Dec 2014 15:26:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1heS-0005qv-Qi for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 15:26:26 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1heR-00075i-Ek for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 15:26:24 -0500 Original-Received: from mail-wg0-x22c.google.com ([2a00:1450:400c:c00::22c]:47780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1heR-00075d-58 for bug-gnu-emacs@gnu.org; Thu, 18 Dec 2014 15:26:23 -0500 Original-Received: by mail-wg0-f44.google.com with SMTP id b13so2669703wgh.3 for ; Thu, 18 Dec 2014 12:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=daKtHViI8CHIBaV+CvZfAARg+96hxdCmUw7KdQTmDso=; b=0GN1RRhTiWVdWi6SJ/83EU9OurL1xH10Pb5rO/IITN3IT8hMdDw3TtnXAUui11iy3a e/k4p611FpADBlBGaYXnMXP/3cOcKCuxFAm/btcsodikcWdH/EVq1/Nn0AVBcVPcAN9T W2+dK/S4R76OaW9zy1fvUat/dXHtQxkWj16NUkS09NyjneBxdndReE3re/9akDPJVC3X Lj6khK3gd4JYaUPBaGFnmyqtiqlnYs+rM5RMogIIZ115y2F2N57ELOUL+Z/VU3QwMu5W /v9TrJfjAzh0/pzutHJx+CK6+bO0eZv4xKUr22f20xysQxRocqXh7NubX12eQgm+sMoK Oz1g== X-Received: by 10.194.78.204 with SMTP id d12mr7835515wjx.37.1418934381213; Thu, 18 Dec 2014 12:26:21 -0800 (PST) Original-Received: by 10.27.87.87 with HTTP; Thu, 18 Dec 2014 12:26:19 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97549 Archived-At: --047d7beb9124c09852050a8367a9 Content-Type: text/plain; charset=UTF-8 Take the following .emacs file: (custom-set-faces '(default ((t (:inherit nil :height 110 :foundry "nil" :family "Source Code Pro"))))) (add-to-list 'face-font-rescale-alist (cons (font-spec :family "STIXGeneral") 0.95) t) Run emacs with no other customizations, using -Q -l . The font in the initial frame in the scratch buffer will be Source Code Pro, as expected. Open a new frame, the font in that frame will be some other font (in my case Helvetica), not the default one. During startup, if face-font-rescale-alist changes, emacs will mangle the default font setting, causing it to be wrong for all non-initial frames. I found the following workaround: ;; Workaround for emacs/lisp/startup.el:670 (defadvice frame-notice-user-settings (before my:rescale-alist) ;; (message "Set face-font-rescale-alist") (add-to-list 'face-font-rescale-alist (cons (font-spec :family "STIXGeneral") 0.95) t)) (ad-activate 'frame-notice-user-settings) for this particular bit of lisp/startup.el (line ~660) ;; FIXME: The user's init file may change ;; face-font-rescale-alist. However, the default face ;; already has an assigned font object, which does not take ;; face-font-rescale-alist into account. For such ;; situations, we ought to have a way to find all font ;; objects and regenerate them; currently we do not. As a ;; workaround, we specifically reset te default face's :font ;; attribute here. See bug#1785. (unless (eq face-font-rescale-alist old-face-font-rescale-alist) (set-face-attribute 'default nil :font (font-spec))) I am not sure how the default font should be regenerated in case it's affected by face-font-rescale-alist, but using (font-spec) is wrong because it resets user's own settings. I attached the output of report-emacs-bug. --047d7beb9124c09852050a8367a9 Content-Type: text/plain; charset=US-ASCII; name="report-emacs-bug.txt" Content-Disposition: attachment; filename="report-emacs-bug.txt" Content-Transf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