From unknown Sat Aug 09 09:34:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58075 <58075@debbugs.gnu.org> To: bug#58075 <58075@debbugs.gnu.org> Subject: Status: Mapping file types to major modes Reply-To: bug#58075 <58075@debbugs.gnu.org> Date: Sat, 09 Aug 2025 16:34:04 +0000 retitle 58075 Mapping file types to major modes reassign 58075 emacs submitter 58075 Stefan Monnier severity 58075 normal tag 58075 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 25 11:38:49 2022 Received: (at submit) by debbugs.gnu.org; 25 Sep 2022 15:38:49 +0000 Received: from localhost ([127.0.0.1]:48368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocTiT-0002eP-0X for submit@debbugs.gnu.org; Sun, 25 Sep 2022 11:38:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:47764) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocTiP-0002eF-Mj for submit@debbugs.gnu.org; Sun, 25 Sep 2022 11:38:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocTiN-0000D7-K2 for bug-gnu-emacs@gnu.org; Sun, 25 Sep 2022 11:38:43 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47355) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocTiK-0008Pg-Iw for bug-gnu-emacs@gnu.org; Sun, 25 Sep 2022 11:38:42 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 890E2100154; Sun, 25 Sep 2022 11:38:38 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id BB29110002F; Sun, 25 Sep 2022 11:38:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664120309; bh=IbnjYF7I8aVN2sv8eFFZjPytTBU6I/FO/l+ZDIRQ/hE=; h=From:To:Subject:Date:From; b=P4ZXKdtBOnoeS1gmUY4yxUyocQKyqWQ9DfLNLYLpfqfICuvKcjR+Um/algp6Ybo3D Zlw/51uU04rFDmz5tW8rxD6nk6J9+QAMNFt3/6Cv9XlLXV1TS8xeuGXTKsM+LgTdUe do759APQYItnzPd4Xhe2aFBbkIT4OVvWbjliQdRrrRNekNWs6a1BLUBPC0G6hGXHea 2KFT4pgbWZHq30rDz8U1YqRZu5Zqi70nsuzppOWPsawq9AWLWJkKDhf9P0sSHqt3ao tIm2X2fCGZ/Fd6kaKg/Tem8oVQBGrIbszU9jUgVHXuE5ntZA83vVusgzJVSbNdTnEp tttrwG6zIunJQ== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 97086120623; Sun, 25 Sep 2022 11:38:29 -0400 (EDT) From: Stefan Monnier To: bug-gnu-emacs@gnu.org Subject: Mapping file types to major modes Message-ID: X-debbugs-Cc: Juri Linkov , Ikumi Keita Date: Sun, 25 Sep 2022 11:38:28 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.116 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain Tags: patch [ I now see that I had sent this to `emacs-devel` rather than as a bug report, so here is the second try. To make up for it, I include a suggested patch this time. ] Emacs has various facilities to decide which major mode to use for which file based on its name and/or contents. All those facilities specify directly the mode to use. This is usually exactly what we want because there's only ever 1 major mode for that type. But for some file types this is inconvenient because there are various alternative major modes that can be used for that file type. I'm thinking of things like Perl files (`perl-mode` vs `cperl-mode`), LaTeX files (`latex-mode` vs AUCTeX's equivalent (whose name it not clear, sadly)), HTML files (lots of alternatives), ... We have various ways to deal with those different cases, which are variously convenient/successful, but for things like `cperl-mode` vs `perl-mode` or `latex-mode` vs AUCTeX the usual solution is not satisfactory since it looks like: (defalias 'perl-mode #'cperl-mode) or equivalent, which means that the "other" mode becomes unavailable, which is particularly problematic if we want the "fancy/external" mode to be a derived mode of the other. (AUCTeX now does it via advising which at least makes it reversible, but it's still not very satisfactory). The way I tend to think of it is that we'd like to divide the mode choice into two steps: A) recognize the file type (a bit like `/etc/mime.types`). B) choose the mode to use for that type (like `/etc/mailcap`). We don't current have "types" and retro-fitting that might make the common case (where there's only 1 mode) more painful. IOW it would take work and lead to a worse result in the most common case, which doesn't sound very enticing. So instead I suggest consider the current settings as being our implementation of (A), and add (B) as some "mode remapping" layer to decide which major mode to actually for a given "type/mode". So instead of (defalias 'perl-mode #'cperl-mode) We could have (add-to-list 'major-mode-remap-alist '(perl-mode . cperl-mode)) -- Stefan In GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw3d scroll bars) of 2022-09-16 built on pastel Repository revision: c15a53877a7db7aa3205cff3c943321ed81a1412 Repository branch: work Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Debian GNU/Linux 11 (bullseye) Configured using: 'configure -C --enable-checking --enable-check-lisp-object-type --with-modules --with-cairo --with-tiff=ifavailable 'CFLAGS=-Wall -g3 -Og -Wno-pointer-sign' PKG_CONFIG_PATH=/home/monnier/lib/pkgconfig' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=major-mode-remap.patch diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi index c348130807c..56b779f8de6 100644 --- a/doc/emacs/modes.texi +++ b/doc/emacs/modes.texi @@ -454,6 +454,13 @@ Choosing Modes files, HTML/XML/SGML files, PostScript files, and Unix style Conf files. +@vindex major-mode-remap-alist + Once a major mode is found, Emacs does a final check to see if the +mode has been remapped by @code{major-mode-remap-alist}, in which case +it uses the remapped mode instead. This is used when several +different major modes can be used for the same file type, so you can +specify which mode you prefer. + @findex normal-mode If you have changed the major mode of a buffer, you can return to the major mode Emacs would have chosen automatically, by typing diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 983dfe2ec59..8e34fdf3640 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2476,11 +2476,11 @@ Declare Form expander will call @var{expander} with that form as well as with @var{args}@dots{}, and @var{expander} can either return a new expression to use instead of the function call, or it can return just the form unchanged, -to indicate that the function call should be left alone. @var{expander} can -be a symbol, or it can be a form @code{(lambda (@var{arg}) @var{body})} in -which case @var{arg} will hold the original function call expression, and the -(unevaluated) arguments to the function can be accessed using the function's -formal arguments. +to indicate that the function call should be left alone. + +To avoid syntactic redundancy, when @var{expander} is of the form +@code{(lambda (@var{arg}) @var{body})} the function's formal arguments +are automatically added to the lambda's list of arguments. @item (gv-expander @var{expander}) Declare @var{expander} to be the function to handle calls to the macro (or diff --git a/etc/NEWS b/etc/NEWS index 0a5b7bc29c5..02b4ef97583 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -442,6 +442,15 @@ option) and can be set to nil to disable Just-in-time Lock mode. * Changes in Emacs 29.1 ++++ +** New variable 'major-mode-remap-alist' to specify your favorite major modes. +This variable lets you remap the default modes (e.g. 'perl-mode' or +'latex-mode') to your favorite ones (e.g. 'cperl-mode' or +'LaTeX-mode') without having to use 'defalias', which can have +undesirable side effects. +This applies to all modes specified via 'auto-mode-alist', file-local +variables, etc... + --- ** Emacs now supports Unicode Standard version 15.0. diff --git a/lisp/files.el b/lisp/files.el index 1e1ec6127de..939d734a83d 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3331,6 +3331,7 @@ set-auto-mode matches the buffer beginning against `magic-mode-alist', compares the file name against the entries in `auto-mode-alist', then matches the buffer beginning against `magic-fallback-mode-alist'. +It also obeys `major-mode-remap-alist'. If `enable-local-variables' is nil, or if the file name matches `inhibit-local-variables-regexps', this function does not check @@ -3468,6 +3469,17 @@ set-auto-mode (unless done (set-buffer-major-mode (current-buffer))))) +(defvar-local set-auto-mode--last nil + "Remember the mode we have set via `set-auto-mode-0'.") + +(defcustom major-mode-remap-alist nil + "Alist mapping file-specified mode to actual mode. +Every entry is of the form (MODE . FUNCTION) which means that in order +to activate the major mode MODE (specified via something like +`auto-mode-alist', file-local variables, ...) we should actually call +FUNCTION instead." + :type '(alist (symbol) (function))) + ;; When `keep-mode-if-same' is set, we are working on behalf of ;; set-visited-file-name. In that case, if the major mode specified is the ;; same one we already have, don't actually reset it. We don't want to lose @@ -3478,10 +3490,15 @@ set-auto-mode-0 any aliases and compared to current major mode. If they are the same, do nothing and return nil." (unless (and keep-mode-if-same - (eq (indirect-function mode) - (indirect-function major-mode))) + (or (eq (indirect-function mode) + (indirect-function major-mode)) + (and set-auto-mode--last + (eq mode (car set-auto-mode--last)) + (eq major-mode (cdr set-auto-mode--last))))) (when mode - (funcall mode) + (funcall (alist-get mode major-mode-remap-alist mode)) + (unless (eq mode major-mode) + (setq set-auto-mode--last (cons mode major-mode))) mode))) (defvar file-auto-mode-skip "^\\(#!\\|'\\\\\"\\)" @@ -3511,7 +3528,8 @@ set-auto-mode-1 ;; interpreter invocation. The same holds ;; for '\" in man pages (preprocessor ;; magic for the `man' program). - (and (looking-at file-auto-mode-skip) 2)) t) + (and (looking-at file-auto-mode-skip) 2)) + t) (progn (skip-chars-forward " \t") (setq beg (point)) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index fa428642fa4..20a73e238e9 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -632,7 +632,7 @@ cperl-tips If your Emacs does not default to `cperl-mode' on Perl files, and you want it to: put the following into your .emacs file: - (defalias \\='perl-mode \\='cperl-mode) + (add-to-list \\='major-mode-remap-alist \\='(perl-mode . cperl-mode)) Get perl5-info from $CPAN/doc/manual/info/perl5-old/perl5-info.tar.gz --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 26 07:27:06 2022 Received: (at 58075) by debbugs.gnu.org; 26 Sep 2022 11:27:06 +0000 Received: from localhost ([127.0.0.1]:49475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocmGQ-0002CK-1a for submit@debbugs.gnu.org; Mon, 26 Sep 2022 07:27:06 -0400 Received: from quimby.gnus.org ([95.216.78.240]:40252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocmGN-0002Bg-Ge for 58075@debbugs.gnu.org; Mon, 26 Sep 2022 07:27:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=tiXtVxcj6CnHLExe0q2W1OPjksbQnPruSd0FxaVZRjA=; b=EVE/qbAqnOVm4f/rbh/y6rllhy QMs10wAbVAypxZjji3Rtc3CjSkDwF3zYSDMX22oA5vmg0Iu24giRWD96vkwUSGqhDDM1v7MGGzyaq oE/zhqLhvqrBf73oDWoTT00Jou28CqejPf28rDkY7jYWcNBQi8aIGEdXCAXr+ChkgQyo=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ocmG9-0007SC-Ey; Mon, 26 Sep 2022 13:26:51 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#58075: Mapping file types to major modes In-Reply-To: (Stefan Monnier's message of "Sun, 25 Sep 2022 11:38:28 -0400") References: X-Now-Playing: Fire Escape's _Abandon Head_: "Let's All Escape" Date: Mon, 26 Sep 2022 13:26:48 +0200 Message-ID: <87a66m8jgn.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > We have various ways to deal with those different cases, which are > variously convenient/successful, but for things like `cperl-mode` vs > `perl-mode` or `latex-mode` vs AUCTeX the usual solution i [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58075 Cc: Ikumi Keita , 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: > We have various ways to deal with those different cases, which are > variously convenient/successful, but for things like `cperl-mode` vs > `perl-mode` or `latex-mode` vs AUCTeX the usual solution is not > satisfactory since it looks like: > > (defalias 'perl-mode #'cperl-mode) Isn't the usual solution to just make `auto-mode-alist' map .pl to cperl-mode instead of perl-mode? Hm, well, that's ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) so it's a bit of a mouthful. > We could have > > (add-to-list 'major-mode-remap-alist '(perl-mode . cperl-mode)) This area is already pretty complicated, so I worry that this is going to make things even more confusing. But perhaps it's worth it? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 26 08:13:46 2022 Received: (at 58075) by debbugs.gnu.org; 26 Sep 2022 12:13:46 +0000 Received: from localhost ([127.0.0.1]:49531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocmza-0001WE-8l for submit@debbugs.gnu.org; Mon, 26 Sep 2022 08:13:46 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:38775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ocmzW-0001Vy-Mr for 58075@debbugs.gnu.org; Mon, 26 Sep 2022 08:13:44 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D738A440A2C; Mon, 26 Sep 2022 08:13:36 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 855964409D6; Mon, 26 Sep 2022 08:13:35 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664194415; bh=bushpqo398InIz6+ZOOkFE1KJ0uKVZF6si4UC4usBAY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=GO6a+wnWgOYqXakE6E9xRdjGbxOQCgZ6jkkXB9WAunG7+bFuW17MnkCg2IE0RrsEK 1mqojp3Tgax1rJRx5fjj4Tl0xrFZu0ZcV8VlpHJdKLprxh59Zu4tutX7pxoFqNZneY 1JicyP7X4vVd7Rlqn4BSnQxYCpFNLvEGV9rD4Sl9L8+dbPa0GB8REgnC0pQVfyZKJf fD+ER+sJZxzyI/hMTU8Q0VvzYzhaHal/LGydJeJ8D7KcuXwy+tQYXR6hZ97TSeL7he OcuECjeBEk1CSLminoKGnjidQoWxaa+szlfea2xdAOli7bAJz4E5ExLyH6PO8q+FE4 v/hAjMAmgRIbw== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 4A1A9120816; Mon, 26 Sep 2022 08:13:35 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#58075: Mapping file types to major modes In-Reply-To: <87a66m8jgn.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 26 Sep 2022 13:26:48 +0200") Message-ID: References: <87a66m8jgn.fsf@gnus.org> Date: Mon, 26 Sep 2022 08:13:34 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.074 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58075 Cc: Ikumi Keita , 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen [2022-09-26 13:26:48] wrote: > Stefan Monnier writes: >> We have various ways to deal with those different cases, which are >> variously convenient/successful, but for things like `cperl-mode` vs >> `perl-mode` or `latex-mode` vs AUCTeX the usual solution is not >> satisfactory since it looks like: >> >> (defalias 'perl-mode #'cperl-mode) > > Isn't the usual solution to just make `auto-mode-alist' map .pl to > cperl-mode instead of perl-mode? > > Hm, well, that's > > ("\\.\\([pP]\\([Llm]\\|erl\\|od\\)\\|al\\)\\'" . perl-mode) > > so it's a bit of a mouthful. And that doesn't account for the files where the mode is found by `interpreter-mode-list`, by `mode:` cookies, etc... Stefan From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 27 08:55:30 2022 Received: (at 58075) by debbugs.gnu.org; 27 Sep 2022 12:55:30 +0000 Received: from localhost ([127.0.0.1]:53352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odA7H-0001o7-EO for submit@debbugs.gnu.org; Tue, 27 Sep 2022 08:55:30 -0400 Received: from quimby.gnus.org ([95.216.78.240]:52298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odA7F-0001nq-Ep for 58075@debbugs.gnu.org; Tue, 27 Sep 2022 08:55:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nEf/O9lCnbFaPd58jEUoZmp81wWOXI2BbSBaJMWQMv8=; b=Zegw+C0GQynSvgVrl/hNDMbL8f fzgftc4zNM+jNp326XWKau2lHsmzLaG9O0FxFaF/C1D8jtnkGQVX4pU1GxHDdX41aiELXIc2ITE9z AHp2xocNoaiOy6Hzf3gPXBI3XLSiunyot6SOt/+PQgh55rmjbUSKclgUXHl9a3IXpF38=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odA73-0001wa-2T; Tue, 27 Sep 2022 14:55:03 +0200 From: Lars Ingebrigtsen To: Stefan Monnier Subject: Re: bug#58075: Mapping file types to major modes In-Reply-To: (Stefan Monnier's message of "Mon, 26 Sep 2022 08:13:34 -0400") References: <87a66m8jgn.fsf@gnus.org> X-Now-Playing: Simon & Garfunkel's _Bookends_: "Bookends Theme" Date: Tue, 27 Sep 2022 14:54:59 +0200 Message-ID: <87ill92d0c.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Stefan Monnier writes: > And that doesn't account for the files where the mode is found by > `interpreter-mode-list`, by `mode:` cookies, etc... Yup. So I think your proposed patch makes a lot of sense, so feel free to push. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58075 Cc: Ikumi Keita , 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Stefan Monnier writes: > And that doesn't account for the files where the mode is found by > `interpreter-mode-list`, by `mode:` cookies, etc... Yup. So I think your proposed patch makes a lot of sense, so feel free to push. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 28 04:15:52 2022 Received: (at 58075) by debbugs.gnu.org; 28 Sep 2022 08:15:52 +0000 Received: from localhost ([127.0.0.1]:59828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odSES-0003Ee-4y for submit@debbugs.gnu.org; Wed, 28 Sep 2022 04:15:52 -0400 Received: from smtp1a.inetd.co.jp ([210.129.88.11]:55414) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odSEP-0003ET-20 for 58075@debbugs.gnu.org; Wed, 28 Sep 2022 04:15:51 -0400 Received: from localhost (42-144-46-173.rev.home.ne.jp [42.144.46.173]) by smtp1a.inetd.co.jp (Postfix) with ESMTPA id 5215D2E0; Wed, 28 Sep 2022 17:15:46 +0900 (JST) From: Ikumi Keita To: Stefan Monnier Subject: Re: bug#58075: Mapping file types to major modes In-reply-to: References: Comments: In-reply-to Stefan Monnier message dated "Sun, 25 Sep 2022 11:38:28 -0400." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.2 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <69052.1664352943.1@localhost> Date: Wed, 28 Sep 2022 17:15:43 +0900 Message-ID: <69055.1664352943@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58075 Cc: 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Stefan, >>>>> Stefan Monnier writes: > So instead I suggest consider the current settings as being our > implementation of (A), and add (B) as some "mode remapping" layer to > decide which major mode to actually for a given "type/mode". > So instead of > (defalias 'perl-mode #'cperl-mode) > We could have > (add-to-list 'major-mode-remap-alist '(perl-mode . cperl-mode)) In your proposed patch, `major-mode-remap-alist' is a user option defined by `defcustom'. Is it supposed to be legitimate that a site administrator sets up the default mapping for the site as > (add-to-list 'major-mode-remap-alist '(perl-mode . cperl-mode)) in site-start.el? Currently, a site admin can place AUCTeX activation code (load "auctex.el" nil t t) in site-start.el to prepare AUCTeX to be the site-wide default TeX mode. In auctex.el, (require 'tex-site) loads tex-site.el, which adds the :override advice for `latex-mode' etc. An individual user in that site who prefer built-in modes can get rid of AUCTeX by (unload-feature 'tex-site) in the user init file. That's the way that AUCTeX satisfy the preference of both site admins and individual users. 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). If it isn't allowed, I'd request to turn defcustom into defconst (or a similar facility for site admin to set up the site default mapping between (A) and (B)) so that AUCTeX can continue to satisfy both site admins and users without :override advice hack. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 28 13:30:08 2022 Received: (at 58075) by debbugs.gnu.org; 28 Sep 2022 17:30:08 +0000 Received: from localhost ([127.0.0.1]:34514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odasp-0006Jd-QH for submit@debbugs.gnu.org; Wed, 28 Sep 2022 13:30:08 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odaso-0006Hc-7G for 58075@debbugs.gnu.org; Wed, 28 Sep 2022 13:30:06 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B563A80799; Wed, 28 Sep 2022 13:29:59 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 147A1805B2; Wed, 28 Sep 2022 13:29:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664386198; bh=3XEDD3F3vVkGlIPltFqZOEdGp1CuOnMSX9+6U3zl8G0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=EQjjk/ZESZnkSo7/qDRzbauiS9mlUofTvHost+5k5vfpoUQXIL+DLD6/1X/KANyhh Po1FTPbX/111cZaMOP/VC2fST9G9ua+IB4tUacMxabsL/QyZHvxrVJELtucVlMcXRY BcxzhdUTFJgriAMzIcJkzmnwX2zb06ONhRztV4L7gY2NWQHMr9shF3Nv12SGBT01/T cawsFcHjyFDB1UowsR3B7XpPnHvTJnQujKm2KWk+yKkZZffjG3BkNopmaOrTtL+IMf Bf2++nET7KQFq2cRvtVxpsNl9+Lje/6bQS+isDryB3RyF1s4qB5vE8qjPW/tZspPGa QDFIDRU+pWZ+g== Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id EF300120DD5; Wed, 28 Sep 2022 13:29:57 -0400 (EDT) From: Stefan Monnier To: Ikumi Keita Subject: Re: bug#58075: Mapping file types to major modes In-Reply-To: <69055.1664352943@localhost> (Ikumi Keita's message of "Wed, 28 Sep 2022 17:15:43 +0900") Message-ID: References: <69055.1664352943@localhost> Date: Wed, 28 Sep 2022 13:29:57 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.181 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58075 Cc: 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ikumi Keita [2022-09-28 17:15:43] wrote: > Hi Stefan, >>>>>> Stefan Monnier writes: >> So instead I suggest consider the current settings as being our >> implementation of (A), and add (B) as some "mode remapping" layer to >> decide which major mode to actually for a given "type/mode". >> So instead of > >> (defalias 'perl-mode #'cperl-mode) > >> We could have > >> (add-to-list 'major-mode-remap-alist '(perl-mode . cperl-mode)) > > In your proposed patch, `major-mode-remap-alist' is a user option > defined by `defcustom'. > > Is it supposed to be legitimate that a site administrator sets up the > default mapping for the site as >> (add-to-list 'major-mode-remap-alist '(perl-mode . cperl-mode)) > in site-start.el? That's a somewhat general problem we have, indeed: if the `site-start.el` file uses `add-to-list` this way, then Custom will think the variable is "changed outside of Custom" and it will complain about it if the user then tries to configure the var via Custom. Using `defvar` instead of `defcustom` wouldn't really help tho: the user still would not be able to configure it via Custom. 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. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 29 00:59:07 2022 Received: (at 58075) by debbugs.gnu.org; 29 Sep 2022 04:59:08 +0000 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 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 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) From: Ikumi Keita To: Stefan Monnier Subject: Re: bug#58075: Mapping file types to major modes In-reply-to: References: <69055.1664352943@localhost> 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 29 Sep 2022 13:58:58 +0900 Message-ID: <75290.1664427538@localhost> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58075 Cc: 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>>>> 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 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 29 08:18:58 2022 Received: (at 58075) by debbugs.gnu.org; 29 Sep 2022 12:18:58 +0000 Received: from localhost ([127.0.0.1]:36504 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odsVF-0000ks-Tr for submit@debbugs.gnu.org; Thu, 29 Sep 2022 08:18:58 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odsVB-0000kb-9v for 58075@debbugs.gnu.org; Thu, 29 Sep 2022 08:18:56 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 624554420DF; Thu, 29 Sep 2022 08:18:46 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 179DF4420C5; Thu, 29 Sep 2022 08:18:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664453925; bh=g13E87Bs5rn/V8u163oj+A3mZM+qQR+rJhD2ORGomjY=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WNIY0ljNUPGNtVqlV/kLU84Ycdc5tWbn8WRsKI2C5PFYNRgUC6R/QUFbyUyNJNJAB hxfYEFDgWJwDPb1kNIGtJGLRZpgiotC8UKC2q3DluVtIstMxA2/UmmsZ7gWpgQWQQK CZG3uvIaBrU3uQ5C9+Ql80eDukZGOesyPXRKQEqBB+115rB58w5KovFay00HdSmD2L s/2ROCgBff7ilXZ2/mk5npV+xJ5xxiY0FqLEWlbM3WoVI36JamEyf9icvVi354Pwdw z0wMgdVHuLvcmjfFPFzXHGZTbKsolsCxHPkg6eTD1YeHJWocZfQlPGBKl1USGzmZrq eIq6acIqwefRQ== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DAE0D1208EF; Thu, 29 Sep 2022 08:18:44 -0400 (EDT) From: Stefan Monnier To: Ikumi Keita Subject: Re: bug#58075: Mapping file types to major modes In-Reply-To: <75290.1664427538@localhost> (Ikumi Keita's message of "Thu, 29 Sep 2022 13:58:58 +0900") Message-ID: References: <69055.1664352943@localhost> <75290.1664427538@localhost> Date: Thu, 29 Sep 2022 08:18:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.046 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58075 Cc: 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. Indeed, it's a long-standing problem that Customize doesn't let the user say "I want to add/remove " rather than "I want to set this list to ". Actually, strictly speaking it does, but noone bothered to make that work well. Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 03 11:18:24 2022 Received: (at 58075) by debbugs.gnu.org; 3 Oct 2022 15:18:24 +0000 Received: from localhost ([127.0.0.1]:51559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofND6-00015w-GK for submit@debbugs.gnu.org; Mon, 03 Oct 2022 11:18:24 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10901) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofND4-00015g-G7 for 58075@debbugs.gnu.org; Mon, 03 Oct 2022 11:18:23 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B267D80796; Mon, 3 Oct 2022 11:18:16 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2006380355; Mon, 3 Oct 2022 11:18:15 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664810295; bh=CHGM+h0apWpBbw0RbKXLLUOssnCKg8t6ASoMlKtLQCo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AcjMZkibGMkYnm+1tkUYqIFhL2ZfELx726UlyTHEa9jGlRRFCZ5u7D/6KyrDWZnl2 i7KoVxVSvucRpjyQMx2mXAQM9usBvdRYthrnZYW5TNzFD0w+E4FCV7nJ4trPQcIJPj k7Si3GmsPRmePr1nLZNHeWIgfmlsNskX99KZimnbW576eGdmpIvGDAEcli/3j5c61I 37X4dkKbtJWw2qrC0ke4N8h8qPf3v4lU3BptEtxC1J2gLe5pkydx4r9YINcaGTxAEX nLuf5v6dr0WuOKgwTFTF8MH1wh01W84TBTMJvjbSUfrhGz0BRmQQOscTMPmxJrE/h8 snQNPWOniQzFA== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id D1B03120AAA; Mon, 3 Oct 2022 11:18:14 -0400 (EDT) From: Stefan Monnier To: Lars Ingebrigtsen Subject: Re: bug#58075: Mapping file types to major modes In-Reply-To: <87ill92d0c.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 27 Sep 2022 14:54:59 +0200") Message-ID: References: <87a66m8jgn.fsf@gnus.org> <87ill92d0c.fsf@gnus.org> Date: Mon, 03 Oct 2022 11:18:13 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.142 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58075 Cc: Ikumi Keita , 58075@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen [2022-09-27 14:54:59] wrote: > Stefan Monnier writes: >> And that doesn't account for the files where the mode is found by >> `interpreter-mode-list`, by `mode:` cookies, etc... > Yup. So I think your proposed patch makes a lot of sense, so feel free > to push. Thanks, installed, Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 03 11:18:56 2022 Received: (at 58075-done) by debbugs.gnu.org; 3 Oct 2022 15:18:56 +0000 Received: from localhost ([127.0.0.1]:51563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofNDb-00016e-S3 for submit@debbugs.gnu.org; Mon, 03 Oct 2022 11:18:56 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:24603) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofNDa-00016S-Au for 58075-done@debbugs.gnu.org; Mon, 03 Oct 2022 11:18:54 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 10FB8100138; Mon, 3 Oct 2022 11:18:49 -0400 (EDT) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id B0FBE1000DD; Mon, 3 Oct 2022 11:18:47 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1664810327; bh=V/Atyc952oAirRexPUnzCsUuxlDLyzuf+sYKVyHnQog=; h=From:To:Subject:In-Reply-To:References:Date:From; b=onGP7OkSh/5u9reagdPxe0zlSSsKaMHh4sRtKwTuhCzhzk9By4lFbvqepOmgBcwo5 42bPoPw3f/9NBJ91s3LaeZs1K/jj4U/I26DoZPdHRhhs2mSRaNB/CN0lp6TYRmzgUM f/bmDuBM5Eatjbuu5xgo2Yx1pQ7lOpeF0/0AKdidacu164YJcFOSMIVtXGuyfq+Edq vTpxtjWXWsBxYYvpOb0C/WbJE2kXbKucncsHFNhqdoQCwv4uO2W+HNCFQwphbeQaSS ZddX6MIpLTR6xJlZK7AECOtuJ/fO27i7fQEDXBFYi/7nsZV3XKxz8wY64cEGeLsjpZ BCokqH6KIofAA== Received: from pastel (65-110-220-202.cpe.pppoe.ca [65.110.220.202]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 87407120BB8; Mon, 3 Oct 2022 11:18:47 -0400 (EDT) From: Stefan Monnier To: 58075-done@debbugs.gnu.org Subject: Re: bug#58075: Mapping file types to major modes In-Reply-To: <87ill92d0c.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 27 Sep 2022 14:54:59 +0200") Message-ID: References: <87a66m8jgn.fsf@gnus.org> <87ill92d0c.fsf@gnus.org> Date: Mon, 03 Oct 2022 11:18:45 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.755 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain PYZOR_CHECK 1.392 Listed in Pyzor (https://pyzor.readthedocs.io/en/latest/) X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58075-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Closing From unknown Sat Aug 09 09:34:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 01 Nov 2022 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator