From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniele Nicolodi Newsgroups: gmane.emacs.devel Subject: Re: Is this "save practice" (setting default font scale)? Date: Fri, 20 Nov 2020 16:06:29 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15063"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 20 16:07:46 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kg80n-0003mi-R8 for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Nov 2020 16:07:45 +0100 Original-Received: from localhost ([::1]:40038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kg80m-0003HW-TE for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Nov 2020 10:07:44 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg7zk-0002dJ-RQ for emacs-devel@gnu.org; Fri, 20 Nov 2020 10:06:45 -0500 Original-Received: from grinta.net ([109.74.203.128]:43962) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kg7zh-0004de-Ji for emacs-devel@gnu.org; Fri, 20 Nov 2020 10:06:40 -0500 Original-Received: from black.local (ip-109-40-65-254.web.vodafone.de [109.40.65.254]) (Authenticated sender: daniele) by grinta.net (Postfix) with ESMTPSA id 3FB39EE55D for ; Fri, 20 Nov 2020 15:06:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=2020; t=1605884796; bh=vBBjI01EYODqcg2pxqX7fwtCeOoPLFJ17aWNsvYQ5RE=; h=Subject:To:References:From:Date:In-Reply-To:From; b=ZjEb4ov4kcDws5rWN7+xzRBiMGhdfILkA9nAoKWsbHpDWc5WGo223ZUv832AaKdFD iy3Qajuq5xKyGYlxl0pRHMI9HpqP0SntrLZ4xfpH9zs2Lf5Z7HIrEkFbSZcVRiZL7s BPLRtwMx5uE6hfGAqAXDybaINi1djiZjb8Wnn21Bz94ULt8OHqeAUbLErh1Y6pTR5t vYLfOhOC6Nm6KDh3GSwJ9N7ZQZa9PRLEzZV2eXj4AdkYFAWisTaiVZy09wCrP80nWb E8nL0jYM7V/j5Ea6B1IKj0FoZmk+cpkiSiw2iOl4fuDn9svwWP2ggrR4R9jRffDD6h PvygAK8lrzEtg== In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=109.74.203.128; envelope-from=daniele@grinta.net; helo=grinta.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:259490 Archived-At: On 20/11/2020 15:51, Arthur Miller wrote: > For few years now I have been using this to set default font height > in my .emacs, as told by Mr. Eliz some few years ago in some social > media thread: > > (add-hook 'after-make-frame-functions > (lambda (frame) > (set-face-attribute 'default nil :height 160))) > > This also seem to be THE way to customize fonts as found on numerous > SX/Reddit/blogs/etc discussions. So far so good. > > I have refactored my init file and trying to push some things to > early-init to save some load time. What I have found is that above > little code adds ~200 ms to the init time; take or give. > > Maybe it shouldn't but I have profiled several times and it always add > to startup time. > > Furthre investigation discovered a giant list of faces in Emacs: > face-new-frame-alist. Setting corresponding value in face vector for > 'default seems to achieve exactly same, but without measurable > difference at startup: > > (aset (cdr (assoc 'default face-new-frame-defaults)) 4 160) > > So my question is, is this safe to do, any pitfals I am not aware of > (more then me poking into internals which may change in future)? I think the recommended way to change face properties is via the customize facility, thus through the the custom-set-faces function: (custom-set-faces '(default ((t (:height 160))))) Cheers, Dan