From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Re: Is this "save practice" (setting default font scale)? Date: Fri, 20 Nov 2020 16:26:08 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4303"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Daniele Nicolodi Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 20 16:30:32 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 1kg8Mp-0000ya-SY for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Nov 2020 16:30:31 +0100 Original-Received: from localhost ([::1]:55304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kg8Mo-0005vy-S8 for ged-emacs-devel@m.gmane-mx.org; Fri, 20 Nov 2020 10:30:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg8Il-0002ir-Oz for emacs-devel@gnu.org; Fri, 20 Nov 2020 10:26:25 -0500 Original-Received: from mail-am7eur06olkn2087.outbound.protection.outlook.com ([40.92.16.87]:43489 helo=EUR06-AM7-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kg8If-0003Zp-JX for emacs-devel@gnu.org; Fri, 20 Nov 2020 10:26:18 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Wqp5x2/zp79R1v6VrUrWRhBsSUlauhLMfJr5pKEAvyHnXEpWiUq4tHBOEp4cHne+chg0rMhyhXuqVL3kSIFZ6jBQEGfSp7Q9g6kS5VzD6KPXLqt8Ep4GySVgRNEEcTnXPvvk8iYMQFt+GLtEsTVabcoKAuxuDSAPZ/A9e4Tbcf+U/cQ5D1nlabf7jvweMiIRvqVGQ9QlPUt/2psHo6bFegvlSBt6q4y62cJxgzqbNgDL6QMKQD+6sJKMQu519IKmSxaQn51JSJ8+zdBfTchgiMnnJpCBN3rYTTGDXLL20mNmCpm8oUer9W/LhTdXnFZCcXXuvF3DMYD+U1UpuNFcnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z6M0xS7YGMmMvX0/qFA2KWIe3a9s3diRl9eYABFAW1Y=; b=cyJtvvLs0WCGDw/Ir87PcymuD64SfX7CUhk2u8F24CNTx2HK1wEpN1jy7VVZiKbR0oX4aqyavPTK+j2LM+BYsiK5iIs6qYy2MIQGtgfAsHxBFDX+7bocUzOXbKrh5WL0+cony60lNRujbIj2+obezrGQ0doNwCvRIqUb1eVjcF68HlEYhEHEgyYAcks2xCkVM1DishACHf0fwPVq4E5ClPNxMGh6Sc1BCLp4qhK18ZxTFGLCa+0uqT/PuYeH/5IiKSQje9rFFN/prpK2N9sD7hEOqRCiwYlY/QaMrTqGwuys6yFk3vYAYZtJcYzSxDQmgH53MWl+/senHL+Db2Zmeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z6M0xS7YGMmMvX0/qFA2KWIe3a9s3diRl9eYABFAW1Y=; b=GGuAA7pFNpWQVP8SjTysnK+Qu8pNvywd64JOHNELIf+hIhmMQ7UpQnimXu5o/eIWwZ1VF2nQoNkP59QLoW2Qh5co3H79mnuq0oJgksk9Q4fc5+/RJmJL1EjpmLUwXKeTHOsGDfbZKCjRU5IVL76ZGDRRT/WYyZ1lJeY/t6fnRKGSfPlOf4gw4ebO4b+5jdzzWBSSdQy8owcjBGCltuGq46sUD30N5DEAed6X9mLvxFZOamat/3vcOAGTaUnRCk9jqrlPvhskydwwa933DvcHuCISUu5bNNwMGjgAG9LIkO2p+6qLCHRAL9mNqe1KjZECNd5SR4F352CXuVAkW6zcmQ== Original-Received: from AM7EUR06FT056.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::50) by AM7EUR06HT230.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20; Fri, 20 Nov 2020 15:26:10 +0000 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com (2a01:111:e400:fc36::40) by AM7EUR06FT056.mail.protection.outlook.com (2a01:111:e400:fc36::435) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Fri, 20 Nov 2020 15:26:10 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:D586E9E68D024622F40480ACBC51AB1642F5F4C2A5B1A9107CDA61C93192EDAF; UpperCasedChecksum:DF567AF0BAA3F7DC5F67F192E7978A262E334790DB48AF9F61D92E274C3F6327; SizeAsReceived:7522; Count:46 Original-Received: from AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993]) by AM0PR06MB6577.eurprd06.prod.outlook.com ([fe80::9487:8c7d:da00:4993%7]) with mapi id 15.20.3589.021; Fri, 20 Nov 2020 15:26:10 +0000 In-Reply-To: (Daniele Nicolodi's message of "Fri, 20 Nov 2020 16:06:29 +0100") X-TMN: [U//wpWeFAobSo7F2ycCLZPTzBGAawJk9] X-ClientProxiedBy: AM6P193CA0052.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::29) To AM0PR06MB6577.eurprd06.prod.outlook.com (2603:10a6:208:19a::23) X-Microsoft-Original-Message-ID: <874klkqcbz.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (90.230.29.56) by AM6P193CA0052.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Fri, 20 Nov 2020 15:26:09 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 9c518c95-be41-4b28-d186-08d88d689ba4 X-MS-TrafficTypeDiagnostic: AM7EUR06HT230: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zOE5aPSvxoFvz/KFMbp25RfCToON0F7mnDSYC5/K36VCEMxzfMEUpBIJaaUwjJaguZ2hgC8c3MT+oNw0OIgCUNFHONbQN4eLv4UR7TbAwuuE8e2JWpp3E43fX3dW7VrLbwa5g2MEDsd/bQCQFvRlGkNJxh/yGocqS9gdBB/iFjTfgJBbTf/+uAiyMuXm5k9SUpyE/HVkB77L9GaDSiOSUA== X-MS-Exchange-AntiSpam-MessageData: Qz1EN1S5Iq+GB7W20gjLiWPjG8rGlwtD91ERnI6vyBCFC8dKPHqy71yAGcwN+MZbTI7OE0A00sbeNONjmofOoi/WlV7tD2CpLk3zGeN05zRhZUftC05cbK3Q6rnvKRWxmB84eTF8s6Kr9z3XLmhsLw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c518c95-be41-4b28-d186-08d88d689ba4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Nov 2020 15:26:10.3436 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT056.eop-eur06.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7EUR06HT230 Received-SPF: pass client-ip=40.92.16.87; envelope-from=arthur.miller@live.com; helo=EUR06-AM7-obe.outbound.protection.outlook.com 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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:259494 Archived-At: Daniele Nicolodi writes: > 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))))) Oki, it seems to achieve same result at about same speed too. It is slightly more complicated; it calls custom-theme-set-faces under the hood, but at least on my computer I can't seem to be able to measure the time difference. Seems that every startup varies somewhere around ~100 ms, with both versions I am getting startups 0.32 ~ 0.34 secs. custom-set-faces seems to be slightly more descriptive, than setting value directly so I'll probably go with it; thanks!