From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ikumi Keita Newsgroups: gmane.emacs.bugs Subject: bug#58075: Mapping file types to major modes Date: Thu, 29 Sep 2022 13:58:58 +0900 Message-ID: <75290.1664427538@localhost> References: <69055.1664352943@localhost> 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="7585"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58075@debbugs.gnu.org, Juri Linkov To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 29 07:00:38 2022 Return-path: Envelope-to: geb-bug-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 1odlf4-0001mf-1f for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 07:00:38 +0200 Original-Received: from localhost ([::1]:48664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odlew-0006xe-7f for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Sep 2022 01:00:30 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odleW-0006xV-N0 for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 01:00:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odleU-00017m-E2 for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 01:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odleU-0002hJ-5p for bug-gnu-emacs@gnu.org; Thu, 29 Sep 2022 01:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ikumi Keita Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 29 Sep 2022 05:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58075 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 58075-submit@debbugs.gnu.org id=B58075.166442754810279 (code B ref 58075); Thu, 29 Sep 2022 05:00:02 +0000 Original-Received: (at 58075) by debbugs.gnu.org; 29 Sep 2022 04:59:08 +0000 Original-Received: from localhost ([127.0.0.1]:35604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odldb-0002fi-K1 for submit@debbugs.gnu.org; Thu, 29 Sep 2022 00:59:07 -0400 Original-Received: from smtp1a.inetd.co.jp ([210.129.88.11]:58238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odldX-0002fU-TR for 58075@debbugs.gnu.org; Thu, 29 Sep 2022 00:59:06 -0400 Original-Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 8BC032DA; Thu, 29 Sep 2022 13:59:01 +0900 (JST) In-reply-to: Comments: In-reply-to Stefan Monnier message dated "Wed, 28 Sep 2022 13:29:57 -0400." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243865 Archived-At: >>>>> Stefan Monnier writes: > To work "properly", `site-start.el` would need to change the *default* > definition of the var (which Custom stores in the `standard-value` > property), and then ask Custom to re-evaluate the var's value. > Emacs *should* provide some convenient way to do that, but Someone=E2=84= =A2 > needs to code it up. >> I briefly skimmed over info documents of Emacs and Elisp, but could not >> find a description whether a site admin is allowed or not to alter the >> value of user customize variable in site-start.el (not default.el, of >> course). > It's allowed and very common in practice (e.g. to > set `send-mail-function` or `smtpmail-smtp-server`). > But doing it will tend to cause the problems mentioned above. Thank you. Then AUCTeX would do just add-to-list at initialize when `major-mode-remap-alist' is available. > Using `defvar` instead of `defcustom` wouldn't really help tho: the user > still would not be able to configure it via Custom. I personally don't feel that defcustom is much suitable for this kind of configuration variable, i.e. an alist which may be given site-wide default values by site admins. Suppose that a user who prefers built-in TeX modes customized `major-mode-remap-alist' via Custom to invalidate site-wide default TeX modes and the site admin adds an entry (perl-mode . cperl-mode) later. Then the user doesn't see the new site-wide default perl mode. I have an impression that it's always suitable to use `add-to-list' and `delete' (or `assq'+`delq') to manipulate such alists. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine