all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Damien Cassou <damien@cassou.me>
Cc: Yuan Fu <casouri@gmail.com>, 72069@debbugs.gnu.org
Subject: bug#72069: [PATCH] Move configuration of auto-mode-alist out of js-ts-mode
Date: Wed, 24 Jul 2024 07:05:55 -0700	[thread overview]
Message-ID: <CADwFkmnUm17tEPnryO8U_1hTGSJvqRA+5K413uhLsLrFxosLTA@mail.gmail.com> (raw)
In-Reply-To: <87ed7zca8a.fsf@cassou.me> (Damien Cassou's message of "Fri, 12 Jul 2024 09:58:45 +0200")

Damien Cassou <damien@cassou.me> writes:

> The current version of the code requires the `js-ts-mode' function to
> have already been executed for `auto-mode-alist' to contain an entry for
> ".jsx" files. The patch makes sure that `auto-mode-alist' is updates
> when js.el is loaded.

Thanks for the patch.

What about js-mode?  Shouldn't that be used out-of-the-box for these files?

>>From 7fc9bb52a9f51a8caf4d5d016dc8a8812dd5c6a3 Mon Sep 17 00:00:00 2001
> From: Damien Cassou <damien@cassou.me>
> Date: Fri, 12 Jul 2024 09:50:45 +0200
> Subject: [PATCH] Move configuration of auto-mode-alist out of js-ts-mode
>
> * lisp/progmodes/js.el (js-ts-mode): Remove configuration of
> auto-mode-alist.
> ---
>  lisp/progmodes/js.el | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
> index f8140c14a49..c3e6077a352 100644
> --- a/lisp/progmodes/js.el
> +++ b/lisp/progmodes/js.el
> @@ -3957,10 +3957,10 @@ js-ts-mode
>                                          "method_definition")
>                                  eos)
>                     nil nil)))
> -    (treesit-major-mode-setup)
> +    (treesit-major-mode-setup)))
>
> -    (add-to-list 'auto-mode-alist
> -                 '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode))))
> +(add-to-list 'auto-mode-alist
> +             '("\\(\\.js[mx]\\|\\.har\\)\\'" . js-ts-mode))

Shouldn't this be wrapped in

    (if (treesit-ready-p js) ...)

?

>
>  (derived-mode-add-parents 'js-ts-mode '(js-mode))





  reply	other threads:[~2024-07-24 14:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-12  7:58 bug#72069: [PATCH] Move configuration of auto-mode-alist out of js-ts-mode Damien Cassou
2024-07-24 14:05 ` Stefan Kangas [this message]
2024-07-29 18:20   ` Damien Cassou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmnUm17tEPnryO8U_1hTGSJvqRA+5K413uhLsLrFxosLTA@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=72069@debbugs.gnu.org \
    --cc=casouri@gmail.com \
    --cc=damien@cassou.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.