Subject: Re: bug#60526: 29.0.60; javascript-mode → js-mode

From: Yuan Fu <[email-masked]>
Date: Tue, 3 Jan 2023 23:40:47 -0700

> On Jan 3, 2023, at 1:21 PM, Eli Zaretskii <[email-masked]> wrote:
> 
>> From: Juri Linkov <[email-masked]>
>> Date: Tue, 03 Jan 2023 20:12:38 +0200
>> 
>> 
>> It looks wrong to require from users to add mappings for both `js-mode'
>> and its alias `javascript-mode' to `major-mode-remap-alist':
>> 
>>  (add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode))
>>  (add-to-list 'major-mode-remap-alist '(javascript-mode . js-ts-mode))
>> 
>> Either `major-mode-remap-alist' could support aliases, or simpler
>> would be just to replace the alias in `auto-mode-alist':
>> 
>> diff --git a/lisp/files.el b/lisp/files.el
>> index c45c3d40a5d..2acc1d1df4a 100644
>> --- a/lisp/files.el
>> +++ b/lisp/files.el
>> @@ -2952,9 +2952,9 @@ auto-mode-alist
>>      ("\\.dbk\\'" . xml-mode)
>>      ("\\.dtd\\'" . sgml-mode)
>>      ("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
>> -     ("\\.js[mx]?\\'" . javascript-mode)
>> +     ("\\.js[mx]?\\'" . js-mode)
>>      ;; https://en.wikipedia.org/wiki/.har
>> -     ("\\.har\\'" . javascript-mode)
>> +     ("\\.har\\'" . js-mode)
>>      ("\\.json\\'" . js-json-mode)
>>      ("\\.[ds]?va?h?\\'" . verilog-mode)
>>      ("\\.by\\'" . bovine-grammar-mode)
> 
> This is basically a no-brainer, but we had javascript-mode there for
> quite some time, and it's too late to change that for Emacs 29.
> Please install on master.

I thought auto-mode-alist should use the canonical name and major-mode-remap-alist maps the canonical name to the actual mode. Why do we need 

>> (add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode))

if auto-mode-alist uses javascript-mode?

Yuan