From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Thibaut Verron Newsgroups: gmane.emacs.help Subject: Re: Configuration files vs customization Date: Sat, 21 Jan 2023 18:51:53 +0100 Message-ID: References: <25548.5130.933634.159947@woitok.gmail.com> Reply-To: thibaut.verron@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35696"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Dr Rainer Woitok Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 21 18:58:29 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 1pJI8L-0008VP-TS for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 21 Jan 2023 18:58:29 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJI41-0003Zi-7U; Sat, 21 Jan 2023 12:54:01 -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 1pJI3z-0003ZT-Mx for help-gnu-emacs@gnu.org; Sat, 21 Jan 2023 12:53:59 -0500 Original-Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJI3g-00031B-Nk for help-gnu-emacs@gnu.org; Sat, 21 Jan 2023 12:53:59 -0500 Original-Received: by mail-pf1-x432.google.com with SMTP id s3so6122908pfd.12 for ; Sat, 21 Jan 2023 09:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HUX7zDHOvh1zn9eGkT0bKzzvSZQOU1Y0HuDZfOXDmC0=; b=emyyPkAL3fn+0gUtRPzNC+gS8rXGftrE5arCv+weeHrtzFbLMMIPkUWc3pzuhJpMu2 mhP5BAi8QTlIDNJsuzTbms7XyLa/TRa+1aYxBxFkU1OscoXX9iccPHQrcVmX7Ta4lxbb hC2C9zpTkto8ut8Eje037MCn7sRq1d1Nr7k030hPmwo2O8b9wnEmggs/g4IgwzgbAtju HeC4PGd7x4pPc/4uXj4oDKN0kDQjjvst8JKxWoMABlwOSJBNROH8t3/GFF/S3LmBFdw+ XL5YShw5kP4zBT1PjnYGHp+Phfjg4rjTmM8aHaEJv3vChSs/iXK0+2+WQ+ETUGzU7sc2 qWUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HUX7zDHOvh1zn9eGkT0bKzzvSZQOU1Y0HuDZfOXDmC0=; b=ayvSs1FZlUkmF0ykaP0kaydiWW9SrQ9JnpaxqosCLM+PHOFkYAUgGi/IwwgZv2oezL 7ZOljhoqOCxNxa3n1zb5u7+21PxiKU6hcaRSLYZkvb9sFA6hTHhl1VBt/KBhU0GwjD62 rzv5aqe4xxSXD0h3yBpmgwTnwZ46HgUVlkzIbICdBkEPNp8x5QpMvd4J3YZ0aI0kzP8I iNBCSmROM74EExa2hDEm7i6/OwqgC3cQOLsqAZiHst4z9LypkfZpMZjPTDICZmYHbKON XClIZoAu2E9v0oLxy+yAEBKqUEr+eTRME6a+3YsUUYQlRKid7/46bp66OSpxSj92Oyo9 Be+w== X-Gm-Message-State: AFqh2krFM7hiDXD9lgJBw8OZpAfXGCzbW8wpdFCiCrOx11tgNEgvAt8r HmHUq2jLf+cI6h77z2pwj8nIblu9zntb9+EVvKQ= X-Google-Smtp-Source: AMrXdXsvSxvxZCCk5BrI2WlPza4fsr1dsnBP9UrMhdTa99Ttj28+MW1mkMx9L50W9VzOjLFjUbtndBgI/Mfg/+Yuqbs= X-Received: by 2002:a63:4d45:0:b0:4cf:1fbe:2b0b with SMTP id n5-20020a634d45000000b004cf1fbe2b0bmr1704211pgl.3.1674323524653; Sat, 21 Jan 2023 09:52:04 -0800 (PST) In-Reply-To: <25548.5130.933634.159947@woitok.gmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=thibaut.verron@gmail.com; helo=mail-pf1-x432.google.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:142483 Archived-At: Hi, Le sam. 21 janv. 2023 =C3=A0 17:34, Dr Rainer Woitok a =C3=A9crit : > Greetings, > > in the course of my transition from XEmacs to Emacs I meanwhile have > reached the point of getting Vm running under Emacs. But my first at- > tempt utterly failed. After some experimenting and checking variable > values with "C-h v" I came to the conclusion that at least in some vari- > ables' descriptions the remark "You can customize this variable" really > meant "You HAVE TO customize this variable". > Customize may do additional things than just setting the variable, usually reloading a function or setting additional variables. Most frequently, setting the variable before loading the package would have the same effect. > > So eventually I removed everything customizable from my ".vm" configu- > ration file and customized it instead. And then Vm worked as expected. > > Why is that? Do I have to use "defvar" rather than "setq" in my ".vm" > configuration file to mark these variables as dynamically bound? > > 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 ...)'. Do you refer to the fact that values are not evaluated before being stored in variables? If so, according to the documentation, you can set the third member to t to ask for evaluation "now". > 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. > > function "custom-set-variables" writes into my "custom.el" file, putting > a call to "custom-set-variables" together with the Vm specific customi- > zation directly into configuration file ".vm" is not expected to work. > custom-set-variables does not write anything, but it serves as the target for when the customize interface writes. I don't know if there would really be problems with having more than one block, except for not knowing where new customizations are written. Less hazardous, you can use customize-set-variable as a replacement for setq (but for only one variable) with the additional customize code. For users of use-package, the parameter :custom allows to customize variables from within the use-package macro, thus keeping them nicely sorted in the init file(s). This is what I personally do. Best wishes, Thibaut