From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: Is there a way of setting a variable only when it exists? Date: Tue, 15 Mar 2022 11:12:05 +0300 Message-ID: References: <87lexdul8e.fsf@mbork.pl> <878rtcir1h.fsf@zoho.eu> <87a6drviwp.fsf@mbork.pl> <878rtbveu1.fsf@mbork.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10235"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.0 (2022-02-12) Cc: help-gnu-emacs@gnu.org, Emanuel Berg To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 15 09:18:51 2022 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 1nU2OJ-0002Rv-Ca for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 09:18:51 +0100 Original-Received: from localhost ([::1]:50332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nU2OH-00017Y-W1 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 15 Mar 2022 04:18:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:46572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU2NV-00013J-JU for help-gnu-emacs@gnu.org; Tue, 15 Mar 2022 04:18:01 -0400 Original-Received: from stw1.rcdrun.com ([217.170.207.13]:44081) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nU2NT-0000Hy-OH for help-gnu-emacs@gnu.org; Tue, 15 Mar 2022 04:18:01 -0400 Original-Received: from localhost ([::ffff:197.239.5.202]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000005BF04.0000000062304BB4.00003014; Tue, 15 Mar 2022 01:17:56 -0700 Mail-Followup-To: Marcin Borkowski , Emanuel Berg , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <878rtbveu1.fsf@mbork.pl> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Xref: news.gmane.io gmane.emacs.help:136572 Archived-At: * Marcin Borkowski [2022-03-15 10:45]: > > On 2022-03-15, at 07:58, Jean Louis wrote: > > > * Marcin Borkowski [2022-03-15 09:28]: > >> What if it's an internal Emacs variable which might become a user option > >> one day (I submitted a bug report about it) and then my customization > >> silently disappears? It's the "silently" part I want to guard > >> against... > > > > I am trying to understand: > > > > - what is user option? > > It is defined in the Emacs manual. ,---- | User Option | A user option is a face (q.v.) or a variable (q.v.) that exists so | that you can customize Emacs by setting it to a new value. *Note | Easy Customization::. `---- Definition in glossary is incomplete, as one can fully understand it only by reading Easy Customization: > 49.1 Easy Customization Interface > ================================= > Emacs has many “settings” which you can change. Most settings are > “customizable variables” (*note Variables::), which are also called > “user options”. Thus what you mean are customizable variables. > > Now, if variable becomes in future "user option" most probably your > > settings will still be kept in place, your customization will not > > silently disappear unless you delete it from your files. > > > > Did I understand it all well? > > No. If an internal variable (= one whose name contains two dashes) > becomes a user option, its name will most probably change. That is what you mean. That is harder to track. You would need to watch NEWS, manual and `git log' to track such changes. I am using database and I have some variables used in HTML templates where by column variables_name has its name and variables_value has the value. Though each variables has its unique ID. This enables the possibility to change the variables_name to anything else, and still retain the tracking to its original ID. Finding previous variable is obtained by using rudimentary database backed version control system. Though that is quite different concept, though very clear and well structured. Emacs does not have structured way to remember all variables ever defined so to track them, then to track their previous names and so on. One way to go would be by using recently included SQLite database in Emacs Development version. If every internal variable would get its unique ID in the SQLite database, then renaming variable would be very easy, and its tracking would become easier. Though it is a different concept that is not live yet. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/