unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ikumi Keita <ikumi@ikumi.que.jp>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 58075@debbugs.gnu.org, Juri Linkov <juri@linkov.net>
Subject: bug#58075: Mapping file types to major modes
Date: Thu, 29 Sep 2022 13:58:58 +0900	[thread overview]
Message-ID: <75290.1664427538@localhost> (raw)
In-Reply-To: <jwvwn9ntoeg.fsf-monnier+emacs@gnu.org>

>>>>> Stefan Monnier <monnier@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





  reply	other threads:[~2022-09-29  4:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25 15:38 bug#58075: Mapping file types to major modes Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-26 11:26 ` Lars Ingebrigtsen
2022-09-26 12:13   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-27 12:54     ` Lars Ingebrigtsen
2022-10-03 15:18       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-10-03 15:18       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-28  8:15 ` Ikumi Keita
2022-09-28 17:29   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-29  4:58     ` Ikumi Keita [this message]
2022-09-29 12:18       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=75290.1664427538@localhost \
    --to=ikumi@ikumi.que.jp \
    --cc=58075@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).