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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 03 Jan 2023 22:21:05 +0200

> 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.