From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: [External] : Configuration files vs customization Date: Sat, 21 Jan 2023 17:44:12 +0000 Message-ID: References: <25548.5130.933634.159947@woitok.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36050"; mail-complaints-to="usenet@ciao.gmane.io" To: Dr Rainer Woitok , "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 21 19:57:16 2023 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 1pJJ3D-00098p-UQ for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 21 Jan 2023 19:57:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJImk-0007HY-0F; Sat, 21 Jan 2023 13:40:14 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJImX-0007Fo-Gp for help-gnu-emacs@gnu.org; Sat, 21 Jan 2023 13:40:02 -0500 Original-Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJImU-0008An-Kc for help-gnu-emacs@gnu.org; Sat, 21 Jan 2023 13:40:00 -0500 Original-Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30LENEIn018404; Sat, 21 Jan 2023 17:44:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=VM2KLgoOgkjVTzK35GyyNv2LZGeTjJZcbJswZo752wo=; b=AUF2W5G9yZNE+Yn2BjwT6JFhnG97NQDvkyUBAzXlZsHxP+y3VZu68lFvRTVWUJTmrfUz DBwrvc3jweiJLcMxoeZi6RxsvRJ+NpCEJTeb49oT12zu5jKQK6ld+7bQ7SWR2p4JWz8m 1flNl6G4hqkA/4ReyxyMszjKlFnTFvUUjXciYZLxru3RJgWfwuKyhekYinN7PzaXKQy8 jLWydoz2rr9dU9xlwDo4sxeM74bZ9IAeciu88jCy13bU6W7b0IgUZNKXsNo4IC0IDjNN kVaEIWGNOLnRqYqBKZH/qwKk9T8iJ7AAIJi3EsHLcZAwvI59xHXaxzGW3Atv6goqZ4hn pQ== Original-Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n86n0rnq9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Jan 2023 17:44:21 +0000 Original-Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30LG5rgp004799; Sat, 21 Jan 2023 17:44:19 GMT Original-Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2172.outbound.protection.outlook.com [104.47.57.172]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n86g8rhjg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 21 Jan 2023 17:44:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H+aJHgdCn+EdJc/johPnKF0cpvTsOyFsKhRUOFB/LYo6E5qEr/HwlXmAdquQPP2pwdOWLYFJkUHsTCZK1d5aEp2aGUjHGQEpgUnIAuf8hscL65WotekeUyUUKbmGsNt66EqBY8agzhlk/RymnhPjrRJwKCqUPD97VdjQtN8jOfNwlyh/A1oQYQZl4EGpONETvKEsSxLY6O3n1M9cCJl8dBKqplFa+PtwF0QFRNqbr7CJDgCT/pg/N5xtMAo+v4AmUuuaUMpNSpF0YeiW0VhFRq0Ur3lbKKHkuqycdR9q888SKgytrQJsScsU5QMxQLygyy3UvFo4LGxX3Oo3AKq6UQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VM2KLgoOgkjVTzK35GyyNv2LZGeTjJZcbJswZo752wo=; b=c6zpFCUxThnFNNkWZlTDSzu2S66XHILPJ4cvj+lwZOWwbu79HndA+b+qgtvlwvUNMOFQdZxy21imjBP/OLMS+yoYExw37iweb20Kks4c+wMP7XvxvlfjY6Rbm3JMyrJLkxt/4PLH4SG1v53YjG3syq1lAMKpbO6uFWsYZvrIKGsHExxN5m00AOs15+1sSbwMr+SEIz+sHP9NBv9bMbmjEH6ncqWW5zuImP+PhIcIa0LwGj63YsIJ/S/HxOFaljJVrYD51lK+KNQfvGo2isGtz9uVznUEYZUioz2NX7+cPBQkvCR8UyX/8JyRPJnGaOGVrDT2zokJQsazZHNt0X1/vQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VM2KLgoOgkjVTzK35GyyNv2LZGeTjJZcbJswZo752wo=; b=cX77Qk7UnDG7kt5Q1eiGivGiy4gOGSdQ9M+N78IGvKMI1HrnbZxLt36/wMisulSQcWr3IGwInTdfr82wSW/tgTmG7Np39KKv4HApK3y2AHSF5LcvDr4fd76Q/pA9FT/wovxTeigCqWgjBqhqi3YDXaMqLPPDIN82UwuJSC9YzyY= Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com (2603:10b6:a03:37e::19) by PH0PR10MB4775.namprd10.prod.outlook.com (2603:10b6:510:38::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.7; Sat, 21 Jan 2023 17:44:12 +0000 Original-Received: from SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29]) by SJ0PR10MB5488.namprd10.prod.outlook.com ([fe80::7c3c:e53d:5276:ef29%7]) with mapi id 15.20.6043.009; Sat, 21 Jan 2023 17:44:12 +0000 Thread-Topic: [External] : Configuration files vs customization Thread-Index: AQHZLbZQroQlrjTxS0yYSxWO24KAR66pGoMw In-Reply-To: <25548.5130.933634.159947@woitok.gmail.com> Accept-Language: en-US Content-Language: en-US x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR10MB5488:EE_|PH0PR10MB4775:EE_ x-ms-office365-filtering-correlation-id: df868e86-0af0-48ff-0549-08dafbd71b61 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: KjC21SPmwYNGVocWG+8CDIJnCwh4A9GNYHTXG/nDgCKrpF38Qz305MHPe1Y3cuBmAodp5+kLTk7jkha19/ntEMmmLwk7p5ynh6fKWKBjj4y4kTe4V6EpjXV18GuA15DnN7yYO64mFQWaROqzJ6avO2lqfkDwxG2FG2QFcGE0DcDeFYWQZR7rFNhpOOY9pknPZVzr1U27CuZulZMrE1kP8zBDFovJp4lyIdqAXqf5yYuIpFOFX3OpdpA5QZ3ECIrvdimQSRipNSinqQjbFHyyiY0rqWGiuWOYKHrTEL7jFXRkpiI5lIDEh5lTXmEkbLibCmrZy5JkSonCl64q65KeRYlb/OnCWNbPmzt+ykzrIR/UkTcYOyK0koXURv3FjEj8/nGpoSatFHrrvq37nyBsrlYJq77q7l08DPw97B7OVQJDkIlteffHiwADc5Iau0QfTfM+5YZ7QmliyNjubBVqOZ46/35cMetfs7qukmG2PCFte3zleyRSAtpGRkYD1QLn1WHQR7XZUtyg3xTi44PwjNf0V8/c9MPoB04XMD4cSPPwmWI9FXqaYBS/+dWgbfDzmKncabBg+JGwMq/dNig1AnhuGUtHjrYLauQ6FjBfmj3kkhd+VZZC9rjIus26pkZsrW8Lewq2O5EpoEzrrNVqIwgQ0b4KJewK1r+E0JrMYT3dzGIhu8+LPwvqgyLD8a4NPK1taaOMZbu8kjAp6aGCIAOFml8tOQQqO5L6TB7FxAA= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR10MB5488.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(376002)(39860400002)(346002)(366004)(136003)(451199015)(71200400001)(44832011)(5660300002)(8936002)(66476007)(66946007)(66556008)(8676002)(66446008)(64756008)(76116006)(52536014)(122000001)(38100700002)(6506007)(26005)(2906002)(110136005)(9686003)(186003)(316002)(966005)(478600001)(7696005)(41300700001)(38070700005)(86362001)(55016003)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?/JrbTyyZQ7mfWDhNVIiEsaZn6o/gv0yVkYt7AjkchFt2Hwr6bKPG/k3HFwLH?= =?us-ascii?Q?3GuPHIascppxRCxcVm2hILGp6990/UbCfDX0byyT+vtjPIRqEJt84hljQaW8?= =?us-ascii?Q?0yeFl590EUDh92bHivA00BsVcC7tBVV1EunZKPCgCGe+e5E9V7u2Qjtp0kCx?= =?us-ascii?Q?3Cuf5hbVKgzo3skpBYLr6VkWzuNyQzHB8cBWyRmPPnHJ/oANbuPxRV+c51Kl?= =?us-ascii?Q?bDuyG40Nh5dzgZMYjEYKGFFR4YXLK8IFY5dD8gbyEjn02ry/mb3Y96wsCE5S?= =?us-ascii?Q?PtpHqfJItgF0xtmEHKxLiH2jZi45sSeguc8aUkpl/IpxUUg8KzHnGtCFUKq7?= =?us-ascii?Q?Rkw4OOYnhULSYUzoO/0goKyQuwE8/y7IgcA0bvLVcGjwgawkR3WKpGMXEQMJ?= =?us-ascii?Q?RyUBNOwc/dY7JpI9gb3m5aPUEpMCVYyHjecH4lJaP7LfX+fU/JYtc7xPNo/2?= =?us-ascii?Q?7RKoIiDVxsFfcqYk9fD39Z4UH05MRBVe3rbBmg0BbyffJtM9rqMZSg6ly4pj?= =?us-ascii?Q?m518LI9LghJlXR+aAAS7TFK94QL/fWqoVCu7zVUlPlR+ujYjTunRFTHIAJZf?= =?us-ascii?Q?w4oCaYBZKrGq3IFie3V9aI5T6cW160ntDK9hRnhfToZjxE4I4gbEM7P7fME0?= =?us-ascii?Q?A0 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: CsZhaPGDdSCuQtCvcNvjuKlxKhCQQLoCywkWpGcu0iqooxfEJlvfYPtPtxICZs6tQIUe4Z3qibKrkMv8pIdQeeBobI+ShJT5Pofn9VqztVLFMSwXZG+1pHd3OD6JybWDr1nGgDGacOdTL555rZrAsGKjXwxuV5HFG85mFV3sT2TDU+xGlZBegsV2swAo1LgBE3gg20O6iy6u6KVvQCUt6q5yhlcs2AGvhf+8vtZAGxbWkxw0QLPjWe9EWvDYxkJFDsm0jQ8/fwwfYWivMoT4dRZlm9joRgr1LMKwoWavKLPXDWXF+o0+3NqtmgrN352TVgj7GJ1riNXkTuJhWrTytdDbckN4VmcdTVRs/UFZCe4Dmt51/oTIq+DpaWZuAb6Cs/RywnpYhaCxSP9NfCWapn8EHqrFVg7CkzCutXa1CwmHGVCNwhix/j1+tE6juN3mq6WhWGwgiFapQVKFZ5eHF0foUt3KnbbAYHRQ2Z3KzcBG9G4gwoYe7hTPZh5kQiyUZdHCiCMqid+qfr1Nz3WXELYX3zeV9MHNw7lbNFAdP31AlzInp13ykOVNNyBghzO+nhibIbs22eyVI2+LBkiPJbuCRqLvGsMqo3Vb2AsXSF/0tOvzZMYmj3ZptQgJ4kgDbzJNl3lNIzKRyLrIlyGdpSJz0wIFuH2LU6Wq4dBxKJ20fiWCeU06EemUr4Tz8A/aBfvQZ7IH7BA2WjJSxUhuHAkVifz8auX+oMAvtjQj3kN+vT zcmpX+K+lGU0gKss4huZotK+dXAqKXcEWSnFF48g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5488.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: df868e86-0af0-48ff-0549-08dafbd71b61 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Jan 2023 17:44:12.2074 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WUW0IGjX7Lojll8NUUUnLOqtubHq7EGKl5Gk4RGZ+VsP8zH3/gkWJq/i7HWUj8rXDg0R1uqja/0nOOXxl0gJVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB4775 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-21_11,2023-01-20_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 spamscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301210171 X-Proofpoint-GUID: q_sOaa9kPDlthqqeiMCRJNCr98kqyKUy X-Proofpoint-ORIG-GUID: q_sOaa9kPDlthqqeiMCRJNCr98kqyKUy Received-SPF: pass client-ip=205.220.165.32; envelope-from=drew.adams@oracle.com; helo=mx0a-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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.29 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-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142486 Archived-At: > Personally, I hate this clicky-clicky customization interface because it > doesn't evaluate the values, even though function "custom-set-variables" > provides an option to do so. Thus you can't use things like '(getenv > "HOME")', '(getenv "HOST")' or '(cond ...)'. > > The lack of this flexibility makes configuration rather tricky. > And according to the comment > ;; Your init file should contain only one such instance. > ;; If there is more than one, they won't work right. More precisely, they _might not_ work right. And "work right" is vague. What that really tries to say, IMO, is that unless you know what you're doing, it's a good idea not to use multiple `custom-set-variables' sexps in the same file. Even better advice is to let Customize use `custom-file', and use some other file(s) (could be your init file, but need not be) for any customization code that you write (provide). > function "custom-set-variables" writes into my "custom.el" file, No, it doesn't write anything anywhere. It only _sets_ the variables you pass it to the values you provide. They're set for the current Emacs session ... until you set them again or reset them. `custom-save-variables' _saves_ variables. There are other `custom-*' and `customize-*' functions, And most of the latter are also commands. E.g., try `M-x customize-set-variable'. The point about using Customize (the UI), or the custom and customize functions - _instead of setq_ - is that setq doesn't know about any :init or :set additional processing that's required/intended/expected when you initialize or change the value of a user option. setq just changes the variable value, so if there's a :set operation associated with the variable then that doesn't take place with setq. setq is a default, basic, no bells & whistles setter function. Sometimes you want additional processing to take place when you set an option value, hence :set. See https://emacs.stackexchange.com/a/106. > So being forced to put more or less all application=20 > specific configuration into one big "custom.el" file You're not. > which on top of all does only accept constants as values Untrue. The `custom*' functions evaluate their args, so you can pass them any Elisp code you like, which is evaluated. The `custom-set-variables' form that's automatically written to your `custom-file' or init file uses quoted lists (constants) as the args. But that doesn't mean that `custom-set-variables' expects constant values as args. > is quite a nuisance for me. Originally, having se- > parate configuration files like ".vm" or ".gnus.el" had the purpose not > to clutter one's "init.el" file and to save time when firing up Emacs > without also starting Vm or Gnus. You can have any number of separate config files, which you load from your init file. That's up to you. > How do others solve these configuration problems? Everyone does things differently, no doubt. A general recommendation (from me at least) is to separate all code that you write, including all that customizes user options and faces, from code that Emacs generates automatically and saves in your `custom-file'. So yes, do you a separate `custom-file', and don't edit it. Beyond that, you can do whatever else you like to/with user options and faces, with whatever code you like, in whatever files you like. You generally don't need to, but you can. Really (IMO), regardless of whether you find the UI of Customize clunky (and many of us do), the Emacs functionalities behind options (defcustoms) and faces (deffaces) is pretty solid and reliable. It can take some getting used to, but (1) it ensures that values you provide are of the right type - so behavior doesn't break, (2) it takes care of persisting your preference settings across sessions, and (3) it takes care of any additional actions that might be required when an option value is initialized or set.