all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#60526: 29.0.60; javascript-mode → js-mode
@ 2023-01-03 18:12 Juri Linkov
  2023-01-03 20:21 ` Eli Zaretskii
  2023-01-08  1:39 ` Yuan Fu
  0 siblings, 2 replies; 7+ messages in thread
From: Juri Linkov @ 2023-01-03 18:12 UTC (permalink / raw)
  To: 60526

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

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':


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: javascript-ts-mode.patch --]
[-- Type: text/x-diff, Size: 571 bytes --]

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)

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* bug#60526: 29.0.60; javascript-mode → js-mode
  2023-01-03 18:12 bug#60526: 29.0.60; javascript-mode → js-mode Juri Linkov
@ 2023-01-03 20:21 ` Eli Zaretskii
  2023-01-04  6:40   ` Yuan Fu
  2023-01-08  1:39 ` Yuan Fu
  1 sibling, 1 reply; 7+ messages in thread
From: Eli Zaretskii @ 2023-01-03 20:21 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 60526

> From: Juri Linkov <juri@linkov.net>
> 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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#60526: 29.0.60; javascript-mode → js-mode
  2023-01-03 20:21 ` Eli Zaretskii
@ 2023-01-04  6:40   ` Yuan Fu
  2023-01-04  7:45     ` Juri Linkov
  0 siblings, 1 reply; 7+ messages in thread
From: Yuan Fu @ 2023-01-04  6:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 60526, Stefan Monnier, Juri Linkov



> On Jan 3, 2023, at 1:21 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Juri Linkov <juri@linkov.net>
>> 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




^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#60526: 29.0.60; javascript-mode → js-mode
  2023-01-04  6:40   ` Yuan Fu
@ 2023-01-04  7:45     ` Juri Linkov
  0 siblings, 0 replies; 7+ messages in thread
From: Juri Linkov @ 2023-01-04  7:45 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 60526, Eli Zaretskii, Stefan Monnier

>>> -     ("\\.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.

But the canonical name is js-mode, because javascript-mode is
an alias to js-mode.

> Why do we need
>
>>> (add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode))
>
> if auto-mode-alist uses javascript-mode?

This is needed for the case when users or packages customized
auto-mode-alist to use the name js-mode.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#60526: 29.0.60; javascript-mode →  js-mode
  2023-01-03 18:12 bug#60526: 29.0.60; javascript-mode → js-mode Juri Linkov
  2023-01-03 20:21 ` Eli Zaretskii
@ 2023-01-08  1:39 ` Yuan Fu
  2023-01-08  8:26   ` Juri Linkov
  2023-01-08 11:07   ` Dmitry Gutov
  1 sibling, 2 replies; 7+ messages in thread
From: Yuan Fu @ 2023-01-08  1:39 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 60526, Eli Zaretskii, monnier


Juri Linkov <juri@linkov.net> writes:

>>>> -     ("\\.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.
>
> But the canonical name is js-mode, because javascript-mode is
> an alias to js-mode.

js-mode feels more like "implementation name" to me. After all, the name
of the language is Javascript, not js. I think javascript-mode best
represents "major mode for javascript", not js-mode, if you get what I
mean.

>> Why do we need
>>
>>>> (add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode))
>>
>> if auto-mode-alist uses javascript-mode?
>
> This is needed for the case when users or packages customized
> auto-mode-alist to use the name js-mode.

If they customize auto-mode-alist to js-mode, I expect them to expect
Emacs to use js-mode by default, not the tree-sitter mode.

Yuan





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#60526: 29.0.60; javascript-mode → js-mode
  2023-01-08  1:39 ` Yuan Fu
@ 2023-01-08  8:26   ` Juri Linkov
  2023-01-08 11:07   ` Dmitry Gutov
  1 sibling, 0 replies; 7+ messages in thread
From: Juri Linkov @ 2023-01-08  8:26 UTC (permalink / raw)
  To: Yuan Fu; +Cc: 60526-done, Eli Zaretskii, monnier

> js-mode feels more like "implementation name" to me. After all, the name
> of the language is Javascript, not js. I think javascript-mode best
> represents "major mode for javascript", not js-mode, if you get what I
> mean.

Indeed, and the treesit module is named tree-sitter-javascript, not js.
So closing this report now.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#60526: 29.0.60; javascript-mode → js-mode
  2023-01-08  1:39 ` Yuan Fu
  2023-01-08  8:26   ` Juri Linkov
@ 2023-01-08 11:07   ` Dmitry Gutov
  1 sibling, 0 replies; 7+ messages in thread
From: Dmitry Gutov @ 2023-01-08 11:07 UTC (permalink / raw)
  To: Yuan Fu, Juri Linkov; +Cc: 60526, Eli Zaretskii, monnier

On 08/01/2023 03:39, Yuan Fu wrote:
> Juri Linkov<juri@linkov.net>  writes:
> 
>>>>> -     ("\\.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.
>> But the canonical name is js-mode, because javascript-mode is
>> an alias to js-mode.
> js-mode feels more like "implementation name" to me. After all, the name
> of the language is Javascript, not js. I think javascript-mode best
> represents "major mode for javascript", not js-mode, if you get what I
> mean.
> 

javascript-mode was the name of a different mode. js-mode was a later 
rewrite of it.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-01-08 11:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-03 18:12 bug#60526: 29.0.60; javascript-mode → js-mode Juri Linkov
2023-01-03 20:21 ` Eli Zaretskii
2023-01-04  6:40   ` Yuan Fu
2023-01-04  7:45     ` Juri Linkov
2023-01-08  1:39 ` Yuan Fu
2023-01-08  8:26   ` Juri Linkov
2023-01-08 11:07   ` Dmitry Gutov

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.