GNU bug report logs - #58075
Mapping file types to major modes

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Sun, 25 Sep 2022 15:39:01 UTC

Severity: normal

Tags: patch

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ikumi Keita <ikumi <at> ikumi.que.jp>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 58075 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: bug#58075: Mapping file types to major modes
Date: Thu, 29 Sep 2022 13:58:58 +0900
>>>>> Stefan Monnier <monnier <at> iro.umontreal.ca> 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ā„¢
> 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




This bug report was last modified 2 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.