unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dmitry@gutov.dev>
To: Stefan Monnier <monnier@iro.umontreal.ca>, Eli Zaretskii <eliz@gnu.org>
Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no,
	jostein@secure.kjonigsen.net, btuin@mailo.com,
	jostein@kjonigsen.net
Subject: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching
Date: Sat, 16 Sep 2023 23:05:35 +0300	[thread overview]
Message-ID: <476cebcf-68d9-254d-816c-54476046cf5e@gutov.dev> (raw)
In-Reply-To: <jwvjzsqtgwn.fsf-monnier+emacs@gnu.org>

On 16/09/2023 16:59, Stefan Monnier wrote:
>>> No problem, pushed that to emacs-29, thanks.
>> This seems to cause:
>>
>>      INFO     Scraping files for loaddefs...85%
>>    typescript-ts-mode:0: Warning: Not registering prefix "ts".  Affects: ("tsx-ts-mode--indent-compatibility-b893426" "tsx-ts-mode--font-lock-compatibility-bb1f97b" "tsx-ts--s-p-query" "tsx-ts--syntax-propertize" "ts-ts--s-p-query" "ts-ts--syntax-propertize" "ts-ts--syntax-propertize-captures")
>>
>> Stefan, what do we usually do with such warnings?
> We usually ignored them?
> [ They only affect the features controlled by
>    `help-enable-(completion-)autoload`.  ]
> 
> A better option, is to try and use fewer namespace prefixes.
> e.g. make sure all the definitions start with `ts-`, `ts-ts-`,
> `tsts-`, or somesuch (except for the autoloaded ones which can break
> that rule).
> 
> Maybe rename `typescript-ts-mode-*` to `ts-ts-mode-*` (and
> make `typescript-ts-mode` an alias of `ts-ts-mode`).

Thanks. I haven't seen the warnings myself, but I sorted the new 
addition into two existing prefixes in that file: typescript-ts and tsx-ts.

> diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
> index 7c85a7b6fe9..8c50b55535b 100644
> --- a/lisp/progmodes/typescript-ts-mode.el
> +++ b/lisp/progmodes/typescript-ts-mode.el
> @@ -87,7 +87,7 @@ tsx-ts-mode--indent-compatibility-b893426
>         (progn (treesit-query-capture 'tsx '((jsx_fragment) @capture))
>                `(((match "<" "jsx_fragment") parent 0)
>                  ((parent-is "jsx_fragment") parent typescript-ts-mode-indent-offset)))
> -    (error
> +    (error ;; FIXME: Use more precise error name.
>        `(((match "<" "jsx_text") parent 0)
>          ((parent-is "jsx_text") parent typescript-ts-mode-indent-offset)))))
>   
> @@ -414,8 +414,11 @@ typescript-ts-mode--sexp-nodes
>     "Nodes that designate sexps in TypeScript.
>   See `treesit-thing-settings' for more information.")
>   
> +;; FIXME: Do we really need to autoload this?
>   ;;;###autoload

Don't think so. Though I'm not sure if we should change that in emacs-29.

>   (define-derived-mode typescript-ts-base-mode prog-mode "TypeScript"
> +  ;; FIXME: This is the same docstring as `typescript-ts-mode',
> +  ;; we should document the difference here!
>     "Major mode for editing TypeScript."
>     :group 'typescript
>     :syntax-table typescript-ts-mode--syntax-table
> 

Fixed two other things on the release branch, seemed safe enough.





  reply	other threads:[~2023-09-16 20:05 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23  9:05 bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Augustin Chéneau
2023-08-23 13:23 ` Dmitry Gutov
2023-08-24  5:59   ` Eli Zaretskii
2023-08-24 19:31     ` Augustin Chéneau
2023-08-24 19:47     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-25  0:18       ` Dmitry Gutov
2023-08-25  5:30         ` Eli Zaretskii
2023-08-25  7:17         ` Augustin Chéneau
2023-08-26  1:52           ` Dmitry Gutov
2023-08-25  6:59       ` Jostein Kjønigsen
2023-08-25 18:27         ` Yuan Fu
2023-08-26  9:22           ` Jostein Kjønigsen
2023-08-26 15:29             ` Fu Yuan
2023-08-26 21:13               ` Jostein Kjønigsen
2023-08-26 21:45                 ` Dmitry Gutov
2023-08-31  9:41                   ` Eli Zaretskii
2023-08-31 11:15                     ` Dmitry Gutov
2023-08-31 12:53                       ` Eli Zaretskii
2023-09-01  1:42                         ` Dmitry Gutov
2023-09-05 19:31                           ` Jostein Kjønigsen
2023-09-07  8:59                             ` Eli Zaretskii
2023-09-07  9:02                               ` Stefan Kangas
2023-09-07 12:09                             ` Dmitry Gutov
2023-09-11 19:37                               ` Jostein Kjønigsen
2023-09-11 22:23                                 ` Dmitry Gutov
2023-09-12  6:29                                   ` Jostein Kjønigsen
2023-09-12 23:14                                     ` Dmitry Gutov
2023-09-15 12:11                                       ` Jostein Kjønigsen
2023-09-15 13:35                                         ` Dmitry Gutov
2023-09-16  5:54                                           ` Eli Zaretskii
2023-09-16 11:20                                             ` Eli Zaretskii
2023-09-16 11:40                                               ` Eli Zaretskii
2023-09-16 20:07                                                 ` Dmitry Gutov
2023-09-16 13:59                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-16 20:05                                               ` Dmitry Gutov [this message]
2023-09-17  5:22                                                 ` Eli Zaretskii
2023-09-01 15:45                       ` Augustin Chéneau
2023-09-01 15:58                         ` Eli Zaretskii
2023-09-01 19:21                         ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=476cebcf-68d9-254d-816c-54476046cf5e@gutov.dev \
    --to=dmitry@gutov.dev \
    --cc=65470@debbugs.gnu.org \
    --cc=btuin@mailo.com \
    --cc=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=jostein@kjonigsen.net \
    --cc=jostein@secure.kjonigsen.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=theo@thornhill.no \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).