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: Emacs Modular Configuration: the preferable way. Date: Mon, 21 Jun 2021 12:14:35 +0200 Message-ID: References: <87pmwgdiyj.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="39198"; 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 Mon Jun 21 12:48:34 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 1lvHTl-0009x8-Uc for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 21 Jun 2021 12:48:34 +0200 Original-Received: from localhost ([::1]:53506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvHTk-0007lI-Tq for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 21 Jun 2021 06:48:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvGx2-0002rE-K1 for help-gnu-emacs@gnu.org; Mon, 21 Jun 2021 06:14:45 -0400 Original-Received: from mail-vi1eur05olkn2049.outbound.protection.outlook.com ([40.92.90.49]:19041 helo=EUR05-VI1-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 1lvGwx-0007lV-LO for help-gnu-emacs@gnu.org; Mon, 21 Jun 2021 06:14:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j7TGs4L8tq/rpzAMgy0Ja07csMq74yRGkPxo0VnNIaosT9xLwZ5nZDSoV/HqLDa09TRUpc3hNhBBMvP69htQi3mtLBejAwHSWikHd+82lcogypVBsDoa7bvzLfx9pvaihOAnAqJRmToEauVex626R1ft4Hk1qXypokiTQq1el8xAx3aDuPpxOmpDcndRLVcA5pnk02KRRGBrFKHL8RoGyCYNN75hZSj08U3uQGgYiU1UyetXSMS9ohL96P0h3vVL0M+BPKOuOjL50F2WIsgsRwpjExtF0HRaU6Dg9ZFYR2gh5HPItrnBDTMGlRlc6rGKmnMWzCHn5Umntz9FAMzaQg== 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=Oxo8rqFcdEM0c/+hOACqa1A0s5SLxqkQYUk3j9BXVzM=; b=CL5aPx2rW+1UEMgTA18E3mpSQDy9amzo58IO/3bGRlMXrgpL06GKyqLEwpR9Qd2LZMjgIKbdJONSrnfxJpB8vBOK3mVd0lG+MFVK1kqkCiULb3DihnGOnNBzqw7NWlttt1B4/rnToy2bz01jHPWZgK6edxNpa66CmVMXBnwcA0HkjGJkC+4BY7n804SbnKvLwB9P0de08XCrxTHJaz9B0JeUibI82+4G6EtaQLr5B9iO+AOL9aqEiFqwt4EXlhOwMj4DFdiWnPSzUhRsx9qqT7qk7bdvSzB2847Di+7bXRa0DeZBWqPFu3NpPQ6ku3K1jX0jG4R+5DJSqthG+eQYZg== 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=Oxo8rqFcdEM0c/+hOACqa1A0s5SLxqkQYUk3j9BXVzM=; b=bVYju9f6o0plUP6lkAqv2ocIlYKR4pfWQLP6k20KV6xXeukrk9QvM+bI8Kba8qaUO1RDM1lQtVwgWt7Y5y+4osW+ISM9Cb3p+l0iUDrGyslE64AW72v9OqaZGmEKuDdTTVPOLk3WrL2AaGxSLNQ0C5dmULqjK9P0cLBQKjmAwzY52hOQNrunc4ajAv0v4YKdAftKjXqwTBaQ2DPu5zf0hnkyM6nmvgTnxz19WMyfA90tqpeUP2xxpdDqbb2m1v1mJHqosdVaa/3D1SLIoYFzhowDX5WNoN2EF2T8ZPVaNujmBp2dGxmbYOc2aYFOlmOEXJ4Foz3Pz+VBK3aO9APPUQ== Original-Received: from VI1EUR05FT067.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::51) by VI1EUR05HT080.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::190) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16; Mon, 21 Jun 2021 10:14:36 +0000 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc12::4b) by VI1EUR05FT067.mail.protection.outlook.com (2a01:111:e400:fc12::446) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.16 via Frontend Transport; Mon, 21 Jun 2021 10:14:36 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:8C4AE23EDC258F88DEEA32688D02E39C368642BBF25CAF46A3308D19AB16445F; UpperCasedChecksum:BB1AB59885D37672EE21B586A019982E6F822FCA01D2A0BD7C0E38A005F5CB22; SizeAsReceived:7445; Count:45 Original-Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::51ca:cb30:2619:5219]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::51ca:cb30:2619:5219%7]) with mapi id 15.20.4242.023; Mon, 21 Jun 2021 10:14:36 +0000 In-Reply-To: <87pmwgdiyj.fsf@zoho.eu> (Emanuel Berg via Users list for the's message of "Mon, 21 Jun 2021 04:56:04 +0200") X-TMN: [zDc4kH0oAJNgyosL/CeeZ/kBC6ayV1ny] X-ClientProxiedBy: AM5PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:203:3d::23) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87czsfsewk.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from pascal.homepc (81.232.177.30) by AM5PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:203:3d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.21 via Frontend Transport; Mon, 21 Jun 2021 10:14:35 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 5c63b62f-f63d-4072-b3fb-08d9349d5f15 X-MS-TrafficTypeDiagnostic: VI1EUR05HT080: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tfzhJJHueuAL5rXQ7rMZZxpGhJ2fn4UtCtZFkDiZ/zi9oYiJtVAseKru74tTO3GiaRqmUSYJWKSW/Z/lW1OdtislsYSWLkJJ3lttINCFprQcF5U0D85xCWDHrMAiTTrfN6y5/aY+o0iUjoW2IEZM4cbJuGYkkfY/bi12xFnLHfcR0EEJ6rLAJXDMNUiabs+XusBf8hWPiXeVANbws2/ZjLNusg+2N5vmw2BLOZDYAWROQRgBIWIHGoCeK2D1DZQjejBqDzuArv9MULJoOOFWWyfARwjKrM4qh3fbPISXHgTEXEKi+UniHS3f7DuiUZUOWPZxU+bhiSYnZQIPoZ8PUQFQitCN/7A/7KUQdnAeeimNXinJtsc/Ax5iBmVISqVEb3zll4Obrzc+fNL03+OiAfgHOcfowpmyiTnEjHDgYl/E9cyUygQCw6vPDhZvnkQBq5ZTcVBR2/qNgJh6+RVAiA== X-MS-Exchange-AntiSpam-MessageData: UblM9qLsNiSUBA0UtyHA+kmU20mf26Gz1j7wHUGS1Eo0W1KvH9A6OK7jVWxfm3Urz+nLfWDOaSfhDa1j9DVmjV3P6MZni1M3GNZsqQUIco7ivm5wOClfrusxvjUJm6hMxLVkf/aOis4XzzCHsiBs5Q== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c63b62f-f63d-4072-b3fb-08d9349d5f15 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2021 10:14:36.3276 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT067.eop-eur05.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: VI1EUR05HT080 Received-SPF: pass client-ip=40.92.90.49; envelope-from=arthur.miller@live.com; helo=EUR05-VI1-obe.outbound.protection.outlook.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) BAYES_40=-0.001, 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:131134 Archived-At: Emanuel Berg via Users list for the GNU Emacs text editor writes: > Hongyi Zhao wrote: > >> I noticed the following instructions/tools for Emacs modular >> configuration: >> >> https://www.emacswiki.org/emacs/DotEmacsModular >> https://www.emacswiki.org/emacs/DotEmacsStructuring >> https://github.com/emacs-jp/init-loader >> >> There are so many ways to do this. What's the >> preferable way? > > My personal favorite is the method below, I don't know if > that's mentioned on any of your links. > > Note that every file is mentioned explicitly, that means if > you are to search for an error (say do the so-called binary > search) you don't have to comment in and out code that might > have comments, headers, footers, and so on, instead you just > comment out one or more filenames, and when the bug or > misfeature is localized, it is as easy to enable them again. > > (let*((emacs-dir "~/.emacs.d") > (lisp-dir (format "%s/lisp" emacs-dir)) > (init-dir (format "%s/emacs-init" emacs-dir)) > (erc-dir (format "%s/erc" init-dir)) > (gnus-dir (format "%s/gnus" init-dir)) > (ide-dir (format "%s/ide" init-dir)) > (w3m-dir (format "%s/w3m" init-dir)) Isn't it better to use path formatting function instead of string formatting to ensure platform indepent paths and such? Something like this: (let ((etc (expand-file-name "etc" user-emacs-directory))) (unless (file-directory-p etc) (make-directory etc)) (setq show-paren-style 'expression ..... backup-directory-alist `(("." . ,etc)) custom-file (expand-file-name "emacs-custom.el" etc) abbrev-file-name (expand-file-name "abbrevs.el" etc) bookmark-default-file (expand-file-name "bookmarks" etc))) https://github.com/amno1/.emacs.d/blob/main/init.org