From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.bugs Subject: bug#1785: bug#1547: face-font-rescale-alist has no effect Date: Sat, 18 Apr 2009 00:11:20 -0400 Message-ID: <87bpquiot3.fsf@cyd.mit.edu> Reply-To: Chong Yidong , 1785@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1240028653 28188 80.91.229.12 (18 Apr 2009 04:24:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Apr 2009 04:24:13 +0000 (UTC) Cc: 1785@emacsbugs.donarmstrong.com To: Kenichi Handa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 18 06:25:32 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Lv27P-0005Bp-Jg for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Apr 2009 06:25:31 +0200 Original-Received: from localhost ([127.0.0.1]:46310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lv260-0005IL-LV for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Apr 2009 00:24:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lv25w-0005Gn-50 for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2009 00:24:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lv25q-0005Di-IW for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2009 00:23:58 -0400 Original-Received: from [199.232.76.173] (port=36364 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lv25q-0005DQ-Cm for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2009 00:23:54 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:47075) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lv25p-0007ZK-Te for bug-gnu-emacs@gnu.org; Sat, 18 Apr 2009 00:23:54 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3I4NpkH005650; Fri, 17 Apr 2009 21:23:51 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n3I4F3qn003067; Fri, 17 Apr 2009 21:15:03 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Chong Yidong Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 18 Apr 2009 04:15:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 1785 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1785-submit@emacsbugs.donarmstrong.com id=B1785.12400277721625 (code B ref 1785); Sat, 18 Apr 2009 04:15:03 +0000 Original-Received: (at 1785) by emacsbugs.donarmstrong.com; 18 Apr 2009 04:09:32 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3I49UQ4001613 for <1785@emacsbugs.donarmstrong.com>; Fri, 17 Apr 2009 21:09:31 -0700 Original-Received: by cyd.mit.edu (Postfix, from userid 1000) id 53DFB57E21C; Sat, 18 Apr 2009 00:11:20 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 18 Apr 2009 00:23:58 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:27301 Archived-At: > > What I currently don't understand is that the font rescaling doesn't > > work for the default font in the above case even after > > (clear-face-cache t). I'm now investigating the reason. > > I think the problem here is that the opened font objects are already > stored in the LFACE_FONT entry of the default face. Note that > > M-: (set-face-attribute 'default nil :font (font-spec)) RET > > successfully refreshes the face with the correct rescaling. Until a better solution comes along, I propose dealing with this situation with the following hack in startup.el: check to see if the init file changed face-font-rescale-alist, and reload the default face if necessary. What do you think? *** trunk/lisp/startup.el.~1.527.~ 2009-02-20 10:20:55.000000000 -0500 --- trunk/lisp/startup.el 2009-04-18 00:07:05.000000000 -0400 *************** *** 499,505 **** (delete (concat "PWD=" pwd) process-environment))))) (setq default-directory (abbreviate-file-name default-directory)) ! (let ((menubar-bindings-done nil)) (unwind-protect (command-line) ;; Do this again, in case .emacs defined more abbreviations. --- 499,506 ---- (delete (concat "PWD=" pwd) process-environment))))) (setq default-directory (abbreviate-file-name default-directory)) ! (let ((menubar-bindings-done nil) ! (old-face-font-rescale-alist face-font-rescale-alist)) (unwind-protect (command-line) ;; Do this again, in case .emacs defined more abbreviations. *************** *** 540,545 **** --- 541,551 ---- (not (and initial-window-system (not noninteractive) (not (eq initial-window-system 'pc))))) + ;; If face-font-rescale-alist has changed, reload the + ;; default font. + (unless (eq face-font-rescale-alist + old-face-font-rescale-alist) + (set-face-attribute 'default nil :font (font-spec))) ;; Modify the initial frame based on what .emacs puts into ;; ...-frame-alist. (if (fboundp 'frame-notice-user-settings) Diff finished. Sat Apr 18 00:07:09 2009