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.help Subject: Re: with-eval-after-load with sh-mode Date: Fri, 02 Jul 2021 22:59:01 +0200 Message-ID: References: <8735swg1oi.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5461"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 02 23:01:27 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1lzQHv-0001Gt-Hb for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 23:01:27 +0200 Original-Received: from localhost ([::1]:55490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzQHu-0003Lf-Iz for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 02 Jul 2021 17:01:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzQFf-0001mN-LL for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 16:59:07 -0400 Original-Received: from mail-db8eur06olkn2045.outbound.protection.outlook.com ([40.92.51.45]:10976 helo=EUR06-DB8-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 1lzQFd-0000yf-1v for help-gnu-emacs@gnu.org; Fri, 02 Jul 2021 16:59:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PkAMBuJHRBkkjEAKJtKORTAaIXreeA95l4TWyt4O9ADGEIhDmOzkHXc9FaxW5hECUBs4bigFozFYAT1KipaSF4AHPX8dKSxFxZ180QXcHEL0ly2L0O8L9IhY481RvA9L1/sSKkEQP6rKUJv+DxMidGzDEmZ5GVQFr1/txPslvx4o7uyfBEIChj/QxRow7EI7YWjHH/KgG845eEkwd7FegoHwVeBeeo6Cvv9UNVuY31X+f9GdXYr8dOaVoUHH6hgNWIR7OaNA6zo6xB/MvdlqIENMGdUsLz3Zsjotf6AGf3wKB0APkGZ8QHtT6grLbt9iBlX0V1XKkm2/tYH82TkluA== 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=XxqIC7pAiE4CSzyYXGx6fVwt4W0z0rj0LuGSyWSrXGA=; b=eSha3VSoyHViUh0CPsOkWjHlSaDKFlijKbPEeHuowlZS4477wCGjwC4nPoXaTEbnIcnaBRby5GVJConI9IUTW3LtYWbXA4tPv0fZfbVh1U+alwh6e4POAl5zWQbYEp1dj8DUhLmrQnMeZLutLJYwvOqrUNLbGvq4odUibwKy3/lD2gxBFwGhBX9hZkEKQszzd+ashNFy08oL8ok5KM5v/1Ag+Mo7503V5EPOuRBwDt2XbrAmvPElEAXcG6J2KS/CXEM0p17ZEnOvUFDiEzBKecX8/NNq01DWggZICiDCl7Euj6c8dfoTokzSbGbKpKCODOP6hvEj2KqYB1+siFk23w== 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=XxqIC7pAiE4CSzyYXGx6fVwt4W0z0rj0LuGSyWSrXGA=; b=Fks2iijtvgnouAEWOKirDmg7HbA87YhouBSeyGY+fVPHDf7DDVcINdPsk1nWRHEnPudMxGTkDx6m5aIS5zs135j+v7Lnv6YEGWpTKwUPGZ5I2uQjOUgmcGsW+3brJDxnhVWoKRuxa2Ugk2gbrR5AT/fW1d+zAfpRozjz3PWV5z95qEVsp7jVlPrsqTgQ5I90kLcRR5q9WNMtR79xtxm/zpFB4TmN4zZTZa7SDcS0kRrkCnOhGWZ2C6PG6gDVT7aLIAaWI2FgvotkQB/k7Hq0wGJRt4ugaBnN2gf+huj+sJSydHQkLCl2rR6YGq+F6YmcrPGFtmq1jaYbfXYzjTChUg== Original-Received: from AM7EUR06FT026.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::45) by AM7EUR06HT029.eop-eur06.prod.protection.outlook.com (2a01:111:e400:fc36::477) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22; Fri, 2 Jul 2021 20:59:02 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc36::4e) by AM7EUR06FT026.mail.protection.outlook.com (2a01:111:e400:fc36::393) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Fri, 2 Jul 2021 20:59:02 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:843204CC20318F24B59A0E2E233B3ADBEF8918A55CFD2D4415DA9D35380308C1; UpperCasedChecksum:403E8EAFBE8E67151E45B1BCEA258CD47DBEEDD892E204CB9698F22E8E1AEDEF; SizeAsReceived:7451; Count:45 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::656a:1596:f5dc:12ea]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::656a:1596:f5dc:12ea%7]) with mapi id 15.20.4287.023; Fri, 2 Jul 2021 20:59:02 +0000 In-Reply-To: <8735swg1oi.fsf@zoho.eu> (Emanuel Berg via Users list for the's message of "Fri, 02 Jul 2021 17:45:01 +0200") X-TMN: [aSJQzMGvWGKsBamnJrrABJ4qfO94pRCP] X-ClientProxiedBy: AM5PR0601CA0083.eurprd06.prod.outlook.com (2603:10a6:206::48) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87lf6oiga2.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM5PR0601CA0083.eurprd06.prod.outlook.com (2603:10a6:206::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Fri, 2 Jul 2021 20:59:02 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 1d2f3503-558f-4f1f-d272-08d93d9c38a5 X-MS-TrafficTypeDiagnostic: AM7EUR06HT029: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eFRVKX2mK9ycx6nX0lcuZ4CXJKpjBqgH9qvMhhR+DyKfK6/Y+DfHCq5UpzJmcXct/XU9gxdPJHoBDH6U16yA+X76/RgLkxbxyynR8pcmSR1wipHbdluNRzgBLmJVQd0smLMqNdV7B9aZllgfmVJuGDbULZEYh2Zn/2IGCQxwOgqauGgBopfqec0khX4sL6DCFB1Tl1Zu/SDmhQe/OFjYAU90bw6TqiJNgwp3XNRgDYxqUBetiTjjHDlirVe7iV8rgW7U339Hz8gp/vHl5xAobNxcokvczei0EiXwhXQ/MIP5BxsjrekC8uGVjVavBi7Daa6OoTBrgB4mj9EoPOVJnG0+dnWTCcxKYhURlCwmZ5rqjg3o3CJ970LkXKh7ZHK0eZdo7SpZr2W3dnUAsehaBP5Dvi9kfKdfX560MSaBnakZbLgEdnyaxPg7meorYdB8 X-MS-Exchange-AntiSpam-MessageData: 7f35oXfVnHytZpn00lQWsQMvH+5Ej65H3e8PrR3C1hQZycIdlYRj+alqFbQghOGOvgYsATm0gAtI0zbTZsF6Ng6RbtmGYncLyNmx8a9z67WiWgCTfrqLWRWn5/y9x8QRblGKswAuBPiWqP1FFZFe7w== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d2f3503-558f-4f1f-d272-08d93d9c38a5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2021 20:59:02.7893 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM7EUR06FT026.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: AM7EUR06HT029 Received-SPF: pass client-ip=40.92.51.45; envelope-from=arthur.miller@live.com; helo=EUR06-DB8-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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:131422 Archived-At: Emanuel Berg via Users list for the GNU Emacs text editor writes: > Arthur Miller wrote: > >> You don't need to require sh-script.el. sh-mode is >> autolaoded function so Emacs will load sh-script when >> sh-mode is invoked automatically. > > You sometimes need to `require' it anyway, e.g. try setting > the face `sh-escaped-newline' to something. > > The byte-compiler seems to be OK with it (it doesn't say > anything) but when the file that does it is loaded it says > that's an invalid face and everything comes to a halt. > > BTW it seems you don't need the hook solution for this > particular mode, just require and set the faces, when the mode > is loaded the faces are OK what I can see. Of course you can require, but why require it in your init file when you can postpone that loading (lazy load it) until you actually use sh-mode? Set that face in either with-eval-after-load or mode hook so you don't need to require that file before it is actually needed.