GNU bug report logs - #69191
30.0.50; New var `major-mode-remap-defaults`, for packages

Previous Next

Package: emacs;

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

Date: Sun, 18 Feb 2024 18:22:04 UTC

Severity: normal

Found in version 30.0.50

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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Basil L. Contovounesios" <basil <at> contovou.net>
Cc: 69191 <at> debbugs.gnu.org
Subject: bug#69191: 30.0.50; New var `major-mode-remap-defaults`, for packages
Date: Sun, 03 Mar 2024 23:25:27 -0500
>> There are some FIXMEs that one might want to address, most importantly
>> whether we should use an indirection through `major-mode-remap-defaults`
>> for all TS modes or only for those for which we provide a non-TS mode.
>
> My gut says: we shouldn't add out-of-tree modes (e.g. go-mode) to
> auto-mode-alist (they should and already do that themselves); and so
> long as TS modes are viewed as an optional alternative, then they should
> be responsible for setting up major-mode-remap-defaults (so it should be
> a no-op if they remap from an out-of-tree mode that is not installed).

I like the idea of using `go-mode` as the canonical mode, even if we
don't provide it.  But I left this part unchanged for now.

>> +  (let ((mode
>> +         (if (save-excursion
>> +               (save-restriction
>> +                 (save-match-data       ; Why `save-match-data'?
>> +                   (widen)
>> +                   (goto-char (point-min))
>> +                   (re-search-forward c-ts-mode--c-or-c++-regexp nil t))))
>> +             'c++-ts-mode)
>> +         'c-ts-mode))
> I'm excited for this new let-syntax to catch on, but maybe as a separate
> feature request.

You think you're funny. eh?

>> -;;;###autoload (defalias 'TeX-mode #'tex-mode)
>> -;;;###autoload (defalias 'plain-TeX-mode #'plain-tex-mode)
>> -;;;###autoload (defalias 'LaTeX-mode #'latex-mode)
>> +;;;###autoload (add-to-list 'major-mode-remap-defaults '(TeX-mode . tex-mode))
>> +;;;###autoload (add-to-list 'major-mode-remap-defaults '(plain-TeX-mode . plain-tex-mode))
>> +;;;###autoload (add-to-list 'major-mode-remap-defaults '(LaTeX-mode . latex-mode))
>
> Can we really afford to lose the aliases in loaddefs.el?
> There are at least a few in-tree uses of the AUCTeX names.

Oops, indeed.  Hmm... too bad, it means we still have to keep those
aliases a while longer.


        Stefan





This bug report was last modified 1 year and 77 days ago.

Previous Next


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