From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 07:15:21 2023 Received: (at submit) by debbugs.gnu.org; 23 Aug 2023 11:15:21 +0000 Received: from localhost ([127.0.0.1]:33004 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYlpW-0005hi-KX for submit@debbugs.gnu.org; Wed, 23 Aug 2023 07:15:21 -0400 Received: from lists.gnu.org ([2001:470:142::17]:44898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYjnx-00023c-LQ for submit@debbugs.gnu.org; Wed, 23 Aug 2023 05:05:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYjno-0000xX-Mj for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 05:05:24 -0400 Received: from msg-2.mailo.com ([213.182.54.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYjnl-0002Od-48 for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 05:05:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1692781517; bh=hZTEfLHqvMLrqWvPFYxD4CseFYg5eEnHDMjm1ghfxrU=; h=X-EA-Auth:Message-ID:Date:MIME-Version:To:Subject:From: Content-Type:Content-Transfer-Encoding; b=oGLtYIShmCZIrFv509J1c4/aUvjm9yUO6oaWzIKxuTGF6iodD3CMFjFQamqRCMV7R GgMxCGnrfnNypwRkqiAeGW0PtVLanuZn83vplYjSEtbiPzdWRhe6cD2L7IjM5AUHsI 2nOEjFyvJ3bPMHSqpUdAdqLJkYaEODpdGPMwFIIE= Received: by b221-3.in.mailobj.net [192.168.90.23] with ESMTP via ip-20.mailobj.net [213.182.54.20] Wed, 23 Aug 2023 11:05:17 +0200 (CEST) X-EA-Auth: t6ohUJYJWOpRT1Umgg6QS9FHBnrfouWBgmkcB3INN3UNQS0vam7ML8L6cu5aiBxf1Aj9cMl4iSzOgi6nMW0D6ifewE73uAal Message-ID: Date: Wed, 23 Aug 2023 11:05:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: bug-gnu-emacs@gnu.org Subject: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: fr, en-US From: =?UTF-8?Q?Augustin_Ch=C3=A9neau_=28BTuin=29?= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=213.182.54.12; envelope-from=btuin@mailo.com; helo=msg-2.mailo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 23 Aug 2023 07:15:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) With the mode js-ts-mode, matching tokens (such as '()', '[]') can be incorrectly paired by `show-paren-mode`. This is trivially reproducible with this simple example: (/foobar)/) The first parenthesis is matched with the second one, which is inside a regular expression pattern (between slashes), and the last one is not paired. The behavior should be the same as for string, the content of the regex pattern should have no influence on the structure of the code. The first parenthesis should match with the third one. Here, the first parenthesis is matched with the last one: ("foobar)") js-mode behaves correctly in both cases. In GNU Emacs 29.1.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-07-30 built on inspiron-5567 Repository revision: 0002d4f31666719c5e972ca65efffc70750db613 Repository branch: makepkg Windowing system distributor 'The X.Org Foundation', version 11.0.12302000 System Description: Arch Linux Configured using: 'configure --prefix=/opt --sysconfdir=/etc --libexecdir=/opt/lib --localstatedir=/var --mandir=/opt/share/man --with-gameuser=:games --with-modules --without-libotf --without-m17n-flt --without-gconf --with-native-compilation=yes --with-native-compilation=aot --with-xinput2 --with-x-toolkit=gtk3 --without-xaw3d --with-sound=no --with-tree-sitter --without-gpm --without-compress-install '--program-transform-name=s/\([ec]tags\)/\1.emacs/' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection' LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now PKG_CONFIG_PATH=/home/arch-aug/_opam/lib/pkgconfig 'CXXFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: fr_FR.UTF-8 locale-coding-system: utf-8-unix Major mode: Info Minor modes in effect: windmove-mode: t yas-global-mode: t yas-minor-mode: t delete-selection-mode: t global-subword-mode: t subword-mode: t save-place-mode: t smartparens-global-mode: t treemacs-filewatch-mode: t treemacs-follow-mode: t treemacs-git-mode: t treemacs-fringe-indicator-mode: t global-hl-line-mode: t editorconfig-mode: t drag-stuff-global-mode: t drag-stuff-mode: t doom-modeline-mode: t global-git-commit-mode: t magit-auto-revert-mode: t global-auto-revert-mode: t shell-dirtrack-mode: t server-mode: t adaptive-wrap-prefix-mode: t global-undo-tree-mode: t undo-tree-mode: t global-anzu-mode: t anzu-mode: t which-key-mode: t projectile-mode: t global-corfu-mode: t corfu-mode: t TeX-PDF-mode: t TeX-source-correlate-mode: t vertico-mode: t marginalia-mode: t override-global-mode: t straight-use-package-mode: t straight-package-neutering-mode: t savehist-mode: t global-display-line-numbers-mode: t display-line-numbers-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t isearch-fold-quotes-mode: t global-font-lock-mode: t font-lock-mode: t buffer-read-only: t size-indication-mode: t column-number-mode: t line-number-mode: t global-visual-line-mode: t visual-line-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/arch-aug/.config/emacs-neo/straight/build/transient/transient hides /opt/share/emacs/29.1.50/lisp/transient /home/arch-aug/.config/emacs-neo/straight/build/jsonrpc/jsonrpc hides /opt/share/emacs/29.1.50/lisp/jsonrpc /home/arch-aug/.config/emacs-neo/straight/build/external-completion/external-completion hides /opt/share/emacs/29.1.50/lisp/external-completion /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package hides /opt/share/emacs/29.1.50/lisp/use-package/use-package /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package-lint hides /opt/share/emacs/29.1.50/lisp/use-package/use-package-lint /home/arch-aug/.config/emacs-neo/straight/build/bind-key/bind-key hides /opt/share/emacs/29.1.50/lisp/use-package/bind-key /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package-diminish hides /opt/share/emacs/29.1.50/lisp/use-package/use-package-diminish /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package-jump hides /opt/share/emacs/29.1.50/lisp/use-package/use-package-jump /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package-core hides /opt/share/emacs/29.1.50/lisp/use-package/use-package-core /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package-bind-key hides /opt/share/emacs/29.1.50/lisp/use-package/use-package-bind-key /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package-delight hides /opt/share/emacs/29.1.50/lisp/use-package/use-package-delight /home/arch-aug/.config/emacs-neo/straight/build/use-package/use-package-ensure hides /opt/share/emacs/29.1.50/lisp/use-package/use-package-ensure /home/arch-aug/.config/emacs-neo/straight/build/xref/xref hides /opt/share/emacs/29.1.50/lisp/progmodes/xref /home/arch-aug/.config/emacs-neo/straight/build/project/project hides /opt/share/emacs/29.1.50/lisp/progmodes/project /home/arch-aug/.config/emacs-neo/straight/build/flymake/flymake hides /opt/share/emacs/29.1.50/lisp/progmodes/flymake /home/arch-aug/.config/emacs-neo/straight/build/eglot/eglot hides /opt/share/emacs/29.1.50/lisp/progmodes/eglot /home/arch-aug/.config/emacs-neo/straight/build/soap-client/soap-inspect hides /opt/share/emacs/29.1.50/lisp/net/soap-inspect /home/arch-aug/.config/emacs-neo/straight/build/soap-client/soap-client hides /opt/share/emacs/29.1.50/lisp/net/soap-client /home/arch-aug/.config/emacs-neo/straight/build/eldoc/eldoc hides /opt/share/emacs/29.1.50/lisp/emacs-lisp/eldoc /home/arch-aug/.config/emacs-neo/straight/build/let-alist/let-alist hides /opt/share/emacs/29.1.50/lisp/emacs-lisp/let-alist Features: (shadow sort mail-extr emacsbug cus-start windmove magit-extras magit-delta xterm-color dabbrev textutils cape combobulate combobulate-yaml combobulate-css combobulate-js-ts combobulate-python combobulate-html combobulate-ui combobulate-display combobulate-contrib combobulate-manipulation python combobulate-navigation combobulate-misc combobulate-interface combobulate-rules combobulate-settings tempo misearch multi-isearch noutline outline shortdoc vertico-directory js c-ts-common mule-util checkdoc doom-snippets doom-snippets-lib yasnippet rainbow-delimiters ws-butler delsel cap-words superword subword saveplace flex-mode jison-mode bison-mode cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs bison-mode-autoloads dired-x cmake-mode rst cmake-mode-autoloads utop utop-minor-mode tuareg tuareg-compat tuareg-opam caml-help find-file utop-autoloads flycheck-ocaml flycheck find-func flycheck-ocaml-autoloads merlin-eldoc-autoloads merlin-xref merlin-cap merlin caml-types merlin-autoloads dune dune-autoloads tuareg-autoloads caml-autoloads pkgbuild-mode tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat parse-time iso8601 sh-script smie executable pkgbuild-mode-autoloads geiser-guile info-look geiser-debug geiser-repl geiser-image geiser-capf geiser-doc geiser-menu geiser-autodoc geiser-edit etags fileloop generator geiser-completion geiser-eval geiser-connection tq geiser-syntax scheme geiser-impl help-fns radix-tree geiser-log geiser-popup view geiser-custom geiser-base geiser-guile-autoloads geiser geiser-autoloads lua-mode lua-mode-autoloads debbugs soap-client url-http url-auth url-gw nsm rng-xsd rng-dt rng-util xsd-regexp debbugs-autoloads soap-client-autoloads expand-region-autoloads jinx-autoloads smartparens loadhist smartparens-autoloads builder vc-git vc-dispatcher dir-var builder-autoloads treemacs treemacs-header-line treemacs-compatibility treemacs-mode treemacs-bookmarks treemacs-tags xref treemacs-interface treemacs-persistence treemacs-filewatch-mode treemacs-follow-mode treemacs-rendering treemacs-annotations treemacs-async treemacs-workspaces treemacs-dom treemacs-visuals treemacs-fringe-indicator treemacs-scope pulse color treemacs-faces treemacs-icons treemacs-themes treemacs-core-utils pfuture inline hl-line ht treemacs-logging treemacs-customization treemacs-macros treemacs-autoloads cfrs-autoloads posframe-autoloads ht-autoloads hydra-autoloads lv-autoloads pfuture-autoloads ace-window-autoloads avy-autoloads hare-mode-autoloads eglot-autoloads external-completion-autoloads jsonrpc-autoloads flymake-autoloads project-autoloads xref-autoloads eldoc-autoloads flycheck-autoloads let-alist-autoloads pkg-info-autoloads epl-autoloads vertico-search general general-autoloads combobulate-autoloads treesit editorconfig editorconfig-core editorconfig-core-handle editorconfig-fnmatch pcase editorconfig-autoloads ws-butler-autoloads bel-coloration rainbow-delimiters-autoloads drag-stuff drag-stuff-autoloads doom-modeline doom-modeline-segments doom-modeline-env doom-modeline-core shrink-path f f-shortdoc s doom-modeline-autoloads shrink-path-autoloads f-autoloads s-autoloads all-the-icons all-the-icons-faces data-material data-weathericons data-octicons data-fileicons data-faicons data-alltheicons all-the-icons-autoloads doom-themes-ext-org doom-themes-ext-treemacs doom-themes-ext-neotree doom-themes-ext-visual-bell face-remap doom-dracula-theme doom-themes doom-themes-base doom-themes-autoloads magit-delta-autoloads xterm-color-autoloads magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util url-handlers url-parse auth-source json map url-vars magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff-mode git-commit log-edit message sendmail mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor shell pcomplete server magit-mode transient magit-git magit-base magit-section format-spec eieio eieio-core dash magit-autoloads magit-section-autoloads git-commit-autoloads with-editor-autoloads transient-autoloads dash-autoloads consult-vertico consult recentf tree-widget wid-edit bookmark pp consult-autoloads adaptive-wrap adaptive-wrap-autoloads undo-tree diff queue undo-tree-autoloads queue-autoloads anzu anzu-autoloads which-key which-key-autoloads comp comp-cstr rx projectile lisp-mnt grep ibuf-ext ibuffer ibuffer-loaddefs projectile-autoloads doom-snippets-autoloads yasnippet-autoloads finder-inf cape-autoloads corfu corfu-autoloads auctex-latexmk advice latex latex-flymake flymake-proc flymake project byte-opt compile text-property-search comint ansi-osc ansi-color ring warnings icons thingatpt tex-ispell tex-style auctex-latexmk-autoloads tex dbus xml crm texmathp auctex-autoloads tex-site vertico vertico-autoloads marginalia compat edmacro kmacro marginalia-autoloads compat-autoloads use-package-bind-key bind-key easy-mmode orderless orderless-autoloads use-package-ensure use-package-autoloads info bind-key-autoloads straight-autoloads cl-seq cl-extra help-mode straight subr-x cl-macs gv use-package-core cl-loaddefs cl-lib bytecomp byte-compile savehist display-line-numbers elec-pair cus-load rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 855111 185665) (symbols 48 62979 2) (strings 32 199519 18907) (string-bytes 1 6782525) (vectors 16 90652) (vector-slots 8 2300969 313710) (floats 8 1625 1345) (intervals 56 20355 3201) (buffers 984 25)) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 23 09:23:32 2023 Received: (at 65470) by debbugs.gnu.org; 23 Aug 2023 13:23:32 +0000 Received: from localhost ([127.0.0.1]:33160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYnpc-0003Kv-72 for submit@debbugs.gnu.org; Wed, 23 Aug 2023 09:23:32 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:50919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYnpX-0003Ke-Bv for 65470@debbugs.gnu.org; Wed, 23 Aug 2023 09:23:30 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8EE1B320090B; Wed, 23 Aug 2023 09:23:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 23 Aug 2023 09:23:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1692796997; x=1692883397; bh=CunCNFwEt5zjFtQ0zEntLfQms3/PI8Q5zQ0 KYK/5G+s=; b=qBbRwtVWaU5PxeU/lkYchmbrptPdpGMwtSfon/GbK3XGhcb01cu Tzx5nkbiszfOMQTgSKL29GkzXRf/oXRFi8y6bq+rjt//7gp+SktWBP0RzvsWIie1 Z60IbedL4x/Y5F5WvfHEZCTzuTBtvwYbYhLaIGE7TbCVnKeTd6QEaG54GU8thuNC 2WqLkOY7sS8hzo8PaiVbdXuY4NZeOm9DGi/KZDlNfpZj3oTZB951NRQWQnAb2Nrk z1nGNpTym4vkcPJxOEZfHNkCisnGJifwR8OtpBRHFemZFPoNDtuAz5cKfmGgNOUn cVxbJLwpJXHm44awOBQOLk8o3tSFslaLwVw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1692796997; x= 1692883397; bh=CunCNFwEt5zjFtQ0zEntLfQms3/PI8Q5zQ0KYK/5G+s=; b=f WvZ0A713ar4JLqsWFgIOOSjf3mPym/22qLzlvMWbv48YS+qp01+2fz4utneAlTVM 3aQH0V1e0qOwFCwSKOZcvco1FG2LPDPJFrPrSznxmqjTDs+C/ixAjCNWoGIgBfA+ ufanTAEpj4AeyhWbh6qPNZIy9qHmPn6XMf5f1RRVZPh4hNH9GZtQJccH8S4Htljw 7LUecelyxD3RTohOweM5TNYym5NgsWLxkwOhQtAmzfS7a64SoFbXVmO1sycuERcL /nXzTM421BPWPzZz7EL4Y/bv2g3A8NKAk0pBoOaeHtY8/Rhrd6SKnA2oKaOWCzg0 bKdGNfuzS8Lmvl3UHo+fA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvgedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeefjeekvedvfeelfedufeevgeetvdevkeelvddtueetteefudefgfduieekffei leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 23 Aug 2023 09:23:15 -0400 (EDT) Message-ID: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> Date: Wed, 23 Aug 2023 16:23:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Augustin_Ch=c3=a9neau_=28BTuin=29?= , 65470@debbugs.gnu.org References: From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 65470 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) On 23/08/2023 12:05, Augustin Chéneau (BTuin) wrote: > > With the mode js-ts-mode, matching tokens (such as '()', '[]') can be > incorrectly paired by `show-paren-mode`. This is trivially reproducible > with this simple example: > > (/foobar)/) > > The first parenthesis is matched with the second one, which is inside a > regular expression pattern (between slashes), and the last one is not > paired. > > The behavior should be the same as for string, the content of the regex > pattern should have no influence on the structure of the code. The first > parenthesis should match with the third one. Here, the first parenthesis > is matched with the last one: > > ("foobar)") > > js-mode behaves correctly in both cases. Sounds like js-ts-mode also needs a syntax-propertize-function, similar to c-ts-mode, ruby-ts-mode and rust-ts-mode. Others (typescript-ts-mode?) probably need it as well, at least modes for those languages that have dedicated regexp or heredoc syntax. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 24 01:59:09 2023 Received: (at 65470) by debbugs.gnu.org; 24 Aug 2023 05:59:09 +0000 Received: from localhost ([127.0.0.1]:35938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ3N6-0007bw-Nz for submit@debbugs.gnu.org; Thu, 24 Aug 2023 01:59:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55218) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZ3N4-0007bQ-6w for 65470@debbugs.gnu.org; Thu, 24 Aug 2023 01:59:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZ3Mt-0001r0-AI; Thu, 24 Aug 2023 01:58:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=LDy0MiKgJzQP2NJ30060IGKYryoSAj3rS4FYykxSIMk=; b=Sik+H8Jg8ZKmnJShUEpP AEqNaD3R5xW1CA9kzbtQsmEE6cvs0UlEkOuGCAiZWt222zps3H7H/cewklnem70l3t7/GpGjZq1eQ CM/Aqjph01RUsBO9YU3VxEjx2wddKSCx9IballKkrLgSOQTP2gDuEMXBYq3qz30GFRMVz2fzlTEu2 28piszbqHX/QjT7XJhiyfvfCKg8u2igBVt6RfOoN5JEZByc81BdM4A1F4DsCeL/DNTjnAicKC1obk M9MFiC9spoLNTT/7kj+p0I5kZihU63cNUABkcTz4QCCsvKw6aH0lTr6WgaHQ8EUlsQAPaYR0+rfWd Ae/6wRowyvHjQg==; Date: Thu, 24 Aug 2023 08:59:17 +0300 Message-Id: <83fs49q8ui.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov , Theodor Thornhill , Jostein Kjonigsen , Yuan Fu In-Reply-To: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> (message from Dmitry Gutov on Wed, 23 Aug 2023 16:23:13 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, 65470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Wed, 23 Aug 2023 16:23:13 +0300 > From: Dmitry Gutov > > On 23/08/2023 12:05, Augustin Chéneau (BTuin) wrote: > > > > With the mode js-ts-mode, matching tokens (such as '()', '[]') can be > > incorrectly paired by `show-paren-mode`. This is trivially reproducible > > with this simple example: > > > > (/foobar)/) > > > > The first parenthesis is matched with the second one, which is inside a > > regular expression pattern (between slashes), and the last one is not > > paired. > > > > The behavior should be the same as for string, the content of the regex > > pattern should have no influence on the structure of the code. The first > > parenthesis should match with the third one. Here, the first parenthesis > > is matched with the last one: > > > > ("foobar)") > > > > js-mode behaves correctly in both cases. > > Sounds like js-ts-mode also needs a syntax-propertize-function, similar > to c-ts-mode, ruby-ts-mode and rust-ts-mode. > > Others (typescript-ts-mode?) probably need it as well, at least modes > for those languages that have dedicated regexp or heredoc syntax. Would someone please add syntax-propertize-function in modes that need it? I think this should be done on the emacs-29 branch. TIA From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 24 15:47:21 2023 Received: (at 65470) by debbugs.gnu.org; 24 Aug 2023 19:47:21 +0000 Received: from localhost ([127.0.0.1]:38662 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZGIa-0008Cw-Rl for submit@debbugs.gnu.org; Thu, 24 Aug 2023 15:47:21 -0400 Received: from out-46.mta0.migadu.com ([2001:41d0:1004:224b::2e]:37497) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZGIY-0008Cm-6q for 65470@debbugs.gnu.org; Thu, 24 Aug 2023 15:47:19 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1692906432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=abCURdZwye7kmxZMyBPg8VV6Ja8lA/wsguLCnFEpqUA=; b=1TV9re6C3NhQtc2HrSqAufbKbvDDyKOEvyX3Ij52m5eAglNF0z5dt2TUTn5p5dRZ/HVE9o XBHX2vCnWkmuyQt7ngzR7bnIbAeiJtHmv8mTNPfLqpDiZm7gBio1xs+CzDc7eLeJcYghZ+ 44WdmkUqYOkun1Xdv4bvl0BWgZSs9AplI7Wzler+8seS6KHp4/AVzobqrOicAfLDO99Ixz vpRNuTSrRQp6fFbqL8WNVxj1Q5ekygRbWS4MZ1AtsZ4qdbpJhgihHrzKVLfSWct6FBwf+7 0m3fufmpeVB2PLStVAab4QTr+Tv4miO7/1TH9pQSZWesPf0Yk/g+eenwyU+3Vg== From: Theodor Thornhill To: Eli Zaretskii , Dmitry Gutov , Jostein Kjonigsen , Yuan Fu Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching In-Reply-To: <83fs49q8ui.fsf@gnu.org> References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> Date: Thu, 24 Aug 2023 21:47:09 +0200 Message-ID: <87bkew6x4y.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, 65470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> Date: Wed, 23 Aug 2023 16:23:13 +0300 >> From: Dmitry Gutov >>=20 >> On 23/08/2023 12:05, Augustin Ch=C3=A9neau (BTuin) wrote: >> >=20 >> > With the mode js-ts-mode, matching tokens (such as '()', '[]') can be >> > incorrectly paired by `show-paren-mode`. This is trivially reproducible >> > with this simple example: >> >=20 >> > (/foobar)/) >> >=20 >> > The first parenthesis is matched with the second one, which is inside a >> > regular expression pattern (between slashes), and the last one is not >> > paired. >> >=20 >> > The behavior should be the same as for string, the content of the regex >> > pattern should have no influence on the structure of the code. The fir= st >> > parenthesis should match with the third one. Here, the first parenthes= is >> > is matched with the last one: >> >=20 >> > ("foobar)") >> >=20 >> > js-mode behaves correctly in both cases. >>=20 >> Sounds like js-ts-mode also needs a syntax-propertize-function, similar= =20 >> to c-ts-mode, ruby-ts-mode and rust-ts-mode. >>=20 >> Others (typescript-ts-mode?) probably need it as well, at least modes=20 >> for those languages that have dedicated regexp or heredoc syntax. > > Would someone please add syntax-propertize-function in modes that need > it? I think this should be done on the emacs-29 branch. > > TIA I'll add it to my list, but if someone will grab it that's fine, as I'm a little short on time the next couple of weeks :-( Theo From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 24 20:19:13 2023 Received: (at 65470) by debbugs.gnu.org; 25 Aug 2023 00:19:13 +0000 Received: from localhost ([127.0.0.1]:38827 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZKXg-0001ak-J2 for submit@debbugs.gnu.org; Thu, 24 Aug 2023 20:19:13 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZKXe-0001aV-DT for 65470@debbugs.gnu.org; Thu, 24 Aug 2023 20:19:11 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id CBA695C0276; Thu, 24 Aug 2023 20:19:00 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 24 Aug 2023 20:19:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1692922740; x=1693009140; bh=oZ S+mHjpeYXb2Wr7DDBY6nl9gNrcCOdQLFndJrOK3QI=; b=SbwDS5lQtznWBsrfLU bE1GqGjc9TKWZNQNzqShpXWt7kqf2bTY6xvDhexnm0wbWXa6ZeeOWKwLww8NpvjD ktqxYmCIoAsmihxlufswk3aQdZWuCp/3ok5LFTxxJw1OYkmv1Nw5eHii76jTPL6L 6VyYPQI37L7W0PcZA3PaIK4Wr0/UCE8sBdOF3eFzf1jDP8fhHocOGKqoJKF67Ybn rs03bJmNaOM6YFK8tnZHDF/73Afk0INUBpeaVXKYQXbvmujUvpbIC+tur+rGrmrT 7TX4WdAYuF2psqsIjeTX3qsbYIut3gCxsCcDyYrhg+NVDpVB8xHGa6gojQOUDomA pEjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1692922740; x=1693009140; bh=oZS+mHjpeYXb2 Wr7DDBY6nl9gNrcCOdQLFndJrOK3QI=; b=FqnuzwmFsrtneTCsqZvWz0upfJamS rkVV4yRtr84ZhlFlcalh7HmSSj3QaHZVl9z3pzFQ+qo2HWzgpRaWv8hMnnUjqaGu UGVEWLmwjLXgPMmhIwA0JwHPu+BAtAD5b+AQKbjM7z0xzawiFO+/OW2yeWKVJ+Le 3WsgQrHgD9T0aC8WMfF2pnI2qALii1Lzdxchm4R5Gdy+qZAY138petgDlkIFPpV5 Zm/hQ0HELA3IfnrbSvnmz8rhByPxR3PWo8zs5u+FSccd+y6djx+8sT5XOKv2h1jq XrYF4sBd/Y8X4m2e7stRgGIZK/SnUYhihT6SjEt+h3rENp2xXGASrNeoQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvjedgfedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeehteekgfetieeujeeuvddtvdelteffleejteduvdefffejieehheeuteffveei jeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Aug 2023 20:18:58 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------y7wmXBhAaJpiuERO0BijYQkc" Message-ID: <3f955b21-1394-a7bd-ed35-064d8731e751@gutov.dev> Date: Fri, 25 Aug 2023 03:18:54 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: Theodor Thornhill , Eli Zaretskii , Jostein Kjonigsen , Yuan Fu References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> <87bkew6x4y.fsf@thornhill.no> From: Dmitry Gutov In-Reply-To: <87bkew6x4y.fsf@thornhill.no> X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, 65470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) This is a multi-part message in MIME format. --------------y7wmXBhAaJpiuERO0BijYQkc Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 24/08/2023 22:47, Theodor Thornhill wrote: > Eli Zaretskii writes: > >>> Date: Wed, 23 Aug 2023 16:23:13 +0300 >>> From: Dmitry Gutov >>> >>> On 23/08/2023 12:05, Augustin Chéneau (BTuin) wrote: >>>> With the mode js-ts-mode, matching tokens (such as '()', '[]') can be >>>> incorrectly paired by `show-paren-mode`. This is trivially reproducible >>>> with this simple example: >>>> >>>> (/foobar)/) >>>> >>>> The first parenthesis is matched with the second one, which is inside a >>>> regular expression pattern (between slashes), and the last one is not >>>> paired. >>>> >>>> The behavior should be the same as for string, the content of the regex >>>> pattern should have no influence on the structure of the code. The first >>>> parenthesis should match with the third one. Here, the first parenthesis >>>> is matched with the last one: >>>> >>>> ("foobar)") >>>> >>>> js-mode behaves correctly in both cases. >>> Sounds like js-ts-mode also needs a syntax-propertize-function, similar >>> to c-ts-mode, ruby-ts-mode and rust-ts-mode. >>> >>> Others (typescript-ts-mode?) probably need it as well, at least modes >>> for those languages that have dedicated regexp or heredoc syntax. >> Would someone please add syntax-propertize-function in modes that need >> it? I think this should be done on the emacs-29 branch. >> >> TIA > I'll add it to my list, but if someone will grab it that's fine, as I'm > a little short on time the next couple of weeks 🙁 This one seems to work for js-ts-mode. typescript is a bit more fiddly (two separate modes, one with jsx and one without), but should be able to follow the similar pattern. --------------y7wmXBhAaJpiuERO0BijYQkc Content-Type: text/x-patch; charset=UTF-8; name="js-ts--syntax-propertize.diff" Content-Disposition: attachment; filename="js-ts--syntax-propertize.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL2pzLmVsIGIvbGlzcC9wcm9nbW9kZXMvanMu ZWwKaW5kZXggOWQyOTkwZTdiYzkuLjIzZmRjNTc1MzNkIDEwMDY0NAotLS0gYS9saXNwL3By b2dtb2Rlcy9qcy5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9qcy5lbApAQCAtMzgyOSw2ICsz ODI5LDcgQEAganMtdHMtbW9kZQogICAgICAgICAgICAgICAgIChhcHBlbmQgInt9KCk6Oyw8 Pi8iIGVsZWN0cmljLWluZGVudC1jaGFycykpIDtGSVhNRToganMyLW1vZGUgYWRkcyAiW10q Ii4KICAgICAoc2V0cS1sb2NhbCBlbGVjdHJpYy1sYXlvdXQtcnVsZXMKIAkgICAgICAgICco KD9cOyAuIGFmdGVyKSAoP1x7IC4gYWZ0ZXIpICg/XH0gLiBiZWZvcmUpKSkKKyAgICAoc2V0 cS1sb2NhbCBzeW50YXgtcHJvcGVydGl6ZS1mdW5jdGlvbiAjJ2pzLXRzLS1zeW50YXgtcHJv cGVydGl6ZSkKIAogICAgIDs7IFRyZWUtc2l0dGVyIHNldHVwLgogICAgICh0cmVlc2l0LXBh cnNlci1jcmVhdGUgJ2phdmFzY3JpcHQpCkBAIC0zODY0LDYgKzM4NjUsMjYgQEAganMtdHMt bW9kZQogICAgIChhZGQtdG8tbGlzdCAnYXV0by1tb2RlLWFsaXN0CiAgICAgICAgICAgICAg ICAgICcoIlxcKFxcLmpzW214XVxcfFxcLmhhclxcKVxcJyIgLiBqcy10cy1tb2RlKSkpKQog CisoZGVmdmFyIGpzLXRzLS1zLXAtcXVlcnkKKyAgKHdoZW4gKHRyZWVzaXQtYXZhaWxhYmxl LXApCisgICAgKHRyZWVzaXQtcXVlcnktY29tcGlsZSAnamF2YXNjcmlwdAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJygoKHJlZ2V4IHBhdHRlcm46IChyZWdleF9wYXR0ZXJuKSBA cmVnZXhwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh2YXJpYWJsZV9kZWNs YXJhdG9yIHZhbHVlOiAoanN4X2VsZW1lbnQpIEBqc3gpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoKGFzc2lnbm1lbnRfZXhwcmVzc2lvbiByaWdodDogKGpzeF9lbGVtZW50 KSBAanN4KSkpKSkpCisKKyhkZWZ1biBqcy10cy0tc3ludGF4LXByb3BlcnRpemUgKGJlZyBl bmQpCisgIChsZXQgKChjYXB0dXJlcyAodHJlZXNpdC1xdWVyeS1jYXB0dXJlICdqYXZhc2Ny aXB0IGpzLXRzLS1zLXAtcXVlcnkgYmVnIGVuZCkpKQorICAgIChwY2FzZS1kb2xpc3QgKGAo LG5hbWUgLiAsbm9kZSkgY2FwdHVyZXMpCisgICAgICAobGV0ICgoc3ludGF4IChwY2FzZS1l eGhhdXN0aXZlIG5hbWUKKyAgICAgICAgICAgICAgICAgICAgICAoJ3JlZ2V4cAorICAgICAg ICAgICAgICAgICAgICAgICAoc3RyaW5nLXRvLXN5bnRheCAiXCIvIikpCisgICAgICAgICAg ICAgICAgICAgICAgKCdqc3gKKyAgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy10by1z eW50YXggInwiKSkpKSkKKyAgICAgICAgKHB1dC10ZXh0LXByb3BlcnR5ICh0cmVlc2l0LW5v ZGUtc3RhcnQgbm9kZSkgKDErICh0cmVlc2l0LW5vZGUtc3RhcnQgbm9kZSkpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAnc3ludGF4LXRhYmxlIHN5bnRheCkKKyAgICAgICAgKHB1 dC10ZXh0LXByb3BlcnR5ICgxLSAodHJlZXNpdC1ub2RlLWVuZCBub2RlKSkgKHRyZWVzaXQt bm9kZS1lbmQgbm9kZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICdzeW50YXgtdGFi bGUgc3ludGF4KSkpKSkKKwogOzs7IyMjYXV0b2xvYWQKIChkZWZpbmUtZGVyaXZlZC1tb2Rl IGpzLWpzb24tbW9kZSBqcy1tb2RlICJKU09OIgogICAoc2V0cS1sb2NhbCBqcy1lbmFibGVk LWZyYW1ld29ya3MgbmlsKQo= --------------y7wmXBhAaJpiuERO0BijYQkc-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 25 01:15:27 2023 Received: (at 65470) by debbugs.gnu.org; 25 Aug 2023 05:15:27 +0000 Received: from localhost ([127.0.0.1]:38952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZPAM-0001MJ-Gr for submit@debbugs.gnu.org; Fri, 25 Aug 2023 01:15:27 -0400 Received: from msg-4.mailo.com ([213.182.54.15]:34064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZG3U-0007pi-UQ for 65470@debbugs.gnu.org; Thu, 24 Aug 2023 15:31:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1692905494; bh=NzSy0kcnLVQIuje99qBBpJ3yQ0ihLpK6fWQEXkD/XII=; h=X-EA-Auth:Content-Type:Message-ID:Date:MIME-Version:Subject:To: References:From:In-Reply-To; b=cRVSz9Pl3Wxt+CKN7DJEYvhCGeNGp9h5o5vxIdk5qpfuDbRAm2I279idC1RLEExXB GCs6RH2iicm2mqFjkEEOj1NYXjDy8swK7oy3zC0gPoY6KzKkVbV8eSqeuEme1HSOvP lTP7pnEHuegfbiANAT/9+160F5CouQps9Q8iQBgw= Received: by b221-5.in.mailobj.net [192.168.90.25] with ESMTP via ip-20.mailobj.net [213.182.54.20] Thu, 24 Aug 2023 21:31:34 +0200 (CEST) X-EA-Auth: k3jzLpl19CyczaY0/BlyogPP4ushjeiKqlp8F+Fa7p6PMhETt+gYj8XAUWUc+xyRYV2+Yd/F7XyrnbODZqIaos4rbOo8stE2 Content-Type: multipart/mixed; boundary="------------dA0Lg4D6NBzlL7A29INwz6k0" Message-ID: <2fbfdbf3-6062-49c3-bc48-eb5ab4817ab2@mailo.com> Date: Thu, 24 Aug 2023 21:31:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching To: 65470@debbugs.gnu.org References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> Content-Language: fr, en-US From: =?UTF-8?Q?Augustin_Ch=C3=A9neau_=28BTuin=29?= In-Reply-To: <83fs49q8ui.fsf@gnu.org> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65470 X-Mailman-Approved-At: Fri, 25 Aug 2023 01:15:25 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------dA0Lg4D6NBzlL7A29INwz6k0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit I have created a patch heavily inspired from ruby-ts-mode. It fixes the trivial examples and it works as expected in a more complex file. I'm not sure if the commit message is formatted properly. --------------dA0Lg4D6NBzlL7A29INwz6k0 Content-Type: text/x-patch; charset=UTF-8; name="0001-Apply-syntax-properties-to-regex-delimiters-in-js-ts.patch" Content-Disposition: attachment; filename*0="0001-Apply-syntax-properties-to-regex-delimiters-in-js-ts.pa"; filename*1="tch" Content-Transfer-Encoding: base64 RnJvbSBkN2JiN2E3N2E1NzAyNmYzODVjNDEzN2EyNTE5OWViMmEyYzE1NzY4IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBBdWd1c3RpbiBDaMOpbmVhdSA8YnR1aW5AbWFpbG8u Y29tPgpEYXRlOiBUaHUsIDI0IEF1ZyAyMDIzIDIxOjAwOjQ3ICswMjAwClN1YmplY3Q6IFtQ QVRDSF0gQXBwbHkgc3ludGF4IHByb3BlcnRpZXMgdG8gcmVnZXggZGVsaW1pdGVycyBpbiBq cy10cy1tb2RlCgpBZGQgYSBwcm9wZXJ0eSB0byByZWdleCBzbGFzaGVzIHRvIGF2b2lkIGlu Y29ycmVjdCBwYXJlbnRoZXNpcwpwYWlyaW5nIGJ5IHVzaW5nIGBzeW50YXgtcHJvcGVydGl6 ZS1mdW5jdGlvbmAgKEJ1ZyM2NTQ3MCkKKiBsaXNwL3Byb2dtb2Rlcy9qcy5lbDogYWRkIGEg bmV3IGZ1bmN0aW9uIHRvIGFwcGx5IHN5bnRheCBwcm9wZXJ0aWVzCi0tLQogbGlzcC9wcm9n bW9kZXMvanMuZWwgfCAyMCArKysrKysrKysrKysrKysrKysrKwogMSBmaWxlIGNoYW5nZWQs IDIwIGluc2VydGlvbnMoKykKCmRpZmYgLS1naXQgYS9saXNwL3Byb2dtb2Rlcy9qcy5lbCBi L2xpc3AvcHJvZ21vZGVzL2pzLmVsCmluZGV4IDlkMjk5MGU3YmM5Li5lZmRkZGZlYWRmNCAx MDA2NDQKLS0tIGEvbGlzcC9wcm9nbW9kZXMvanMuZWwKKysrIGIvbGlzcC9wcm9nbW9kZXMv anMuZWwKQEAgLTM3MTEsNiArMzcxMSwyMyBAQCBqcy0tdHJlZXNpdC12YWxpZC1pbWVudS1l bnRyeQogICAgICgibGV4aWNhbF9kZWNsYXJhdGlvbiIgKHRyZWVzaXQtbm9kZS10b3AtbGV2 ZWwgbm9kZSkpCiAgICAgKF8gdCkpKQogCisoZGVmdmFyIGpzLXRzLS1yZWdleC1xdWVyeQor ICAod2hlbiAodHJlZXNpdC1hdmFpbGFibGUtcCkKKyAgICAodHJlZXNpdC1xdWVyeS1jb21w aWxlICdqYXZhc2NyaXB0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAnKCgocmVnZXgg Ii8iIEByZWdleF9zbGFzaCkpKSkpKQorCisoZGVmdW4ganMtdHMtbW9kZS0tc3ludGF4LXBy b3BlcnRpemUgKGJlZyBlbmQpCisgICJBcHBseSBzeW50YXggcHJvcGVydGllcyB0byBzcGVj aWFsIGNoYXJhY3RlcnMgYmV0d2VlbiBCRUcgYW5kIEVORC4KKworQXBwbHkgc3ludGF4IHBy b3BlcnRpZXMgdG8gcmVnZXggZGVsaW1pdGVycyAoc2xhc2hlcykuIgorICAobGV0ICgoY2Fw dHVyZXMgKHRyZWVzaXQtcXVlcnktY2FwdHVyZSAnamF2YXNjcmlwdCBqcy10cy0tcmVnZXgt cXVlcnkgYmVnIGVuZCkpKQorICAgIChwY2FzZS1kb2xpc3QgKGAoLG5hbWUgLiAsbm9kZSkg Y2FwdHVyZXMpCisgICAgICAocGNhc2UtZXhoYXVzdGl2ZSBuYW1lCisJKCdyZWdleF9zbGFz aAorCSAocHV0LXRleHQtcHJvcGVydHkgKHRyZWVzaXQtbm9kZS1zdGFydCBub2RlKSAoMSsg KHRyZWVzaXQtbm9kZS1zdGFydCBub2RlKSkKKwkJCSAgICAnc3ludGF4LXRhYmxlCisJCQkg ICAgKHN0cmluZy10by1zeW50YXggIlwiLyIpKSkpKSkpCisKIDs7OyBNYWluIEZ1bmN0aW9u CiAKIDs7OyMjI2F1dG9sb2FkCkBAIC0zODUwLDYgKzM4NjcsOSBAQCBqcy10cy1tb2RlCiAg ICAgICAgICAgICAgICAgICAoIGFzc2lnbm1lbnQgY29uc3RhbnQgZXNjYXBlLXNlcXVlbmNl IGpzeCBudW1iZXIKICAgICAgICAgICAgICAgICAgICAgcGF0dGVybiBzdHJpbmctaW50ZXJw b2xhdGlvbikKICAgICAgICAgICAgICAgICAgICggYnJhY2tldCBkZWxpbWl0ZXIgZnVuY3Rp b24gb3BlcmF0b3IgcHJvcGVydHkpKSkKKyAgICA7OyBTeW50YXggdGFibGUKKyAgICAoc2V0 cS1sb2NhbCBzeW50YXgtcHJvcGVydGl6ZS1mdW5jdGlvbgorICAgICAgICAgICAgICAgICMn anMtdHMtbW9kZS0tc3ludGF4LXByb3BlcnRpemUpCiAgICAgOzsgSW1lbnUKICAgICAoc2V0 cS1sb2NhbCB0cmVlc2l0LXNpbXBsZS1pbWVudS1zZXR0aW5ncwogICAgICAgICAgICAgICAg IGAoKCJGdW5jdGlvbiIgIlxcYGZ1bmN0aW9uX2RlY2xhcmF0aW9uXFwnIiBuaWwgbmlsKQot LSAKMi40Mi4wCgo= --------------dA0Lg4D6NBzlL7A29INwz6k0-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 25 01:30:24 2023 Received: (at 65470) by debbugs.gnu.org; 25 Aug 2023 05:30:24 +0000 Received: from localhost ([127.0.0.1]:38978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZPOp-0001lc-KO for submit@debbugs.gnu.org; Fri, 25 Aug 2023 01:30:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZPOm-0001lM-Dc for 65470@debbugs.gnu.org; Fri, 25 Aug 2023 01:30:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZPOY-0008I8-NT; Fri, 25 Aug 2023 01:30:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=nDhAIrMpIY33u2A2RAM5YtHBoal1Jwgac/ae4GWuPvI=; b=PnzFiwSzTW8dy+9Xm0t4 /7bR7A9DrGtkidOcN3kt/IMWArQn3EEC8ECHN0/pNvohG5EfosLoY2f0EU/FTIwA4c911WvFbINUa mT+AHVMM4Ld9+CDavGngn+Ojyx5cmKPsu26JD/a7CrCtzxIc49R4cazC80dNFHj3snoqn8CCfJkX3 2Yfbq2q2Fc118jw/r3RwxYFUX6/eky4KGSf5pJ88o5lhnsn8COr+JkCzGryh9zmdRv6qlqPqF5rvq QN57ovZcP36qRPm1pC5ASXEBplYwDIxr/IY0D+yQGhDstEFqEf8z99t4w9vDkz/Tnmr4d+obxlTs0 bdjpn7uG2XrSWA==; Date: Fri, 25 Aug 2023 08:30:32 +0300 Message-Id: <834jknpu2v.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <3f955b21-1394-a7bd-ed35-064d8731e751@gutov.dev> (message from Dmitry Gutov on Fri, 25 Aug 2023 03:18:54 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> <87bkew6x4y.fsf@thornhill.no> <3f955b21-1394-a7bd-ed35-064d8731e751@gutov.dev> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, jostein@kjonigsen.net, casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 25 Aug 2023 03:18:54 +0300 > Cc: btuin@mailo.com, 65470@debbugs.gnu.org > From: Dmitry Gutov > > >>> Others (typescript-ts-mode?) probably need it as well, at least modes > >>> for those languages that have dedicated regexp or heredoc syntax. > >> Would someone please add syntax-propertize-function in modes that need > >> it? I think this should be done on the emacs-29 branch. > >> > >> TIA > > I'll add it to my list, but if someone will grab it that's fine, as I'm > > a little short on time the next couple of weeks 🙁 > > This one seems to work for js-ts-mode. > > typescript is a bit more fiddly (two separate modes, one with jsx and > one without), but should be able to follow the similar pattern. Thanks. If no issues are found with this within the next couple of days, please install on the emacs-29 branch. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 25 03:00:13 2023 Received: (at 65470) by debbugs.gnu.org; 25 Aug 2023 07:00:13 +0000 Received: from localhost ([127.0.0.1]:39097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZQnl-0004IA-4b for submit@debbugs.gnu.org; Fri, 25 Aug 2023 03:00:13 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:39065) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZQni-0004Gn-Go for 65470@debbugs.gnu.org; Fri, 25 Aug 2023 03:00:11 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id A6D673200B6A; Fri, 25 Aug 2023 02:59:59 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 25 Aug 2023 03:00:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1692946799; x=1693033199; bh=Xh Ey1sX6SKk46Lcv7SJmY7ODRLdVJwNVMuwbr5kcgSM=; b=rlqaYz1CWn0vayn63s FF+pWagmcqNhjvhHW7VEJvdtyLnATYNbfO5TtyuMDX+k9iVZcJp4uYund2Ej1jJU xkFdh0sVKW533KUJNOoJU/6/drMYY3ei4RsIti1545GghElF9auLnshenJhI7hF6 vu6Lugou8dMvwPQLsiKz/Sl2eNzp/Pk2jaU/Q5QRc5xdxHdzTXNTvRj7KQfC4PMd XreLF+NUCQFFdFvUEh58IIJmiVHkdKFhpmaakVpWT3n+vFpTwxXKIxkpD6KzqUzR wR17OhPQjlickuR9RoaIxdghSejb6xxShkZHzEeYNLmxQE0aO5G+Yz2GtQAqomp8 42+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1692946799; x=1693033199; bh=XhEy1sX6SKk46Lcv7SJmY7ODRLdVJwNVMuw br5kcgSM=; b=LbFgASjl7aqnzWh+dRjDznMHGCcmrq89hmmyIb8ZpCFIyyU5uZH +7HvkqC9vuwAmM3WM8ZrGGiJlDVhh3NgRD5AbeE3f/sPJzFp/RSAHUhq6dCv28gv 4QaVQxy3HSkH87paAFOQC8hSU7mP1xeoy/8VQnJW6+EcFSudKAg6TG3lx65yApTq rP5sfcTsQwmZEySJtgXQrkk4czlERNqsVNH5fIcokneMkccmhA6w+k7R1gJbb981 wvskRE3XSuqiSlomuL5Ebz5Y6b8LACCnHcxLJGqe/hehkvQHHU1O7Bze3U43VDPR babK/Qmd2R5CxTvuS5Afu14AwKWo4b1NzHA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvjedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtggfuhfgjffevgffkfhfvofesthhqmhdthhdtjeenucfhrhhomheplfho shhtvghinhcumfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjoh hnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepveeuffehieeltddtgedugeev feettdehleetteejvdeijefhvddtffdvudehhedtnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepjhhoshhtvghinhesshgvtghurhgvrdhkjhho nhhighhsvghnrdhnvght X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Aug 2023 02:59:57 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= In-Reply-To: <87bkew6x4y.fsf@thornhill.no> Date: Fri, 25 Aug 2023 08:59:49 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> <87bkew6x4y.fsf@thornhill.no> To: Theodor Thornhill X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Dmitry Gutov , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > On 24 Aug 2023, at 21:47, Theodor Thornhill wrote: >=20 > Eli Zaretskii writes: >=20 >>=20 >> Would someone please add syntax-propertize-function in modes that = need >> it? I think this should be done on the emacs-29 branch. >>=20 >> TIA >=20 > I'll add it to my list, but if someone will grab it that's fine, as = I'm > a little short on time the next couple of weeks :-( >=20 > Theo I=E2=80=99ve just been forced over to a Mac at work, and I can=E2=80=99t = (yet) for the life of me figure out how to build Emacs from source on = this platform. It seems Emacs is not picking up libraries I=E2=80=99ve = installed using homebrew? If anyone can help me get past this roadblock, I might be able to get a = patch going. (It=E2=80=99s a ARM-based Mac, if that matters.) =E2=80=94 Jostein= From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 25 03:17:27 2023 Received: (at 65470) by debbugs.gnu.org; 25 Aug 2023 07:17:27 +0000 Received: from localhost ([127.0.0.1]:39113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZR4Q-0004jZ-Jx for submit@debbugs.gnu.org; Fri, 25 Aug 2023 03:17:27 -0400 Received: from msg-2.mailo.com ([213.182.54.12]:52580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZR4N-0004jJ-2P for 65470@debbugs.gnu.org; Fri, 25 Aug 2023 03:17:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1692947828; bh=PqzvIJ4OSzmIlxWZ534rxmeuyTQqkiLhsf9M60KoSu0=; h=X-EA-Auth:Content-Type:Message-ID:Date:MIME-Version:Subject:To: References:From:Cc:In-Reply-To; b=MxzqMffYx9Dhqc70ibVvB+hqLRkK6zZO+1ZnhHwTpquNLX0t4wx52VdTT9DnTnLHZ B5Imt9LDb04YruUMA3mCwWNwEy0i+XcPOGBIo/FW5fdVfXAYS1awDxcgaMx/PGQ4Cq WaE7frcoKAsCEO7iY6cat77ledPBdyhlcvhMhYzA= Received: by b221-4.in.mailobj.net [192.168.90.24] with ESMTP via ip-20.mailobj.net [213.182.54.20] Fri, 25 Aug 2023 09:17:07 +0200 (CEST) X-EA-Auth: CdiMyfAu2d4AGr+SwLKn4rW4+x14Um1LUe6ZuItRWL3tDmVki3zDuTB/eWpHiO7ocBlNKObNKpTDkftOM+l6sXQ9dqEaBIxa Content-Type: multipart/mixed; boundary="------------1t7DedAiwq7MVMG8YRUu7fOa" Message-ID: <96820db7-cd69-43eb-81d6-3822312cd928@mailo.com> Date: Fri, 25 Aug 2023 09:17:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: fr, en-US To: Dmitry Gutov References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> <87bkew6x4y.fsf@thornhill.no> <3f955b21-1394-a7bd-ed35-064d8731e751@gutov.dev> From: =?UTF-8?Q?Augustin_Ch=C3=A9neau_=28BTuin=29?= In-Reply-To: <3f955b21-1394-a7bd-ed35-064d8731e751@gutov.dev> X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------1t7DedAiwq7MVMG8YRUu7fOa Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 25/08/2023 à 02:18, Dmitry Gutov a écrit : > On 24/08/2023 22:47, Theodor Thornhill wrote: >> Eli Zaretskii  writes: >> >>>> Date: Wed, 23 Aug 2023 16:23:13 +0300 >>>> From: Dmitry Gutov >>>> >>>> On 23/08/2023 12:05, Augustin Chéneau (BTuin) wrote: >>>>> With the mode js-ts-mode, matching tokens (such as '()', '[]') can be >>>>> incorrectly paired by `show-paren-mode`. This is trivially >>>>> reproducible >>>>> with this simple example: >>>>> >>>>> (/foobar)/) >>>>> >>>>> The first parenthesis is matched with the second one, which is >>>>> inside a >>>>> regular expression pattern (between slashes), and the last one is not >>>>> paired. >>>>> >>>>> The behavior should be the same as for string, the content of the >>>>> regex >>>>> pattern should have no influence on the structure of the code. The >>>>> first >>>>> parenthesis should match with the third one. Here, the first >>>>> parenthesis >>>>> is matched with the last one: >>>>> >>>>> ("foobar)") >>>>> >>>>> js-mode behaves correctly in both cases. >>>> Sounds like js-ts-mode also needs a syntax-propertize-function, similar >>>> to c-ts-mode, ruby-ts-mode and rust-ts-mode. >>>> >>>> Others (typescript-ts-mode?) probably need it as well, at least modes >>>> for those languages that have dedicated regexp or heredoc syntax. >>> Would someone please add syntax-propertize-function in modes that need >>> it?  I think this should be done on the emacs-29 branch. >>> >>> TIA >> I'll add it to my list, but if someone will grab it that's fine, as I'm >> a little short on time the next couple of weeks 🙁 > > This one seems to work for js-ts-mode. > > typescript is a bit more fiddly (two separate modes, one with jsx and > one without), but should be able to follow the similar pattern. Thanks for the patch, but I still have some issues. I believe that the START and END arguments of `put-text-property` are off by one. The attached modified patch seems to work better. --------------1t7DedAiwq7MVMG8YRUu7fOa Content-Type: text/x-patch; charset=UTF-8; name="js-ts--syntax-propertize-v2.diff" Content-Disposition: attachment; filename="js-ts--syntax-propertize-v2.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL2pzLmVsIGIvbGlzcC9wcm9nbW9kZXMvanMu ZWwKaW5kZXggOWQyOTkwZTdiYzkuLmE3NGY2N2Q0NDY2IDEwMDY0NAotLS0gYS9saXNwL3By b2dtb2Rlcy9qcy5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9qcy5lbApAQCAtMzgyOSw2ICsz ODI5LDcgQEAganMtdHMtbW9kZQogICAgICAgICAgICAgICAgIChhcHBlbmQgInt9KCk6Oyw8 Pi8iIGVsZWN0cmljLWluZGVudC1jaGFycykpIDtGSVhNRToganMyLW1vZGUgYWRkcyAiW10q Ii4KICAgICAoc2V0cS1sb2NhbCBlbGVjdHJpYy1sYXlvdXQtcnVsZXMKIAkgICAgICAgICco KD9cOyAuIGFmdGVyKSAoP1x7IC4gYWZ0ZXIpICg/XH0gLiBiZWZvcmUpKSkKKyAgICAoc2V0 cS1sb2NhbCBzeW50YXgtcHJvcGVydGl6ZS1mdW5jdGlvbiAjJ2pzLXRzLS1zeW50YXgtcHJv cGVydGl6ZSkKIAogICAgIDs7IFRyZWUtc2l0dGVyIHNldHVwLgogICAgICh0cmVlc2l0LXBh cnNlci1jcmVhdGUgJ2phdmFzY3JpcHQpCkBAIC0zODY0LDYgKzM4NjUsMjYgQEAganMtdHMt bW9kZQogICAgIChhZGQtdG8tbGlzdCAnYXV0by1tb2RlLWFsaXN0CiAgICAgICAgICAgICAg ICAgICcoIlxcKFxcLmpzW214XVxcfFxcLmhhclxcKVxcJyIgLiBqcy10cy1tb2RlKSkpKQog CisoZGVmdmFyIGpzLXRzLS1zLXAtcXVlcnkKKyAgKHdoZW4gKHRyZWVzaXQtYXZhaWxhYmxl LXApCisgICAgKHRyZWVzaXQtcXVlcnktY29tcGlsZSAnamF2YXNjcmlwdAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJygoKHJlZ2V4IHBhdHRlcm46IChyZWdleF9wYXR0ZXJuKSBA cmVnZXhwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh2YXJpYWJsZV9kZWNs YXJhdG9yIHZhbHVlOiAoanN4X2VsZW1lbnQpIEBqc3gpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoKGFzc2lnbm1lbnRfZXhwcmVzc2lvbiByaWdodDogKGpzeF9lbGVtZW50 KSBAanN4KSkpKSkpCisKKyhkZWZ1biBqcy10cy0tc3ludGF4LXByb3BlcnRpemUgKGJlZyBl bmQpCisgIChsZXQgKChjYXB0dXJlcyAodHJlZXNpdC1xdWVyeS1jYXB0dXJlICdqYXZhc2Ny aXB0IGpzLXRzLS1zLXAtcXVlcnkgYmVnIGVuZCkpKQorICAgIChwY2FzZS1kb2xpc3QgKGAo LG5hbWUgLiAsbm9kZSkgY2FwdHVyZXMpCisgICAgICAobGV0ICgoc3ludGF4IChwY2FzZS1l eGhhdXN0aXZlIG5hbWUKKyAgICAgICAgICAgICAgICAgICAgICAoJ3JlZ2V4cAorICAgICAg ICAgICAgICAgICAgICAgICAoc3RyaW5nLXRvLXN5bnRheCAiXCIvIikpCisgICAgICAgICAg ICAgICAgICAgICAgKCdqc3gKKyAgICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy10by1z eW50YXggInwiKSkpKSkKKyAgICAgICAgKHB1dC10ZXh0LXByb3BlcnR5ICgxLSAodHJlZXNp dC1ub2RlLXN0YXJ0IG5vZGUpKSAodHJlZXNpdC1ub2RlLXN0YXJ0IG5vZGUpCisgICAgICAg ICAgICAgICAgICAgICAgICAgICAnc3ludGF4LXRhYmxlIHN5bnRheCkKKyAgICAgICAgKHB1 dC10ZXh0LXByb3BlcnR5ICh0cmVlc2l0LW5vZGUtZW5kIG5vZGUpICgxKyAodHJlZXNpdC1u b2RlLWVuZCBub2RlKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICdzeW50YXgtdGFi bGUgc3ludGF4KSkpKSkKKwogOzs7IyMjYXV0b2xvYWQKIChkZWZpbmUtZGVyaXZlZC1tb2Rl IGpzLWpzb24tbW9kZSBqcy1tb2RlICJKU09OIgogICAoc2V0cS1sb2NhbCBqcy1lbmFibGVk LWZyYW1ld29ya3MgbmlsKQo= --------------1t7DedAiwq7MVMG8YRUu7fOa-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 25 14:28:16 2023 Received: (at 65470) by debbugs.gnu.org; 25 Aug 2023 18:28:16 +0000 Received: from localhost ([127.0.0.1]:41190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZbXc-0003ij-8w for submit@debbugs.gnu.org; Fri, 25 Aug 2023 14:28:16 -0400 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]:57596) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZbXZ-0003iV-5i for 65470@debbugs.gnu.org; Fri, 25 Aug 2023 14:28:15 -0400 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bee82fad0fso9548815ad.2 for <65470@debbugs.gnu.org>; Fri, 25 Aug 2023 11:28:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692988082; x=1693592882; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=hZySf0UolFzOz1W1q5kaaw9iQX0SRvHjV+rlbZhKvnU=; b=BXpRjk6eW7tbusvY0HIGS+pPHeDt649UkEofbzT+j5Sxmp4UEqWKHamg+rED19XViS m60GEQM3C+suTAeChIEU9CGKYfwZmUOFBJYOg5N3elpvNgeN3jqcuBy3jleBOMSe6KX3 bKbzEMIh+Trua6vVWlnCyZo947evT21AfbdnoBNG9Mqlu4/4x77q45hJi4QoP9L0ecHk NQ8MYSh6qfuVT7sOxGYzdvFRmYR1tQDoX5oR37PW/8NVMsBoSryQLLRjag4I2aHdvtrX tNGhh0o1STOyyGamFe6fy8sbql9jQiWVTZ+n/SUn/S/cQh5UOmfqEa+asKIJnY+ehKyn nKwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692988082; x=1693592882; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hZySf0UolFzOz1W1q5kaaw9iQX0SRvHjV+rlbZhKvnU=; b=FsNUSTddCRSL8dbR9PA4+NH2qrxOcq0gTgNYY5TJSZV2RSj/nSv7vRBAlb5I42Hr9Q ash1JjP+G46bJCz64bn16UBrGnT4GEixewXf8wuCRtTwphqJ0j9wdq1LqEI1jGmcybLZ iNiUm0Gs1hLUsPvZKnOfTil9Hy4CajBdG4nqCca5h15bnB+vbQSIKeYH7jJzQKcBPUEO wCzQFmBWG8ENCA0g0bkTtgg/4yxM+eLpOdkFu0kK3WJi5qJxGtz4b+58A/153t1MS3ou xljdlLjTheYQ8mJeW+8G8eBI9g6Nbuxplz/7lMKx1VI79QrlkrjjmKBAqb+fyRpfL7B1 7ZGw== X-Gm-Message-State: AOJu0YwLvzpBnY9NPDNm8A08Pf2eOFy3ae4Z3U1/GmPGe1Q3vE2bxIbq YlUWH/Z7cTSmUD7BmkFE5tg= X-Google-Smtp-Source: AGHT+IGV6d1WyVQ9Rwsrwy+NYXIfs5wKbUkhu74Jx3MPWXwRr4QWILaK9jlIMHZR2Bo5NpNRXUOz5g== X-Received: by 2002:a17:902:e842:b0:1b9:e972:134d with SMTP id t2-20020a170902e84200b001b9e972134dmr17511214plg.3.1692988082196; Fri, 25 Aug 2023 11:28:02 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id z1-20020a170903018100b001bdb167f6ebsm2065026plg.94.2023.08.25.11.28.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Aug 2023 11:28:01 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching From: Yuan Fu In-Reply-To: Date: Fri, 25 Aug 2023 11:27:50 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> <87bkew6x4y.fsf@thornhill.no> To: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org, Theodor Thornhill , Dmitry Gutov , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Aug 24, 2023, at 11:59 PM, Jostein Kj=C3=B8nigsen = wrote: >=20 >=20 >=20 >> On 24 Aug 2023, at 21:47, Theodor Thornhill = wrote: >>=20 >> Eli Zaretskii writes: >>=20 >>>=20 >>> Would someone please add syntax-propertize-function in modes that = need >>> it? I think this should be done on the emacs-29 branch. >>>=20 >>> TIA >>=20 >> I'll add it to my list, but if someone will grab it that's fine, as = I'm >> a little short on time the next couple of weeks :-( >>=20 >> Theo >=20 > I=E2=80=99ve just been forced over to a Mac at work, and I can=E2=80=99t= (yet) for the life of me figure out how to build Emacs from source on = this platform. It seems Emacs is not picking up libraries I=E2=80=99ve = installed using homebrew? >=20 > If anyone can help me get past this roadblock, I might be able to get = a patch going. (It=E2=80=99s a ARM-based Mac, if that matters.) It=E2=80=99s been quite a while since I needed to setup this, so I = don=E2=80=99t quite remember. But setting LD_LIBRARY_PATH (Homebrew=E2=80=99= s path) and PKG_CONFIG_PATH (/usr/local/lib/pkgconfig) should help the = build process and Emacs find the libraries. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 25 21:52:56 2023 Received: (at 65470) by debbugs.gnu.org; 26 Aug 2023 01:52:57 +0000 Received: from localhost ([127.0.0.1]:41275 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZiTw-0001Yc-GL for submit@debbugs.gnu.org; Fri, 25 Aug 2023 21:52:56 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:41239) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZiTr-0001YK-8v for 65470@debbugs.gnu.org; Fri, 25 Aug 2023 21:52:55 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 1782432008FE; Fri, 25 Aug 2023 21:52:40 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 25 Aug 2023 21:52:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1693014759; x=1693101159; bh=In 0XP+LxVh4hThl7kRAkDLsw7IQQAIBC36yhySPszrI=; b=HHg9D/U5PF/OVbSFgs 8Hi9K1EH7HC/qyrW5EoGBequ33MxXPvk0NF9mZGh1CQBOVfOAgYVeTbfRhvFViM0 RFjpMv8aUeGTo90PYRgPURA0cqhSN0eUXwsqHk4tBllgMSn6yGfrbdpC6ktTlggX aD5jLE5GoqpUerHvZE0m1968fTbFpik5mx5pg9+eWoem8bVrx+x/jrE7B3TOif10 N+eXwSzpE3PDXB93787bO7ssJaOTj8oM+z3pomx/8fySp97AiQuCAkdMvMlzqPRX +eSiMCB9pcuOm3vsuRJGqmcGZ1yfQg8DlQOm7VHGsToRW3U2vbOJw1T0C0NMns1G v2FQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1693014759; x=1693101159; bh=In0XP+LxVh4hT hl7kRAkDLsw7IQQAIBC36yhySPszrI=; b=fbHqVZVs0c2S6+JuaalVjzz7LLGGk wSm8ejIlpJIeVrw2ZsH9S3Hde+BuWA0XJf+qwzbcwa9FHKZWUIlrD7RDBOBYcxIz O/POrFRW8wUB+IEgkX9PUR6gSEliLwSuZgXl7gZ1jylZ/nzDnqdfdczJyRcdR+bE hI2KCveuschQaWV+UsLp3SzEj93uHEIV5OqOly6luu3QDUXdi3i20/L6E81J4OZW BQU9eOSIbFjQ9nlhR//waipG6IsgGMYtwXOKTo7Hy79UIgQygHHqCemvHECSwMvO GCJBiT6KVHjb9wZfSKFrMSbuyHw8bpQZgUZzeYgi5fPVx2L61O7e509HA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddvledghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesmhdtreertdefjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeehteekgfetieeujeeuvddtvdelteffleejteduvdefffejieehheeuteffveei jeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 25 Aug 2023 21:52:38 -0400 (EDT) Content-Type: multipart/mixed; boundary="------------XW08LNuRbxFN1IMT504okNIq" Message-ID: <8a95e29b-d75d-2e18-7ca6-9a90576b3942@gutov.dev> Date: Sat, 26 Aug 2023 04:52:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Augustin_Ch=c3=a9neau_=28BTuin=29?= References: <59d884e2-4190-7111-8a37-548eb5a2c732@gutov.dev> <83fs49q8ui.fsf@gnu.org> <87bkew6x4y.fsf@thornhill.no> <3f955b21-1394-a7bd-ed35-064d8731e751@gutov.dev> <96820db7-cd69-43eb-81d6-3822312cd928@mailo.com> From: Dmitry Gutov In-Reply-To: <96820db7-cd69-43eb-81d6-3822312cd928@mailo.com> X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) This is a multi-part message in MIME format. --------------XW08LNuRbxFN1IMT504okNIq Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Augustin! On 25/08/2023 10:17, Augustin Chéneau (BTuin) wrote: > Thanks for the patch, but I still have some issues. I believe that the > START and END arguments of `put-text-property` are off by one. The > attached modified patch seems to work better. Thanks for trying it out. Sorry about missing your first patch: apparently while it was the first time-wise, it was help up in moderation. Anyway, you make a good point about the case with the regexp: since I matched the pattern inside, the bounds of the node are off by one compared to the case with the jsx node. Your patch moves those bounds, but then they'll be wrong for the latter case. Here's an update which tries to handle both, but I guess if we add more node types later we'll just have to stop trying to handle them the same way (and do it closer to ruby-ts--syntax-propertize). Also added the new return_statement case for jsx. --------------XW08LNuRbxFN1IMT504okNIq Content-Type: text/x-patch; charset=UTF-8; name="js-ts--syntax-propertize-v2.diff" Content-Disposition: attachment; filename="js-ts--syntax-propertize-v2.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3AvcHJvZ21vZGVzL2pzLmVsIGIvbGlzcC9wcm9nbW9kZXMvanMu ZWwKaW5kZXggOWQyOTkwZTdiYzkuLjliNmRhNGVjMmZjIDEwMDY0NAotLS0gYS9saXNwL3By b2dtb2Rlcy9qcy5lbAorKysgYi9saXNwL3Byb2dtb2Rlcy9qcy5lbApAQCAtMzgyOSw2ICsz ODI5LDcgQEAganMtdHMtbW9kZQogICAgICAgICAgICAgICAgIChhcHBlbmQgInt9KCk6Oyw8 Pi8iIGVsZWN0cmljLWluZGVudC1jaGFycykpIDtGSVhNRToganMyLW1vZGUgYWRkcyAiW10q Ii4KICAgICAoc2V0cS1sb2NhbCBlbGVjdHJpYy1sYXlvdXQtcnVsZXMKIAkgICAgICAgICco KD9cOyAuIGFmdGVyKSAoP1x7IC4gYWZ0ZXIpICg/XH0gLiBiZWZvcmUpKSkKKyAgICAoc2V0 cS1sb2NhbCBzeW50YXgtcHJvcGVydGl6ZS1mdW5jdGlvbiAjJ2pzLXRzLS1zeW50YXgtcHJv cGVydGl6ZSkKIAogICAgIDs7IFRyZWUtc2l0dGVyIHNldHVwLgogICAgICh0cmVlc2l0LXBh cnNlci1jcmVhdGUgJ2phdmFzY3JpcHQpCkBAIC0zODY0LDYgKzM4NjUsMjkgQEAganMtdHMt bW9kZQogICAgIChhZGQtdG8tbGlzdCAnYXV0by1tb2RlLWFsaXN0CiAgICAgICAgICAgICAg ICAgICcoIlxcKFxcLmpzW214XVxcfFxcLmhhclxcKVxcJyIgLiBqcy10cy1tb2RlKSkpKQog CisoZGVmdmFyIGpzLXRzLS1zLXAtcXVlcnkKKyAgKHdoZW4gKHRyZWVzaXQtYXZhaWxhYmxl LXApCisgICAgKHRyZWVzaXQtcXVlcnktY29tcGlsZSAnamF2YXNjcmlwdAorICAgICAgICAg ICAgICAgICAgICAgICAgICAgJygoKHJlZ2V4IHBhdHRlcm46IChyZWdleF9wYXR0ZXJuKSBA cmVnZXhwKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCh2YXJpYWJsZV9kZWNs YXJhdG9yIHZhbHVlOiAoanN4X2VsZW1lbnQpIEBqc3gpKQorICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAoKGFzc2lnbm1lbnRfZXhwcmVzc2lvbiByaWdodDogKGpzeF9lbGVtZW50 KSBAanN4KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChyZXR1cm5fc3RhdGVt ZW50IChqc3hfZWxlbWVudCkgQGpzeCkpKSkpKQorCisoZGVmdW4ganMtdHMtLXN5bnRheC1w cm9wZXJ0aXplIChiZWcgZW5kKQorICAobGV0ICgoY2FwdHVyZXMgKHRyZWVzaXQtcXVlcnkt Y2FwdHVyZSAnamF2YXNjcmlwdCBqcy10cy0tcy1wLXF1ZXJ5IGJlZyBlbmQpKSkKKyAgICAo cGNhc2UtZG9saXN0IChgKCxuYW1lIC4gLG5vZGUpIGNhcHR1cmVzKQorICAgICAgKGxldCog KChucyAodHJlZXNpdC1ub2RlLXN0YXJ0IG5vZGUpKQorICAgICAgICAgICAgIChuZSAodHJl ZXNpdC1ub2RlLWVuZCBub2RlKSkKKyAgICAgICAgICAgICAoc3ludGF4IChwY2FzZS1leGhh dXN0aXZlIG5hbWUKKyAgICAgICAgICAgICAgICAgICAgICAgKCdyZWdleHAKKyAgICAgICAg ICAgICAgICAgICAgICAgIChjbC1kZWNmIG5zKQorICAgICAgICAgICAgICAgICAgICAgICAg KGNsLWluY2YgbmUpCisgICAgICAgICAgICAgICAgICAgICAgICAoc3RyaW5nLXRvLXN5bnRh eCAiXCIvIikpCisgICAgICAgICAgICAgICAgICAgICAgICgnanN4CisgICAgICAgICAgICAg ICAgICAgICAgICAoc3RyaW5nLXRvLXN5bnRheCAifCIpKSkpKQorICAgICAgICAocHV0LXRl eHQtcHJvcGVydHkgbnMgKDErIG5zKSAnc3ludGF4LXRhYmxlIHN5bnRheCkKKyAgICAgICAg KHB1dC10ZXh0LXByb3BlcnR5ICgxLSBuZSkgbmUgJ3N5bnRheC10YWJsZSBzeW50YXgpKSkp KQorCiA7OzsjIyNhdXRvbG9hZAogKGRlZmluZS1kZXJpdmVkLW1vZGUganMtanNvbi1tb2Rl IGpzLW1vZGUgIkpTT04iCiAgIChzZXRxLWxvY2FsIGpzLWVuYWJsZWQtZnJhbWV3b3JrcyBu aWwpCg== --------------XW08LNuRbxFN1IMT504okNIq-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 05:23:15 2023 Received: (at 65470) by debbugs.gnu.org; 26 Aug 2023 09:23:15 +0000 Received: from localhost ([127.0.0.1]:41759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZpVe-0000nB-TA for submit@debbugs.gnu.org; Sat, 26 Aug 2023 05:23:14 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:40261) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZpVY-0000ke-QU for 65470@debbugs.gnu.org; Sat, 26 Aug 2023 05:23:08 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1ED635C0371; Sat, 26 Aug 2023 05:22:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 26 Aug 2023 05:22:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1693041774; x=1693128174; bh=Sh x9VMjP3wwlaBBs1kHg/Fltb0q3Hide52InLrPqCmk=; b=u+X1+i6WA6/67vNBzO BhGjeYfS0pGmPp1FJXGI9ytQoipDl/8bJwdWF75Os3fR3W2zD+XHLVSATvEA6eXI LMBt1mao464VkPSR2UXYrXQKl9ADngPEml4SVgw/Q6LCndrZgvjAAsedBNxrnlY/ 1weLTE5ngOc9UKdcczhMs1rDm6LJuHorjnpFCHuqOlqv00VTCr/8NGlwjNyUzGxh pBKr+HzSKVGtsSnGmfR9IwVQJKlwwfnB23E2bcQLThGVAt8LzAxXYRhrNBHxQlOD rLPcNiIOwNnUGsoBm2eYsxnogvupPomPTIfnilgG16s4Av9WssuTKrSpn4ZC71lc qwzA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693041774; x=1693128174; bh=Shx9VMjP3wwlaBBs1kHg/Fltb0q3Hide52I nLrPqCmk=; b=kMJqqQ8w3jpQOEVk/b3qcaAlW3xsZ+aXqMh+CLK0MNRO1mm/fY8 7epnnFv1j//H44S8dr5VDHDfGZ1hDg21vM0vHFtp8tKIWTJRF7JRp7/msxq41O3Q qDlylAh2BZ6uOtRlBP8+53zGBCcVOcIsjYXl4DU1CENCa5bGT383yXmvn4PvjoY2 F4IpjkB3BW39KCbCE913u+WgE2ANatsgfSx5XGGD+nzSI/eyLv7QN5DbfYZmTBdh xGiA8fCuAiBAsoxyuQYHdB0p2lJpL+qZf3NcrvusCzGSugZqEc5CwLhPTc5FPjKM 8Nk8sJJuNw01B/BHhkxMh0E1NnA/d4TXPiA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeftddgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfghfggufffkfhfvegjvffosehtqhhmtdhhtdejnecuhfhrohhmpeflohhs thgvihhnucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonh highhsvghnrdhnvghtqeenucggtffrrghtthgvrhhnpedviedtfeduteevgefhgeeffffh ueeltdetveehkeekudfhjeeihfevffefudegtdenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhn ihhgshgvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Aug 2023 05:22:53 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Mime-Version: 1.0 (1.0) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Sat, 26 Aug 2023 11:22:39 +0200 Message-Id: References: In-Reply-To: To: Yuan Fu X-Mailer: iPhone Mail (20G75) X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org, Theodor Thornhill , Dmitry Gutov , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > On 25 Aug 2023, at 20:28, Yuan Fu wrote: >=20 > =EF=BB=BF >=20 >>> On Aug 24, 2023, at 11:59 PM, Jostein Kj=C3=B8nigsen wrote: >>>=20 >>>=20 >>>=20 >>>> On 24 Aug 2023, at 21:47, Theodor Thornhill wrote: >>>=20 >>> Eli Zaretskii writes: >>>=20 >>>>=20 >>>> Would someone please add syntax-propertize-function in modes that need >>>> it? I think this should be done on the emacs-29 branch. >>>>=20 >>>> TIA >>>=20 >>> I'll add it to my list, but if someone will grab it that's fine, as I'm >>> a little short on time the next couple of weeks :-( >>>=20 >>> Theo >>=20 >> I=E2=80=99ve just been forced over to a Mac at work, and I can=E2=80=99t (= yet) for the life of me figure out how to build Emacs from source on this pl= atform. It seems Emacs is not picking up libraries I=E2=80=99ve installed us= ing homebrew? >>=20 >> If anyone can help me get past this roadblock, I might be able to get a p= atch going. (It=E2=80=99s a ARM-based Mac, if that matters.) >=20 > It=E2=80=99s been quite a while since I needed to setup this, so I don=E2=80= =99t quite remember. But setting LD_LIBRARY_PATH (Homebrew=E2=80=99s path) a= nd PKG_CONFIG_PATH (/usr/local/lib/pkgconfig) should help the build process a= nd Emacs find the libraries. >=20 > Yuan I figured it out in the end. For anyone suffering a similar problem: I had all packages I needed installed, but not pkg-config, leading configure= not being able to locate any of them.=20 Installing pkg-config too and running =E2=80=9Cmake bootstrap=E2=80=9D got m= e a working build.=20 With that out of the way, I=E2=80=99ll see if I can come up with some patche= s for the typescript ts-modes sometime the next week.=20 =E2=80=94 Jostein= From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 11:29:45 2023 Received: (at 65470) by debbugs.gnu.org; 26 Aug 2023 15:29:45 +0000 Received: from localhost ([127.0.0.1]:43322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZvEO-00028e-OO for submit@debbugs.gnu.org; Sat, 26 Aug 2023 11:29:45 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]:52677) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qZvEJ-00028M-Sr for 65470@debbugs.gnu.org; Sat, 26 Aug 2023 11:29:43 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bc5acc627dso13495795ad.1 for <65470@debbugs.gnu.org>; Sat, 26 Aug 2023 08:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693063769; x=1693668569; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=+f92LncTZbctgmVj/JUwRxuPXHnF2iTxzurpHR62thA=; b=pJb9pKg4/UdDpdd6Wi2W6RA+dawS6CoXwNIKpFskyeEKU8H5rXhLJ7TNHFv9I13qPz hA4ei+9mpWHNVgL/YuowW9yKIqnhqzLiJ0NePEtE13hStijVw94gdzBsxEn8/b/zwxiw sAP2uDBoE06PMMAhCCe+TdReeas9I5CwxQ9T5M5DCXiW+OOAROq0YXk6DP2mUl6T5+Nx CWdZ0heRfXT/IW4e8kyOEi8dURxsf5fKbsA7sF1vZ7miTscjJdZq9Zqsq7WJ+xSIrt3u llph3z3N1bI1bbXq/AuV2uhL1tD5bOCDxqtS2qjIF+bXUPT+IjRhAm7TU57GwJ+yxGy+ 9iEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693063769; x=1693668569; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+f92LncTZbctgmVj/JUwRxuPXHnF2iTxzurpHR62thA=; b=DpIaPMVxxwc7duYpxb0qUUltlUrSyDZzX0ROht+bjIedTWPANXTOxfmyiltFKEeP4S 0e4Bj3OAaL19JpmBKyytUzw/VKaFISaxi2nRTYdItf9vJQoBASIxW/68Ka1eX6lV/VIZ fbiod/VTBFVgxqDSJtRajZjEm7t0niLhTatnfPFH9V3eS9pTejJGPJMZkbG5midkOCWL VAAV1VGh+jF2sjaAe1iGVW2kAnjCO2sWaT9Lly/kHVCf5uT+htjRGPSg7LtXuLk1J6lq WJykEZSPb+p6+7oqvNdKgKkJLNnAy//s01sTxnRdEMC6jvLpiHY2TaCumB/AkJr8G3dX Yl/A== X-Gm-Message-State: AOJu0YxfVgIowMvu4m5c8OqnOqCeLpYe8/EGmuJGh73OPRgQjUzi4aUP trBSmPsf31aMASareD168NU= X-Google-Smtp-Source: AGHT+IE65ECYv7cmLJ6i4l/eRl2JILPQxZ8H0RtIWhbXkEKQlW8bnHgPKXXnw8na5tqYjkRGKGYT0g== X-Received: by 2002:a17:903:228a:b0:1bb:2ccc:c321 with SMTP id b10-20020a170903228a00b001bb2cccc321mr21425836plh.48.1693063768636; Sat, 26 Aug 2023 08:29:28 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id ju14-20020a170903428e00b001b672af624esm3863625plb.164.2023.08.26.08.29.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Aug 2023 08:29:28 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Fu Yuan Mime-Version: 1.0 (1.0) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Sat, 26 Aug 2023 08:29:17 -0700 Message-Id: References: In-Reply-To: To: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-Mailer: iPhone Mail (20G75) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org, Theodor Thornhill , Dmitry Gutov , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) >>=20 >>>> On Aug 24, 2023, at 11:59 PM, Jostein Kj=C3=B8nigsen wrote: >>>>=20 >>>>=20 >>>>=20 >>>>> On 24 Aug 2023, at 21:47, Theodor Thornhill wrote:= >>>>=20 >>>> Eli Zaretskii writes: >>>>=20 >>>>>=20 >>>>> Would someone please add syntax-propertize-function in modes that need= >>>>> it? I think this should be done on the emacs-29 branch. >>>>>=20 >>>>> TIA >>>>=20 >>>> I'll add it to my list, but if someone will grab it that's fine, as I'm= >>>> a little short on time the next couple of weeks :-( >>>>=20 >>>> Theo >>>=20 >>> I=E2=80=99ve just been forced over to a Mac at work, and I can=E2=80=99t= (yet) for the life of me figure out how to build Emacs from source on this p= latform. It seems Emacs is not picking up libraries I=E2=80=99ve installed u= sing homebrew? >>>=20 >>> If anyone can help me get past this roadblock, I might be able to get a p= atch going. (It=E2=80=99s a ARM-based Mac, if that matters.) >>=20 >> It=E2=80=99s been quite a while since I needed to setup this, so I don=E2= =80=99t quite remember. But setting LD_LIBRARY_PATH (Homebrew=E2=80=99s path= ) and PKG_CONFIG_PATH (/usr/local/lib/pkgconfig) should help the build proce= ss and Emacs find the libraries. >>=20 >> Yuan >=20 > I figured it out in the end. For anyone suffering a similar problem: >=20 > I had all packages I needed installed, but not pkg-config, leading configu= re not being able to locate any of them.=20 >=20 > Installing pkg-config too and running =E2=80=9Cmake bootstrap=E2=80=9D got= me a working build.=20 >=20 > With that out of the way, I=E2=80=99ll see if I can come up with some patc= hes for the typescript ts-modes sometime the next week.=20 Good to hear that! Exiles you are at it, could you also have a look at JSX? I= think the latest tree-sitter grammar breaks some queries. Yuan= From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 17:13:43 2023 Received: (at 65470) by debbugs.gnu.org; 26 Aug 2023 21:13:43 +0000 Received: from localhost ([127.0.0.1]:43543 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qa0bG-0002lI-Ki for submit@debbugs.gnu.org; Sat, 26 Aug 2023 17:13:43 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:41441) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qa0bE-0002l3-5t for 65470@debbugs.gnu.org; Sat, 26 Aug 2023 17:13:41 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9EC345C007F; Sat, 26 Aug 2023 17:13:29 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sat, 26 Aug 2023 17:13:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1693084409; x=1693170809; bh=YH 2hv7HRFdcxQuAb+D+vHuRQirfx58mNnf0flMr9pBE=; b=FK51KSuiUNt3UNd0hp kEM3hdCRgHXmu/UsJxHaio9C1h/bE0klsRY2CgJ5Zr0PuxLa9RDSuL3k5j0rQ96F MMPN+24MSs7XZG69IbgAFsNlx6jiCAN/YXBSYIDNouI/x5AAB7qSlN6yQ99/1Sy4 agv9UFg+dR5fpVJpZRyUv2D/1zTNcZhbOC+seDQg9Rq2OBwWISsCKFEGxvKfFeff Wy1NmHIwH/S6gyAHnM34sIUW0poV+sCazlfTF/BDeeaTey1Qsu+lXItzJ2Zhfsdu AGeGxrJWCad66D6lQ+Oik2WcEPiDccEyBETJxGtXzrFLw655z2lBRbcMB9/dTleT UiyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693084409; x=1693170809; bh=YH2hv7HRFdcxQuAb+D+vHuRQirfx58mNnf0 flMr9pBE=; b=tKxTr2TY4m1u8WJbcr2RWa2i0LyZh8J5/qZySLv3h09IMXnwLw1 50OfeEzz2bDWw8J2R+yS2dmN1SDz8iktxqjXpYwMr6iyryF8z3ch/KvKepH6yY6A 3r1FcAAj/UnFtMDCrx0p9JdLaNKC/X8hxkWEBhXUHgETLWaPvqoScLLU77zMWeye bn7ZQuW8jg9teNmW2m8vHuHSz0LyFeeXNWJIRtQ1UiGMyFfPY2FRygAgvUqYYEPP Y1RSx8ZsgC0+dzPAOyvhEGfv+eplUMiBpsyoXb+o+Hjp7VpuKhMgg6rcZW9FrguN 8RZKoorrxojj9lzeAZZdDQHnGDA6vqJwSfw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeftddgudehjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtgffhggfufffkfhevjgfvofesthhqmhdthhdtjeenucfhrhhomheplfho shhtvghinhcumfhjpphnihhgshgvnhcuoehjohhsthgvihhnsehsvggtuhhrvgdrkhhjoh hnihhgshgvnhdrnhgvtheqnecuggftrfgrthhtvghrnhepvdeitdefudetveeghfegfeff hfeuledtteevheekkeduhfejiefhvefffedugedtnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepjhhoshhtvghinhesshgvtghurhgvrdhkjhho nhhighhsvghnrdhnvght X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Aug 2023 17:13:28 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Mime-Version: 1.0 (1.0) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Sat, 26 Aug 2023 23:13:15 +0200 Message-Id: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> References: In-Reply-To: To: Fu Yuan X-Mailer: iPhone Mail (20G75) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org, Theodor Thornhill , Dmitry Gutov , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > On 26 Aug 2023, at 17:29, Fu Yuan wrote: >=20 > =EF=BB=BF >>>=20 >>>>> On Aug 24, 2023, at 11:59 PM, Jostein Kj=C3=B8nigsen wrote: >>>>>=20 >>>>>=20 >>>>>=20 >>>>>> On 24 Aug 2023, at 21:47, Theodor Thornhill wrote= : >>>>>=20 >>>>> Eli Zaretskii writes: >>>>>=20 >>>>>>=20 >>>>>> Would someone please add syntax-propertize-function in modes that nee= d >>>>>> it? I think this should be done on the emacs-29 branch. >>>>>>=20 >>>>>> TIA >>>>>=20 >>>>> I'll add it to my list, but if someone will grab it that's fine, as I'= m >>>>> a little short on time the next couple of weeks :-( >>>>>=20 >>>>> Theo >>>>=20 >>>> I=E2=80=99ve just been forced over to a Mac at work, and I can=E2=80=99= t (yet) for the life of me figure out how to build Emacs from source on this= platform. It seems Emacs is not picking up libraries I=E2=80=99ve installed= using homebrew? >>>>=20 >>>> If anyone can help me get past this roadblock, I might be able to get a= patch going. (It=E2=80=99s a ARM-based Mac, if that matters.) >>>=20 >>> It=E2=80=99s been quite a while since I needed to setup this, so I don=E2= =80=99t quite remember. But setting LD_LIBRARY_PATH (Homebrew=E2=80=99s path= ) and PKG_CONFIG_PATH (/usr/local/lib/pkgconfig) should help the build proce= ss and Emacs find the libraries. >>>=20 >>> Yuan >>=20 >> I figured it out in the end. For anyone suffering a similar problem: >>=20 >> I had all packages I needed installed, but not pkg-config, leading config= ure not being able to locate any of them.=20 >>=20 >> Installing pkg-config too and running =E2=80=9Cmake bootstrap=E2=80=9D go= t me a working build.=20 >>=20 >> With that out of the way, I=E2=80=99ll see if I can come up with some pat= ches for the typescript ts-modes sometime the next week.=20 >=20 > Good to hear that! Exiles you are at it, could you also have a look at JSX= ? I think the latest tree-sitter grammar breaks some queries. >=20 > Yuan I don=E2=80=99t really work with JSX and don=E2=80=99t think have a =E2=80=9C= idiomatic=E2=80=9D code base to try it on where I would notice brokenness.=20= I think this would be better handled by people more experienced with both JS= X and our JSX code base than I am.=20 =E2=80=94 Jostein= From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 26 17:45:44 2023 Received: (at 65470) by debbugs.gnu.org; 26 Aug 2023 21:45:44 +0000 Received: from localhost ([127.0.0.1]:43564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qa16C-0003Ww-SN for submit@debbugs.gnu.org; Sat, 26 Aug 2023 17:45:44 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:46295) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qa166-0003Wf-VQ for 65470@debbugs.gnu.org; Sat, 26 Aug 2023 17:45:38 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 26FA232005CA; Sat, 26 Aug 2023 17:45:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 26 Aug 2023 17:45:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693086322; x=1693172722; bh=UbFW8a21jjA8Lnr5P60rQkljbOrMMj/+Nm4 ZaEBjk78=; b=iCo32QPyfk2rWGgLNSoHP9zX9rezWFnzZH4ZpyVA0k6Bz4/bCzf 7iiQfBttNCWqxrwaPtnfzzHSUkcFDTi35auw12rb7nc5cVEb18WTDfVAve+u0Oag NFS8LtMdRua157jboD4Bpo9iq8HXkoODtpDlsxm2bL2W+Aw2hckqcWvf15INL28n X9lzY8ynqkEwSdcWnXOrYPANBpZ10O9GOiCrZBfDEZEtO8vD781tO2QqsPdRql0x RZf5bahZfrDhxkOdHh2aOPALpvcm64QReFITbd0a7D+bUb+uCWn7HDqC5+YWizIb 5si4V1yqQALjq+9AIRRl2NYjwwPYBtbMLLQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693086322; x=1693172722; bh=UbFW8a21jjA8Lnr5P60rQkljbOrMMj/+Nm4 ZaEBjk78=; b=Ft47QLBj74z8+aXURqzIUNYIPhLU35m5GJn2TUDnK9qazqyQ0aT Rnyz+R9RALOdXwkXInKdwJ7pM4+XIPJZRoZdM9PxSbJSGSZfO1XbC9Pqf69WswSw o5wWSEG8RUMibM+imNw9xLYGrrRn40w5VwCavDbyT8wW+RyHvwI3v6Uwc8lhkjfu JhD3kVwJ1QtuHT/tw/uy1CRJNC/E8iBxl6qPXSXJOSyMla7KLP3BpP9qvrPdhp6u d/kx0fefsx6GwHqPc/7xUDMl2L9DSOywNYhSmVWNGGGOhQIdZQMhD9yp2rwRVnkN b7iMq8Hmqw9ZdQ4lVSn/Mnof4NQZQm1bUZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefuddgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 26 Aug 2023 17:45:20 -0400 (EDT) Message-ID: <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> Date: Sun, 27 Aug 2023 00:45:19 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= , Fu Yuan References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> From: Dmitry Gutov In-Reply-To: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= , Eli Zaretskii , 65470@debbugs.gnu.org, Theodor Thornhill X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) On 27/08/2023 00:13, Jostein Kjønigsen wrote: > I don’t really work with JSX and don’t think have a “idiomatic” code base to try it on where I would notice brokenness. > > I think this would be better handled by people more experienced with both JSX and our JSX code base than I am. Just checking that viewing some JSX code in .tsx files doesn't show errors in Messages might be good enough. I tried that with javascript, didn't notice any problems so far. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 05:41:50 2023 Received: (at 65470) by debbugs.gnu.org; 31 Aug 2023 09:41:50 +0000 Received: from localhost ([127.0.0.1]:54880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbeBR-00030L-UK for submit@debbugs.gnu.org; Thu, 31 Aug 2023 05:41:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbeBO-000307-Rw for 65470@debbugs.gnu.org; Thu, 31 Aug 2023 05:41:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbeB9-0007ZV-Ki; Thu, 31 Aug 2023 05:41:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=owjZXCHkEIwVpKB+uaMUhaJSFfTUnrYmoqqqQkrA1NY=; b=MWQWwTctOjgs7uYMorN3 rWAQ6EJaYQYuIpm9McQwqzEw0Cpobc/aypkVUITQz8S14gT4vKBGxJJemFNNe/qnqpFsxTcJSSW/+ y6T6dMQArTTmmee728Vzxt32Z97Y8JcMIo3ZktZx/T0ts3KwSX0TMfIqF5QLPbSx+JEFgFS5La8Ky wRAdtKTn4Atl7dyqHZSd+Fu+N0y4nb8AraIywCWiWsDOTGBx0flDUocpQS0B7gitFyK0zkZXmAxwO maAApVNk/SmHqdDkPF6Y432ZNkG5381FoGQcJruiZRp4HclCw9UTT9lfetJOCcCoeVECRgIVawF3L bzldLjSTAv6saQ==; Date: Thu, 31 Aug 2023 12:41:13 +0300 Message-Id: <83jztbeeh2.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> (message from Dmitry Gutov on Sun, 27 Aug 2023 00:45:19 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 27 Aug 2023 00:45:19 +0300 > Cc: Theodor Thornhill , Eli Zaretskii , > Jostein Kjønigsen , btuin@mailo.com, > 65470@debbugs.gnu.org > From: Dmitry Gutov > > On 27/08/2023 00:13, Jostein Kjønigsen wrote: > > I don’t really work with JSX and don’t think have a “idiomatic” code base to try it on where I would notice brokenness. > > > > I think this would be better handled by people more experienced with both JSX and our JSX code base than I am. > > Just checking that viewing some JSX code in .tsx files doesn't show > errors in Messages might be good enough. > > I tried that with javascript, didn't notice any problems so far. I'm a bit confused by this discussion. Should I install the patch on the emacs-29 branch now, or are you still discussing whether it's correct? From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 07:15:42 2023 Received: (at 65470) by debbugs.gnu.org; 31 Aug 2023 11:15:42 +0000 Received: from localhost ([127.0.0.1]:55059 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbfeH-0008Id-Lp for submit@debbugs.gnu.org; Thu, 31 Aug 2023 07:15:42 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:45305) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbfeF-0008IR-Hh for 65470@debbugs.gnu.org; Thu, 31 Aug 2023 07:15:40 -0400 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 46B4C5C018E; Thu, 31 Aug 2023 07:15:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 31 Aug 2023 07:15:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693480526; x=1693566926; bh=GuD2UeTCAByt1JZEqSIRdCLkada5ZzB4ZiF 31+EzPiU=; b=O2WCVx6eK0L72GHDDcZ7R/VUiLo6kwBHo9XLQTn+hYxWJhKk4X9 UVsACMoMrGh45W4MsZf+Dg3hlveX830L+EpcPy3qRdh4U+PSawpqGlwOlF6Hgity +BAPd+E5wDo+hLtBcnoWCy4ifiHuzBIoZ049WbIMFFCdc2VYoirfhFBkja2INjTK PP4pUYeEyDWH1ssLlGAUvGtd874AKtOywBxxlmd51bGFRiB313iA6XFeEWRCCVIL 2vUq7v4yzZ0arCAHj25Ja6qliMcrjZWUCPwbbx/Fsc/EgmKGVy4OEGXh/ow0tBn+ zjCHT3cn9+5pRifiY/EKWP7gYRiEH7sED+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693480526; x=1693566926; bh=GuD2UeTCAByt1JZEqSIRdCLkada5ZzB4ZiF 31+EzPiU=; b=AKzqhwwr5nD2MeO2nW3cMoL071flTmETHqhOCownSYNGX2h9NWr pWliqsmc4i2MXirePGApDOLPj81VBzAENtPesik3qhTvFL/YOvbtJOR+MAmg+8La 6t33cwNFBRu4QiaP4l/c3+za0pldK8ByzEy//U7aFYJKKQCZj8ZmOJQ5sHto7wbd Q4mo2Y+RVmNbKHM4imFkXxvYyndZETvhhmHAnXgCvUoKFygltpmwhHshbq9jgCWb UEGon2wbSHN07Ws6/DD/IKILC9qmDB+qjOhvidJXKG9IYmrcqj7sdEv0ChfUvWmk jJZh+MKPGnceGuXllvXkFyYBsezO9gc2hkQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegtddgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Aug 2023 07:15:24 -0400 (EDT) Message-ID: <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> Date: Thu, 31 Aug 2023 14:15:22 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: Eli Zaretskii References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <83jztbeeh2.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -1.7 (-) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) On 31/08/2023 12:41, Eli Zaretskii wrote: >> Date: Sun, 27 Aug 2023 00:45:19 +0300 >> Cc: Theodor Thornhill, Eli Zaretskii, >> Jostein Kjønigsen,btuin@mailo.com, >> 65470@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 27/08/2023 00:13, Jostein Kjønigsen wrote: >>> I don’t really work with JSX and don’t think have a “idiomatic” code base to try it on where I would notice brokenness. >>> >>> I think this would be better handled by people more experienced with both JSX and our JSX code base than I am. >> Just checking that viewing some JSX code in .tsx files doesn't show >> errors in Messages might be good enough. >> >> I tried that with javascript, didn't notice any problems so far. > I'm a bit confused by this discussion. Should I install the patch on > the emacs-29 branch now, or are you still discussing whether it's > correct? I think we were discussing the typescript modes here. Personally I was waiting for some additional confirmation that my v2 for js-ts-mode is correct, but I guess we have a silent approval, so we can install it. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 08:53:46 2023 Received: (at 65470) by debbugs.gnu.org; 31 Aug 2023 12:53:46 +0000 Received: from localhost ([127.0.0.1]:55139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbhBC-0004z9-4Q for submit@debbugs.gnu.org; Thu, 31 Aug 2023 08:53:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37774) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbhBA-0004yv-5f for 65470@debbugs.gnu.org; Thu, 31 Aug 2023 08:53:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qbhAw-0003qt-CA; Thu, 31 Aug 2023 08:53:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JBl8zjS5aW++rce9GsBoh2RJJHWA/6OtR74Zuf8gOUk=; b=e66uWWtBUmSX FDBaP5QoQW1FN6u0RHVyCUcEhhfBKx/vmuRTInyg0pK7usw5lgEE3OmQEG0Qpw69sRITRTL/3z+Ue ZeuV6suJN7R8bMUw0IMygYGVA85WCu3bFXyOpn4HZTla41kgsMGYirE/g9K5jMU5Gsfne1xEc4ZeC mTbv+bhwE5X5+lrPLXv1zhKALau9+6oVnugS3PcFARlwSqrOUUgdtfagKVPC+bCSrx8AnxQdOY7um wNpeu33jubbYQc3sW9qUL24lNfeQB+FHN9q/n+LpqyFAM3CkbDGud1h1pxpV+1JJIBFbTTo/qWfxc URvuanoGDI+hUvpbzr44OA==; Date: Thu, 31 Aug 2023 15:53:11 +0300 Message-Id: <8334zze5l4.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> (message from Dmitry Gutov on Thu, 31 Aug 2023 14:15:22 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 31 Aug 2023 14:15:22 +0300 > Cc: jostein@secure.kjonigsen.net, casouri@gmail.com, theo@thornhill.no, > jostein@kjonigsen.net, btuin@mailo.com, 65470@debbugs.gnu.org > From: Dmitry Gutov > > On 31/08/2023 12:41, Eli Zaretskii wrote: > > I'm a bit confused by this discussion. Should I install the patch on > > the emacs-29 branch now, or are you still discussing whether it's > > correct? > > I think we were discussing the typescript modes here. > > Personally I was waiting for some additional confirmation that my v2 for > js-ts-mode is correct, but I guess we have a silent approval, so we can > install it. Good to hear. Then please install it, and thanks. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 31 21:42:49 2023 Received: (at 65470) by debbugs.gnu.org; 1 Sep 2023 01:42:49 +0000 Received: from localhost ([127.0.0.1]:59518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbtBQ-00021r-KL for submit@debbugs.gnu.org; Thu, 31 Aug 2023 21:42:48 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:54987) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qbtBO-00021e-Dd for 65470@debbugs.gnu.org; Thu, 31 Aug 2023 21:42:48 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id ED7923200312; Thu, 31 Aug 2023 21:42:30 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 31 Aug 2023 21:42:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693532550; x=1693618950; bh=m18p03VrmZWuzsHT1bgxQRv5kHb32Fa35q2 QHSIuBBw=; b=j9uXb6/CnX7wGiKJhb3MYTzUQbxr5jdjmCNpIA6HCCDPbqzg8Ky 1HvpQ04QKOwPNBEsgiNwvf5JB9ignF703hs0c2zDN+fnlJVL6E6gqZ6BeBiMeVdE ZPP6wREY06vTkzjYq/Nmm+agmunpko2/ipeEYhJF0fPgEY3ujkdGiaZfNEnU6kEJ 0MmZiTx4wAU9vmP0LaE4w32/W98xRowaz+mK3wmmDur/FGsuQOk7SBrCZBYPYHqA 9D2dtzGM7BfEE9UE3tYjTm8xgG8e1HyqjinXXy67Fn6Ina28bcwk8xCr3wO8/3Po PtHjbB1duVOxKm1uzNo7vQQyGwK46VhlDrA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693532550; x=1693618950; bh=m18p03VrmZWuzsHT1bgxQRv5kHb32Fa35q2 QHSIuBBw=; b=t0siMHjPCaJHh15AfncMiHaOWFKMozEYBON2YNbecrFbKSJnpQN +yV9r22T/Np1fV0Ql0dR4TKb8jf9upcAToTUSZkAQFovC9wLf9ohH3XRsFdsh13Z QXr+4lYHvtNu/zPGcb0djsYbQsr3RijbyEMw+NW36/Uwo7ppU1zEmm88NlXpF6dA 7FqkOu4v6Q/VlRH8nAPnA94bQxDmxM5iZ4t7UmpjEicqOJXaJpECBOjvtotXyDCL X1EhZdNxtS5k+PrcamQ2GBPqkeoyqeudAcDSlsgF46t4epeWrQ5Ljm49RXfFttak hh+EJRG1TxWn5PeOkdjN6vmHCA4teBeGsvQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeguddggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 31 Aug 2023 21:42:27 -0400 (EDT) Message-ID: <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> Date: Fri, 1 Sep 2023 04:42:26 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: Eli Zaretskii References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <8334zze5l4.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) On 31/08/2023 15:53, Eli Zaretskii wrote: >> Date: Thu, 31 Aug 2023 14:15:22 +0300 >> Cc:jostein@secure.kjonigsen.net,casouri@gmail.com,theo@thornhill.no, >> jostein@kjonigsen.net,btuin@mailo.com,65470@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 31/08/2023 12:41, Eli Zaretskii wrote: >>> I'm a bit confused by this discussion. Should I install the patch on >>> the emacs-29 branch now, or are you still discussing whether it's >>> correct? >> I think we were discussing the typescript modes here. >> >> Personally I was waiting for some additional confirmation that my v2 for >> js-ts-mode is correct, but I guess we have a silent approval, so we can >> install it. > Good to hear. Then please install it, and thanks. All right, installed one for js-ts-mode. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 11:45:42 2023 Received: (at 65470) by debbugs.gnu.org; 1 Sep 2023 15:45:42 +0000 Received: from localhost ([127.0.0.1]:33693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc6L8-0006Tb-47 for submit@debbugs.gnu.org; Fri, 01 Sep 2023 11:45:42 -0400 Received: from msg-2.mailo.com ([213.182.54.12]:48428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc6L4-0006TE-2L for 65470@debbugs.gnu.org; Fri, 01 Sep 2023 11:45:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1693583118; bh=yC5YSNQhWE1foBo2Cj6L1DPeBT4hPP7bdqetcKCsdRA=; h=X-EA-Auth:Message-ID:Date:MIME-Version:Subject:To:Cc:References: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=P+2cPvjJVsIUdOBuNS23K+UbKC4usqzFI0vC1qQOCqMZHZZIkOC/c1EMux+EHLTvk xXfAJoEwoOsejpyTHg2GhXyvGQfegM+b1ZQZ9mcemhw/8MOCqUxrmXtisfayrJrrP6 nBiox/Ajs69AMKb9GgIlhWNQHsQ1MgBODIK3u1I0= Received: by b221-2.in.mailobj.net [192.168.90.22] with ESMTP via ip-20.mailobj.net [213.182.54.20] Fri, 1 Sep 2023 17:45:18 +0200 (CEST) X-EA-Auth: MrnM2Silfnqw2SZma1FkcS/yctsdClmT0MjWojfeumIQ2IxNtEqa9Nupck7gAcRjEB30YGykxQgOl1jibPPzdJ5e5bt7aVph Message-ID: Date: Fri, 1 Sep 2023 17:45:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching To: Dmitry Gutov References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> Content-Language: fr, en-US From: =?UTF-8?Q?Augustin_Ch=C3=A9neau_=28BTuin=29?= In-Reply-To: <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le 31/08/2023 à 13:15, Dmitry Gutov a écrit : > On 31/08/2023 12:41, Eli Zaretskii wrote: >>> Date: Sun, 27 Aug 2023 00:45:19 +0300 >>> Cc: Theodor Thornhill, Eli Zaretskii, >>>   Jostein Kjønigsen,btuin@mailo.com, >>>   65470@debbugs.gnu.org >>> From: Dmitry Gutov >>> >>> On 27/08/2023 00:13, Jostein Kjønigsen wrote: >>>> I don’t really work with JSX and don’t think have a “idiomatic” code >>>> base to try it on where I would notice brokenness. >>>> >>>> I think this would be better handled by people more experienced with >>>> both JSX and our JSX code base than I am. >>> Just checking that viewing some JSX code in .tsx files doesn't show >>> errors in Messages might be good enough. >>> >>> I tried that with javascript, didn't notice any problems so far. >> I'm a bit confused by this discussion.  Should I install the patch on >> the emacs-29 branch now, or are you still discussing whether it's >> correct? > > I think we were discussing the typescript modes here. > > Personally I was waiting for some additional confirmation that my v2 for > js-ts-mode is correct, but I guess we have a silent approval, so we can > install it. Whoops, sorry. I confirm this fixed my issue with js-ts-mode. Thank you for your patch! From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 11:59:29 2023 Received: (at 65470-done) by debbugs.gnu.org; 1 Sep 2023 15:59:29 +0000 Received: from localhost ([127.0.0.1]:33704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc6YS-0006sS-KZ for submit@debbugs.gnu.org; Fri, 01 Sep 2023 11:59:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36560) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc6YR-0006sF-4l for 65470-done@debbugs.gnu.org; Fri, 01 Sep 2023 11:59:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qc6YA-0000ig-L5; Fri, 01 Sep 2023 11:59:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=RvkxvKC1UFgBjdXvq5ZzXkUvYZFNX9vdz7KoKF0OQ90=; b=WAUdnAFU+rRNXa681OJO 7HPNauN+WNBora2ckSTAzfkLVpTb5m9uE6Dm7CHBWgEXvrqTWnW5jjO/rEyXOWu775abJ62odLvgK qZ9NwI0ifQ2L+Lh/jQe6fRe0xRHEMV/Aqg8BCAkVTWOvpBK/h8M14HEQktzjgtOxj4eAjiIQj1BgU xvmS/gUaih+vprYUoqrQ6fm4zskXs4hqQUq3PNb8c8JQVn/xGEDpvJZf7kuirw3RYAbcU67eGpr9X 2w8V5iIf467ca4MRBV4HiC6UkfQdoEuZqgRzXAFqby73rdMB0TvYrgQGNddrZsYV5AyTTw3dkMGZk 4EtpfJZo7RwxUg==; Date: Fri, 01 Sep 2023 18:58:55 +0300 Message-Id: <83cyz1c2bk.fsf@gnu.org> From: Eli Zaretskii To: Augustin =?utf-8?Q?Ch=C3=A9neau?= (BTuin) In-Reply-To: (btuin@mailo.com) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470-done Cc: dmitry@gutov.dev, 65470-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 65470@debbugs.gnu.org > Date: Fri, 1 Sep 2023 17:45:17 +0200 > From: Augustin Chéneau (BTuin) > > > Personally I was waiting for some additional confirmation that my v2 for > > js-ts-mode is correct, but I guess we have a silent approval, so we can > > install it. > > Whoops, sorry. I confirm this fixed my issue with js-ts-mode. > Thank you for your patch! Thanks, I'm therefore closing the bug. From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 01 15:21:31 2023 Received: (at 65470) by debbugs.gnu.org; 1 Sep 2023 19:21:31 +0000 Received: from localhost ([127.0.0.1]:33958 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc9hz-0000kd-Di for submit@debbugs.gnu.org; Fri, 01 Sep 2023 15:21:31 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:52225) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qc9hu-0000kG-Do for 65470@debbugs.gnu.org; Fri, 01 Sep 2023 15:21:30 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 75AAF5C00A6; Fri, 1 Sep 2023 15:21:11 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Fri, 01 Sep 2023 15:21:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693596071; x=1693682471; bh=StrXG+klmP1sR9xXkn2tMrVOptNgWt1JKy8 vra9YhaU=; b=YhfLK+onLoHPTCYItyULBAE83v6Rg7+GEN/JsHylABLSEorKeF3 8rpBCwjiZ/DGZsqy+u4G3okbSxLaHbEeDc0oA0rS8IC3eLiRV1NIUzIWjQrikori AWqsE+BO+QF/AV77PgnqhMRD+ihbG7pUjBt4kuclT+xBh1PPW0gP2WOD/PG6PVmP ZfzHO11V1R1Z4/3DQEMRFXwqCJ+fkctU+NiXIWU+/KeLdqUmjlCOJjpQoJAQXC5r cwavwb6FTb+WAd2wcdYptSiIt+FWcZkg2HQpUvg9jBr+iR+MvRf2152lgEFH9yAp uuw+dDQIewd/zkZrHsddZUxfcI8o9a/dPYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693596071; x=1693682471; bh=StrXG+klmP1sR9xXkn2tMrVOptNgWt1JKy8 vra9YhaU=; b=DQ1CT/5TOpe+5OVkO2VE744pijEH7ayoZzUt2zjSAEV1xKUuVAN QuZexLTgDGrvXCwqLJU3AuGVrINiJecVpTbq7/yrMsPq1qyR+irMpvsWntVqIcJ/ 45f/LeS4Fj1AnsaN/g3lU5pA53D/J18OkowkpGlfBIQpzQhR89qpOQgVnG8aiJaX ZO8XNrfX5F2dUcdBKh/zxvG2fPc4WP9mo20txLQ34sTSuO9wlAdg0oUGbTysAaNh p2mFSbevlXo/S8aeXvUf6EEy/DgWBnEP9UteGiP8+d6rIqoazM3slX2QIHjXOx7p /X9iJEooCzxTOZwUxdEChw9hyb92FMHt2BQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudegvddgudefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpefhffehleejffegffeugefhkeektdffgfehjedvgeejtedtudehueffgffg feejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 1 Sep 2023 15:21:10 -0400 (EDT) Message-ID: <13478911-ec63-f9ce-41b6-d6dbfe18fea7@gutov.dev> Date: Fri, 1 Sep 2023 22:21:08 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Augustin_Ch=c3=a9neau_=28BTuin=29?= References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 65470 Cc: 65470@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.2 (-----) On 01/09/2023 18:45, Augustin Chéneau (BTuin) wrote: >>>> >>> I'm a bit confused by this discussion.  Should I install the patch on >>> the emacs-29 branch now, or are you still discussing whether it's >>> correct? >> >> I think we were discussing the typescript modes here. >> >> Personally I was waiting for some additional confirmation that my v2 >> for js-ts-mode is correct, but I guess we have a silent approval, so >> we can install it. > > Whoops, sorry.  I confirm this fixed my issue with js-ts-mode. > Thank you for your patch! Thanks for testing! From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 05 15:31:50 2023 Received: (at 65470) by debbugs.gnu.org; 5 Sep 2023 19:31:50 +0000 Received: from localhost ([127.0.0.1]:59370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdbmA-0004dK-0i for submit@debbugs.gnu.org; Tue, 05 Sep 2023 15:31:50 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:59645) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdbm5-0004d0-Pm for 65470@debbugs.gnu.org; Tue, 05 Sep 2023 15:31:48 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E3DAF5C004D; Tue, 5 Sep 2023 15:31:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 05 Sep 2023 15:31:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1693942299; x=1694028699; bh=KtDigxVcT9hHlx+hlHLyJ2T0lrIuXnRc29e Jew2MZCg=; b=LQl5ZGZ9yjsPYLQZUtowkYcryMI+fdAe+e4lucHVhP024puLVqs 5QbFOcbkAud3Yo/e1oofyoX0CijAepCkYrVieWOUQkT4AR1vfC0x3U8VH3MO4MN5 l6WdAZFkPdKbk+lkO1Gws0MW32qnnRBBIGvwae7qHar+o7M7EMyiG3H/E9QnnlT4 fTVelZJHsBgV4jyyoFYA8zYDDWE3VnoK2qEqdzlWKYPKZFK6V7Y2PI1XDqdCEwWj BhB8EJz9J3l7Uh2qz2CzG9YEV9KI3pUSVG3JlBGbGJGpz0L98DqAA+LDyOgc2lH4 KbESyZv+cdgX92fgrFCZhavVvsle0ir+KUw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1693942299; x=1694028699; bh=KtDigxVcT9hHl x+hlHLyJ2T0lrIuXnRc29eJew2MZCg=; b=lYgNvqOs3BIGbcOsMGO1jTYyI8zsZ WwI5dkA8I3HqW5/dmSpa0CffhwyuogO5nwHFxzmk+FKY0kgfzKAC5AGWIZo3+d2j Q7HObRWTLBhQQpCulNcTYDLMh9f2pEn16JoKrGclcaVQpbj0ndKNsPnjtr5rwkPL frGvs+RQ3EHMvt3+CWe7m+u2zH7K0oTrrXv2iOJLSq5HAvfoTMcLMxs7+7Tu4soU yA9fVsy/Qfwdd5hHuoIX48T2rk2rKs7LD0EERtPblFoRqZkPhI7+dPZP88/0k+/n lzxOmjjNInncvHcbC7YKyuyHtCSoEHLsJqsqsN9HZQcB4ozX8uMjaOVdQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehuddgudduhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhkfgtggfuffgjvefvfhfosehmtdhmrehhtdejnecuhfhrohhmpeflohhs thgvihhnucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonh highhsvghnrdhnvghtqeenucggtffrrghtthgvrhhnpeejtdejffeggfeuffeuvefhveek ffdtiedtffelteeuiefgvdejheeihfehheekgfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhn ihhgshgvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Sep 2023 15:31:38 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Message-Id: <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> Content-Type: multipart/mixed; boundary="Apple-Mail=_98540599-24EF-4FC2-B6EE-956A88843869" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Tue, 5 Sep 2023 21:31:25 +0200 In-Reply-To: <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> To: Dmitry Gutov References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Apple-Mail=_98540599-24EF-4FC2-B6EE-956A88843869 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 1 Sep 2023, at 03:42, Dmitry Gutov wrote: >=20 > On 31/08/2023 15:53, Eli Zaretskii wrote: >>> Date: Thu, 31 Aug 2023 14:15:22 +0300 >>> Cc:jostein@secure.kjonigsen.net,casouri@gmail.com,theo@thornhill.no, >>> jostein@kjonigsen.net,btuin@mailo.com,65470@debbugs.gnu.org >>> From: Dmitry Gutov >>>=20 >>> On 31/08/2023 12:41, Eli Zaretskii wrote: >>>> I'm a bit confused by this discussion. Should I install the patch = on >>>> the emacs-29 branch now, or are you still discussing whether it's >>>> correct? >>> I think we were discussing the typescript modes here. >>>=20 >>> Personally I was waiting for some additional confirmation that my v2 = for >>> js-ts-mode is correct, but I guess we have a silent approval, so we = can >>> install it. >> Good to hear. Then please install it, and thanks. >=20 > All right, installed one for js-ts-mode. Sorry for the somewhat slow response on this. Life has been busy for me = as well :) Based on the infamous =E2=80=9Ccopy, paste & adapt=E2=80=9D methodology = I=E2=80=99ve come up with a patch for typescript-ts-mode and tsx-ts-mode = which seems to work for the simple test case provided above. However the patch for js-ts-mode has lots of =E2=80=A6 interesting stuff = about jsx I have not included, for no other reason than not = understanding what type of use-cases they are meant to support. If someone can provide me some examples for the JSX use-cases, I can try = to make room for TSX-variants of the same code. The patch so far is attached. It=E2=80=99s intentionally -not- optimized = to leave room for TSX cases which may arise, so hopefully no need to = nitpick this yet. --Apple-Mail=_98540599-24EF-4FC2-B6EE-956A88843869 Content-Disposition: attachment; filename=0001-typescript-ts-mode-Fix-syntax-properties-for-regexp-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-typescript-ts-mode-Fix-syntax-properties-for-regexp-.patch" Content-Transfer-Encoding: quoted-printable =46rom=20db0393034ca8f251dd1d5cedf928f0c0264d61ef=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Tue,=205=20Sep=202023=2021:29:27=20= +0200=0ASubject:=20[PATCH]=20typescript-ts-mode:=20Fix=20syntax=20= properties=20for=20regexp=0A=20expressions.=0A=0A---=0A=20= lisp/progmodes/typescript-ts-mode.el=20|=2020=20++++++++++++++++++++=0A=20= 1=20file=20changed,=2020=20insertions(+)=0A=0Adiff=20--git=20= a/lisp/progmodes/typescript-ts-mode.el=20= b/lisp/progmodes/typescript-ts-mode.el=0Aindex=20= 441cdc1f7aa..016c62623c7=20100644=0A---=20= a/lisp/progmodes/typescript-ts-mode.el=0A+++=20= b/lisp/progmodes/typescript-ts-mode.el=0A@@=20-473,6=20+473,7=20@@=20= typescript-ts-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(keyword=20string=20escape-sequence)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(constant=20expression=20identifier=20number=20= pattern=20property)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(function=20bracket=20delimiter)))=0A+=20=20=20=20(setq-local=20= syntax-propertize-function=20#'ts-ts--syntax-propertize)=0A=20=0A=20=20=20= =20=20(treesit-major-mode-setup)))=0A=20=0A@@=20-529,9=20+530,28=20@@=20= tsx-ts-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (keyword=20string=20escape-sequence)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(constant=20expression=20identifier=20jsx=20number=20= pattern=20property)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(function=20bracket=20delimiter)))=0A+=20=20=20=20(setq-local=20= syntax-propertize-function=20#'ts-ts--syntax-propertize)=0A=20=0A=20=20=20= =20=20(treesit-major-mode-setup)))=0A=20=0A+(defvar=20ts-ts--s-p-query=0A= +=20=20(when=20(treesit-available-p)=0A+=20=20=20=20= (treesit-query-compile=20'typescript=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'(((regex=20pattern:=20= (regex_pattern)=20@regexp))))))=0A+=0A+(defun=20ts-ts--syntax-propertize=20= (beg=20end)=0A+=20=20(let=20((captures=20(treesit-query-capture=20= 'typescript=20ts-ts--s-p-query=20beg=20end)))=0A+=20=20=20=20= (pcase-dolist=20(`(,name=20.=20,node)=20captures)=0A+=20=20=20=20=20=20= (let*=20((ns=20(treesit-node-start=20node))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20(ne=20(treesit-node-end=20node))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20(syntax=20(pcase-exhaustive=20name=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20('regexp=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cl-decf=20ns)=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (cl-incf=20ne)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20(string-to-syntax=20"\"/")))))=0A+=20=20=20=20=20=20=20=20= (put-text-property=20ns=20(1+=20ns)=20'syntax-table=20syntax)=0A+=20=20=20= =20=20=20=20=20(put-text-property=20(1-=20ne)=20ne=20'syntax-table=20= syntax)))))=0A+=0A=20(if=20(treesit-ready-p=20'tsx)=0A=20=20=20=20=20= (add-to-list=20'auto-mode-alist=20'("\\.tsx\\'"=20.=20tsx-ts-mode)))=0A=20= =0A--=20=0A2.39.2=20(Apple=20Git-143)=0A=0A= --Apple-Mail=_98540599-24EF-4FC2-B6EE-956A88843869 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 =E2=80=94 Jostein= --Apple-Mail=_98540599-24EF-4FC2-B6EE-956A88843869-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 05 16:13:36 2023 Received: (at control) by debbugs.gnu.org; 5 Sep 2023 20:13:36 +0000 Received: from localhost ([127.0.0.1]:59535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdcQa-0005oT-A8 for submit@debbugs.gnu.org; Tue, 05 Sep 2023 16:13:36 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]:45507) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qdcQZ-0005oD-6e for control@debbugs.gnu.org; Tue, 05 Sep 2023 16:13:35 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-4ff9b389677so4644655e87.3 for ; Tue, 05 Sep 2023 13:13:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693944808; x=1694549608; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=GMmVm2CO6R/cGmWTXaibBAhaeqwbGqTYh7hPFgA2Xyw=; b=cmWedo4O4KuX6HLice1YBP3CgSd+JdbMZuzzK1fvHibfl0s6ZFbH+jOP7CduLlq2GX l7SZ8IijT312Zm1abf2sJIPCbYMHc536K9EzrWRknad3OLoWYQPIY3cK7Kz0yWWIKzIK sbLdvQiJVMsJ/uVK5hHdiz/j6/mFt4/+05qo3oTnQfVdwMZwpeN4e4/GCax2xqirLCHM ohteoKs7g5ZQI+NlGBm6O/bLPlMPFJa/VhXxpHMSkUKyZO33355e2fY3pF8GRLtnsCBl 0Iz9R8mjxaqSqv3C4eGXC+Rp+LXIsYtaZSkUCisOi76n6zqHy6Ynhbm4X5IAiXAbepA9 LOxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693944808; x=1694549608; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=GMmVm2CO6R/cGmWTXaibBAhaeqwbGqTYh7hPFgA2Xyw=; b=XBIbuuqGU8v6m/i8xXwSAPQQYfoQNL2zbtcQxV0HvgM1fiPCyafaa1S0v4nQBCDZrx wPuDB/9xIQLdTcehwjg+Sz4xepTKPTUmuvyG1osd6Z2S0FgWYH3XE4uzjV+AoWbgQLC9 Xpe74rXxHWXm9SfrkQ2LX70d1OtgmXpFp1lQskwHd70XKk5baX3cNxo3F4dF8Vn6bdLS KZtZSLUHmOOzKnykkxtWAasUfapZ4UTrGxGZJKzu9lPoiZ8c6PjVSDNmfg42ZrNuMakY gPRLYwFzg8BQor9avGSLI6UtbJd58rp27J5x11p60azLadpEaYHLXiZVSmWFjicQx1Px sNhQ== X-Gm-Message-State: AOJu0YyADflUW0mDRJONOD19HGGkAyTz8X2QHMI8EWAVfGoR+o1b1vzg iA8Iz7K4lGGNTqRzgLk/Y9fJqIs9gbq05+ChDF12hl/XiAc= X-Google-Smtp-Source: AGHT+IFvQDjX4Qjucycb++5VWOI2jLOOMH+Wx2ZLH794+gLqcbI+zsDutHTRA0DSm8qmQtyIFDLsiNvxBZ4QIXnJYtw= X-Received: by 2002:a19:644a:0:b0:4fe:3a57:7c98 with SMTP id b10-20020a19644a000000b004fe3a577c98mr737575lfj.32.1693944808140; Tue, 05 Sep 2023 13:13:28 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Tue, 5 Sep 2023 13:13:27 -0700 From: Stefan Kangas MIME-Version: 1.0 Date: Tue, 5 Sep 2023 13:13:27 -0700 Message-ID: Subject: To: control@debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tags 65470 + patch thanks Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (stefankangas[at]gmail.com) 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:12f listed in] [list.dnswl.org] 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines 2.0 BLANK_SUBJECT Subject is present but empty X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tags 65470 + patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 05:00:00 2023 Received: (at 65470) by debbugs.gnu.org; 7 Sep 2023 09:00:00 +0000 Received: from localhost ([127.0.0.1]:38557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeAro-0000Sr-0F for submit@debbugs.gnu.org; Thu, 07 Sep 2023 05:00:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeArm-0000Sc-2w for 65470@debbugs.gnu.org; Thu, 07 Sep 2023 04:59:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qeArd-0008SC-S7; Thu, 07 Sep 2023 04:59:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=uQHsj1z4KShlhPT2rJFApf+ZXFB5tupoJrhwc9O+UVo=; b=BTDkAUrn8kctpn541s7B a2QHSCaMRlu6vroAGFAMcI6OF3Y9+J7JgBWXkFrzoa+RWcYRAtXseGbrhVR6RYWoC3f432dS3e0AB ypoLgJJeXDbE09wTKGCGiWhOyer6XKsFH93bagEF/SkBBP80HZ3bdsdHEoxhsVAg6ja2hpiJSyWma kWuIWdbIufmTF3xj36BFpdfd/2gLXS7ZOIrCwjA5afAfH0tYOzDMkepqJYlmHHs1f5Wi1aFNak+mc 2QJyQQ7hqyRMhEVEiodt5/EbkTY+04mjxDD+2+x3t4oD/C4YahwIlcEa+n4Y18bEB/RF/qwH11fE3 4T1FvcBQt2ltTQ==; Date: Thu, 07 Sep 2023 11:59:37 +0300 Message-Id: <83tts6z7d2.fsf@gnu.org> From: Eli Zaretskii To: Jostein =?utf-8?Q?Kj=C3=B8nigsen?= In-Reply-To: <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> (message from Jostein =?utf-8?Q?Kj=C3=B8nigsen?= on Tue, 5 Sep 2023 21:31:25 +0200) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, dmitry@gutov.dev, casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Jostein Kjønigsen > Date: Tue, 5 Sep 2023 21:31:25 +0200 > Cc: Eli Zaretskii , > Yuan Fu , > Theodor Thornhill , > Jostein Kjønigsen , > btuin@mailo.com, > 65470@debbugs.gnu.org > > Sorry for the somewhat slow response on this. Life has been busy for me as well :) > > Based on the infamous “copy, paste & adapt” methodology I’ve come up with a patch for typescript-ts-mode and tsx-ts-mode which seems to work for the simple test case provided above. > > However the patch for js-ts-mode has lots of … interesting stuff about jsx I have not included, for no other reason than not understanding what type of use-cases they are meant to support. > > If someone can provide me some examples for the JSX use-cases, I can try to make room for TSX-variants of the same code. > > The patch so far is attached. It’s intentionally -not- optimized to leave room for TSX cases which may arise, so hopefully no need to nitpick this yet. Thanks, Jostein. Any objections to my installing this on the emacs-29 branch, anyone? From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 05:02:30 2023 Received: (at 65470) by debbugs.gnu.org; 7 Sep 2023 09:02:31 +0000 Received: from localhost ([127.0.0.1]:38561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeAuE-0003DY-KA for submit@debbugs.gnu.org; Thu, 07 Sep 2023 05:02:30 -0400 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]:59729) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeAu9-0003DI-5H for 65470@debbugs.gnu.org; Thu, 07 Sep 2023 05:02:29 -0400 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2bcd7a207f7so11850921fa.3 for <65470@debbugs.gnu.org>; Thu, 07 Sep 2023 02:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1694077337; x=1694682137; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=1nJN1U35DvHM1/8RfYN9gYNbmNIsuJLbPOJAhLLsmUM=; b=n3HDm+H9L32rhrqjmB9uLq1hRIs7gRBNg6o3+HT+A47xocFpGO9opyPe1PuBdczyMt YBuvbwuSZTydN/Vfxkiv8E0SXwlgtBBDeMS5IAW54jUDdlJkQw1SOCuKSXYE1PDgCZDq MVSrQJN3/bg974wS0EVsmQcB3RANSKVRk6TRQk1hUBABSF0VeU5dx8nWGLjOV1w7vn+P ue+Fl7RaTpNaZ3I30JcVFx086w+GMmebZbzRSaj0Y5TbgU+jg+olDazwxFDBY+2PJTMO MmY4E7635LWJMIRlj27voX9b2RLqXxtOOX6RBECiq/szgkvIWGy/JuqhAU3pFyhZfrfA CEgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694077337; x=1694682137; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1nJN1U35DvHM1/8RfYN9gYNbmNIsuJLbPOJAhLLsmUM=; b=avSHFFWmhM66uGIl21leSTBIthsrOR44EzhDOXYMTd9mye30gbtk+f2FwKu7XkhjXb 5eCleyRpFZQHyDDlpTn6hWc7AD3sXzn9zmrwJ6QYprw2ycA8GdfadY/BpUYOLIMIcvz+ iOdlh8n0hQ5FqoYbEPi9eSl9uTweNdb1kky1rL8vpaJ2YCo6/yu00VTz9DeQXoSN6955 zD3QLp2IT1AcTRVhBGoOGIGb4mo06WdmpkBVmdzOxZ1NinnzabSXbCyYbrjfwuNzCQFK rU7oQkFbRA73vRn+0lYF27vUwDLlmUVTde+h1VXCxw65ziS3XeL+1cIA1ddASxTbybqF QwAg== X-Gm-Message-State: AOJu0YzF02UAGy2bJ1YPr0bb5Aonj5ibaX+ePZ6/cDcbOux4pl+oiAsO 8Romg4yNEyKQ3z054QKIsSRUVJvd3auFgNSWpiU= X-Google-Smtp-Source: AGHT+IHDS0eDtMdbvanjfglv1HZNCoeZ2/sFKIYz+b6ONXjt9cejphmkDsFTv4Y1Pg/lGSrGGJSgrd/ObgT759+YEPA= X-Received: by 2002:a2e:8708:0:b0:2bb:aaec:abad with SMTP id m8-20020a2e8708000000b002bbaaecabadmr4089226lji.30.1694077337554; Thu, 07 Sep 2023 02:02:17 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Thu, 7 Sep 2023 02:02:17 -0700 From: Stefan Kangas In-Reply-To: <83tts6z7d2.fsf@gnu.org> References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <83tts6z7d2.fsf@gnu.org> MIME-Version: 1.0 Date: Thu, 7 Sep 2023 02:02:17 -0700 Message-ID: Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching To: Eli Zaretskii , =?UTF-8?Q?Jostein_Kj=C3=B8nigsen?= Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, dmitry@gutov.dev, casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: > Any objections to my installing this on the emacs-29 branch, anyone? No objections here. From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 07 08:09:54 2023 Received: (at 65470) by debbugs.gnu.org; 7 Sep 2023 12:09:54 +0000 Received: from localhost ([127.0.0.1]:38762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeDpa-0002K1-CK for submit@debbugs.gnu.org; Thu, 07 Sep 2023 08:09:54 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:36365) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qeDpW-0002Jn-Ib for 65470@debbugs.gnu.org; Thu, 07 Sep 2023 08:09:52 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id BF9EA5C0189; Thu, 7 Sep 2023 08:09:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 07 Sep 2023 08:09:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694088583; x=1694174983; bh=9PA2gtLFo7nALlrsElrJoNDwkUbj3Ltj/iQ mw7MBjS0=; b=TWSFEsQLBPbbiE+FBY/htAKRdOTvIO5ggpx/Tg/MJhtCg4BbHb6 /IHkQEBDX7nCgsBpt63OW2Am7rdPorSymesfuhH1WXRFVInqp/DSk4JTpc0bXGER 415n0eTykhGovpzV0igbPNL0MCyTKpe8EPR5rrxg5bE3aG+T0Gbpsq41v/Fee4IB 77EPdsB7BVA/b/8GiV2Q3YCCOmH9HHWBa+IQ2VtUEGvIJKqWl85PD+9DUAfirk1b OWEGRLbkuyMRmE/XAIKFgYKSREUu7fzQASJtHeP020bnGypjIC0TxMg8Fi6TVAod CmAKRnGtaJAP/8LEzPAkKHry/W+0VsrMJ+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694088583; x=1694174983; bh=9PA2gtLFo7nALlrsElrJoNDwkUbj3Ltj/iQ mw7MBjS0=; b=QKdCDpSON0UoS6HR6275aoQAkhaivgZ2b2Uo/YmRr20ZZU5Cj3P CzBxz35Amqs4zXXrmd8iukrs5CopBFH2yKX6w7ObuWy1Su+DDHpSaf3MgcD4vFJi 7rU/bNxjuGc+XVVX1Bzy12cgXyZK17ZXCzIs6XSVWYd37YvpgoupWiLxQ1ZVtJ6N Mn32PO5/FP+k8CVnstfGMxwI1bN8WCPcHpTrDkfz5+egDmREHEFXzfrWnnYCMq+I VAi6MBOiPk0/SBJDHzxVyfseq/9jkLgm/7oU81VS0+bDxJbnhCA4y7PXn7JTKowl ZakbKtZNMAfMQpcAuyASsv9jV6ePSbJW3bQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudehhedggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Sep 2023 08:09:41 -0400 (EDT) Message-ID: <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> Date: Thu, 7 Sep 2023 15:09:39 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> From: Dmitry Gutov In-Reply-To: <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 05/09/2023 22:31, Jostein Kjønigsen wrote: > The patch so far is attached. It’s intentionally -not- optimized to leave room for TSX cases which may arise, so hopefully no need to nitpick this yet. I was going to nitpick it, but then read the rest of your message ;-( > However the patch for js-ts-mode has lots of … interesting stuff about jsx I have not included, for no other reason than not understanding what type of use-cases they are meant to support. > > If someone can provide me some examples for the JSX use-cases, I can try to make room for TSX-variants of the same code. The idea was to "enclose" every TSX in "generic string" syntax so that whatever unpaired characters are inside (such as (, ", ...), won't affect syntax-ppss status on the outside. I'm not sure how critical that is, but I guess some users might encounter such situations. Examples like: ReactDOM.render(

Hello, Welcome to React and TypeScript ;-(

, // type closing paren here and see that it's matched to opener above document.getElementById("root") ); From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 15:38:01 2023 Received: (at 65470) by debbugs.gnu.org; 11 Sep 2023 19:38:01 +0000 Received: from localhost ([127.0.0.1]:54904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfmjR-0002sj-BM for submit@debbugs.gnu.org; Mon, 11 Sep 2023 15:38:01 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:35823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfmjM-0002sB-Ms for 65470@debbugs.gnu.org; Mon, 11 Sep 2023 15:37:59 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id EF3875C00AC; Mon, 11 Sep 2023 15:37:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 11 Sep 2023 15:37:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694461066; x=1694547466; bh=0UTxWWHdmRxm5u1MqTag9sl4H7p8RaK9gkF R6o6Djic=; b=sIzypUQRnHQdvK7R29AUnWc0df3XPdXO3Us9ViRvhm4yXjsl82o x/BSGdH+mKwk7+E7V7UwVL8OLC2teKZOlxACmeUZ4GOCQVNh9rI/nnsy9aFF288t uoMSDOLnuBJklHOF2ejnskDU16kccT/FoWo7Ll5Yvii4D6mmgT4k8EejGBcQRzF7 Y8YxCxdvPJQRbT1hXf0XB24rnT0B1n4AgQvk9nezU34OJ13+gQf8Jv/f7xElLjig AxRjfNGDu83i9LlBLOwn9lZd+JgSg6k0IJnoqRTzzaDS0uOx2BBC+h4t8Osg2vIA BPO8oIi2MfbqJW7iB2xTmxkG9LIxbUT+0Fw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1694461066; x=1694547466; bh=0UTxWWHdmRxm5 u1MqTag9sl4H7p8RaK9gkFR6o6Djic=; b=iyq2fv41yL2JDUQQg5n/qpEVAmmd2 Au9EQCkSHYwV+dgM/lwJZ7O8PCrXa9V5fGbAEQLRHWnIDttDHZJZJFOR2M4QPDQY rquXGSJTreD8BPpd4PH+cNDgzm1FEYnuyyZt2eUfuhAMCDMwjXKHauS+rHlKpkv9 p87OGdyVaOo4DPuVzSbeSFn2Dhw+FX9tzPcUlx09zmTYY2ikyLoRy+uDhiiYPZgs +N8qI5XPp4mmKd/s3vYeB2XCcJSjLoK/YMh9SKF33NFmOa9QtpDlau19eVUCXbKS cRGg/qssArBbGLC5O4a+IzhaT5bJCkWWRpEaFGaB3enjecmNDWWfamlGg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeigedgudefjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhkfgtggfuffgjvefvfhfosehmtdhmrehhtdejnecuhfhrohhmpeflohhs thgvihhnucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonh highhsvghnrdhnvghtqeenucggtffrrghtthgvrhhnpeejtdejffeggfeuffeuvefhveek ffdtiedtffelteeuiefgvdejheeihfehheekgfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhn ihhgshgvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Sep 2023 15:37:44 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_534169EB-EDC4-4502-8530-9ADE1A4AB4EE" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Mon, 11 Sep 2023 21:37:33 +0200 In-Reply-To: <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> To: Dmitry Gutov References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Apple-Mail=_534169EB-EDC4-4502-8530-9ADE1A4AB4EE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 7 Sep 2023, at 14:09, Dmitry Gutov wrote: >=20 > On 05/09/2023 22:31, Jostein Kj=C3=B8nigsen wrote: > > The patch so far is attached. It=E2=80=99s intentionally -not- = optimized to leave room for TSX cases which may arise, so hopefully no = need to nitpick this yet. >=20 > I was going to nitpick it, but then read the rest of your message ;-( >=20 >> However the patch for js-ts-mode has lots of =E2=80=A6 interesting = stuff about jsx I have not included, for no other reason than not = understanding what type of use-cases they are meant to support. >> If someone can provide me some examples for the JSX use-cases, I can = try to make room for TSX-variants of the same code. >=20 > The idea was to "enclose" every TSX in "generic string" syntax so that = whatever unpaired characters are inside (such as (, ", ...), won't = affect syntax-ppss status on the outside. I'm not sure how critical that = is, but I guess some users might encounter such situations. >=20 > Examples like: >=20 > ReactDOM.render( >
>

Hello, Welcome to React and TypeScript ;-(

>
, > // type closing paren here and see that it's matched to opener = above > document.getElementById("root") > ); >=20 Ok. That makes sense, and explains everything. I=E2=80=99ve tried = implementing the same thing for tsx-ts-mode too in the attached patch. = (You may start nitpicking now). I first tried using a more naive and wide approach only trying to = capture full (jsx_element) blocks without any further constraints. What I found was that when having nested elements (which one tend to = have all the time), the syntax-propertizing would cancel itself for = every second nesting. So to fix that, I=E2=80=99ve tried to anchor the query to top-level = constructs which typically does not nest. Looking at the query for = js.el, I can only assume that you were trying to too solve the same = problem, Dmitry? But without further ado=E2=80=A6 Here=E2=80=99s the patch. Do your = worst, gentlemen :D --Apple-Mail=_534169EB-EDC4-4502-8530-9ADE1A4AB4EE Content-Disposition: attachment; filename=0001-typescript-ts-mode-Fix-syntax-properties-for-regexp-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-typescript-ts-mode-Fix-syntax-properties-for-regexp-.patch" Content-Transfer-Encoding: quoted-printable =46rom=202f08456a4aa6a093cbda4359af31edcd5864a44c=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Tue,=205=20Sep=202023=2021:29:27=20= +0200=0ASubject:=20[PATCH]=20typescript-ts-mode:=20Fix=20syntax=20= properties=20for=20regexp=0A=20expressions.=0A=0A-=20Also=20handle=20= JSX-elements=20in=20TSX-files=20as=20generic=20strings.=0A---=0A=20= lisp/progmodes/typescript-ts-mode.el=20|=2036=20= ++++++++++++++++++++++++++++=0A=201=20file=20changed,=2036=20= insertions(+)=0A=0Adiff=20--git=20a/lisp/progmodes/typescript-ts-mode.el=20= b/lisp/progmodes/typescript-ts-mode.el=0Aindex=20= 441cdc1f7aa..dd61baf5e3c=20100644=0A---=20= a/lisp/progmodes/typescript-ts-mode.el=0A+++=20= b/lisp/progmodes/typescript-ts-mode.el=0A@@=20-473,6=20+473,7=20@@=20= typescript-ts-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(keyword=20string=20escape-sequence)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(constant=20expression=20identifier=20number=20= pattern=20property)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(function=20bracket=20delimiter)))=0A+=20=20=20=20(setq-local=20= syntax-propertize-function=20#'ts-ts--syntax-propertize)=0A=20=0A=20=20=20= =20=20(treesit-major-mode-setup)))=0A=20=0A@@=20-529,9=20+530,44=20@@=20= tsx-ts-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (keyword=20string=20escape-sequence)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(constant=20expression=20identifier=20jsx=20number=20= pattern=20property)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(function=20bracket=20delimiter)))=0A+=20=20=20=20(setq-local=20= syntax-propertize-function=20#'tsx-ts--syntax-propertize)=0A=20=0A=20=20=20= =20=20(treesit-major-mode-setup)))=0A=20=0A+(defvar=20ts-ts--s-p-query=0A= +=20=20(when=20(treesit-available-p)=0A+=20=20=20=20= (treesit-query-compile=20'typescript=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'(((regex=20pattern:=20= (regex_pattern)=20@regexp))))))=0A+=0A+(defvar=20tsx-ts--s-p-query=0A+=20= =20(when=20(treesit-available-p)=0A+=20=20=20=20(treesit-query-compile=20= 'tsx=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20'(((regex=20pattern:=20(regex_pattern)=20@regexp))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20((arguments=20(jsx_element)=20@jsx))=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ((parenthesized_expression=20(jsx_element)=20@jsx))))))=0A+=0A+(defun=20= ts-ts--syntax-propertize=20(beg=20end)=0A+=20=20(let=20((captures=20= (treesit-query-capture=20'typescript=20ts-ts--s-p-query=20beg=20end)))=0A= +=20=20=20=20(ts-ts--syntax-propertize-captures=20captures)))=0A+=0A= +(defun=20tsx-ts--syntax-propertize=20(beg=20end)=0A+=20=20(let=20= ((captures=20(treesit-query-capture=20'tsx=20tsx-ts--s-p-query=20beg=20= end)))=0A+=20=20=20=20(ts-ts--syntax-propertize-captures=20captures)))=0A= +=0A+(defun=20ts-ts--syntax-propertize-captures=20(captures)=0A+=20=20= (pcase-dolist=20(`(,name=20.=20,node)=20captures)=0A+=20=20=20=20(let*=20= ((ns=20(treesit-node-start=20node))=0A+=20=20=20=20=20=20=20=20=20=20=20= (ne=20(treesit-node-end=20node))=0A+=20=20=20=20=20=20=20=20=20=20=20= (syntax=20(pcase-exhaustive=20name=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20('regexp=0A+=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20(cl-decf=20ns)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20(cl-incf=20ne)=0A+=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(string-to-syntax=20= "\"/"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ('jsx=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-syntax=20"|")))))=0A+=20=20=20=20=20=20(put-text-property=20= ns=20(1+=20ns)=20'syntax-table=20syntax)=0A+=20=20=20=20=20=20= (put-text-property=20(1-=20ne)=20ne=20'syntax-table=20syntax))))=0A+=0A=20= (if=20(treesit-ready-p=20'tsx)=0A=20=20=20=20=20(add-to-list=20= 'auto-mode-alist=20'("\\.tsx\\'"=20.=20tsx-ts-mode)))=0A=20=0A--=20=0A= 2.39.2=20(Apple=20Git-143)=0A=0A= --Apple-Mail=_534169EB-EDC4-4502-8530-9ADE1A4AB4EE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 =E2=80=94 Jostein= --Apple-Mail=_534169EB-EDC4-4502-8530-9ADE1A4AB4EE-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 11 18:23:39 2023 Received: (at 65470) by debbugs.gnu.org; 11 Sep 2023 22:23:39 +0000 Received: from localhost ([127.0.0.1]:55060 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfpJj-0001RH-HU for submit@debbugs.gnu.org; Mon, 11 Sep 2023 18:23:39 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:36045) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfpJe-0001Qz-6s for 65470@debbugs.gnu.org; Mon, 11 Sep 2023 18:23:37 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id B659F5C040F; Mon, 11 Sep 2023 18:23:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 11 Sep 2023 18:23:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694471004; x=1694557404; bh=A8o2q3HtoV67CFmBSXvd09m/kIAh6t64Bf5 3UE0KRlc=; b=sRMX7i1CPNYOsTzzaup1UHfwpkG/8SN+x74EOcpjQYZyYXDIsKp WR6n1y5AupXkcBNA8skROj0Ma8ry3zr9O5bR9X0iIyXTPrgaF12oSOxic7V3Msoq CnEo3et3tSZ0Ofz/8/ALx17o8byh9PuXSOtzBnIpF0EvxUDCb8nOmWXGqtRDcFjW jSap6lLUGkICx4vZjayU35E0TVV2Ze1VmLSkl9CUcZsqFOs1PuJUC5pgsknZpKB/ H/n/TGixYI9Bvle3eGu+8l598BBtveFq00jMa6vtLaBkRyCGFlIC6WTWBraxGyB6 ksnmUenITnJliiNkgmAUH4DwwEU7DatxptA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694471004; x=1694557404; bh=A8o2q3HtoV67CFmBSXvd09m/kIAh6t64Bf5 3UE0KRlc=; b=nEi+T8/9VEqn2xFSHR9tmPq3jC/2Pxh4ZRZGYjgMddxijNXBXQl Q5s7Dd3tzpOuPEJWfIkMB1b3cy6d++oEYH6SWNIZGzOR5Y2hJVxBNSNB+TPk0ALS ssQpeJob/gakoh0LFernoEatoZR+DXNDvEwfnYEjIvLvaD2wLJkX2bQNcznRDuS3 LlJEW/X1KeKwOJPDe0SF5cA5Ws0ZUoikDC1++kGQRj+tig37z3nWJ2gLnNIAmz6n GJATEKkxKvTVKLagZyXjM47zCn/MwFkpPVL+DerEMsIxUJQbrrL9bijVXHdvC39h 5OnSIsnv89J5bfnT6KOHmkoNln+8RmBZGCQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeihedgtdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Sep 2023 18:23:21 -0400 (EDT) Message-ID: <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> Date: Tue, 12 Sep 2023 01:23:18 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) Hi Jostein! The patch looks good overall (though I haven't tested it). On 11/09/2023 22:37, Jostein Kjønigsen wrote: > So to fix that, I’ve tried to anchor the query to top-level constructs which typically does not nest. Looking at the query for js.el, I can only assume that you were trying to too solve the same problem, Dmitry? That's right. > + ((arguments (jsx_element) @jsx)) > + ((parenthesized_expression (jsx_element) @jsx)))))) These two contexts actually seem missing in my patch for js-ts-mode. :-) OTOH, it seems like the ones that _are_ included there, are missing here. Don't they? ((variable_declarator value: (jsx_element) @jsx)) corresponds do let v =
...
((assignment_expression right: (jsx_element) @jsx)) corresponds do v =

...

(with variable declared previously), and ((return_statement (jsx_element) @jsx)) corresponds to function f() { return

...
; } From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 02:30:10 2023 Received: (at 65470) by debbugs.gnu.org; 12 Sep 2023 06:30:10 +0000 Received: from localhost ([127.0.0.1]:55796 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfwuY-0004rd-BL for submit@debbugs.gnu.org; Tue, 12 Sep 2023 02:30:10 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:34547) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfwuV-0004q0-7R for 65470@debbugs.gnu.org; Tue, 12 Sep 2023 02:30:08 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 68A915C01BE; Tue, 12 Sep 2023 02:29:57 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Tue, 12 Sep 2023 02:29:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694500197; x=1694586597; bh=diupV9epe/WAB1dSYoAveuB/NbQoKDDhp1E u5i522Pk=; b=c/gyXublDDlyh58Y21gYblpgZX6dgBROduQSThCH0RKs4uFWYpK LYiVOQQyX83yEFlgkbLqyulhnI91oQzIW5BHQh+5ZtEp8VnB7Rnk+TUE+dab/uBk gCJCwmnZMI/jZG09Ho7IpnzHNS/cfUxpsJAxEXqLFgtVvf+rlEaAO81WefqDBRfG HjV5shUsSvlAdrekyy2Xr8pYLJinf82xCG1Y7Sy1KKjV4IKu/stpQGZFuU/vlCHQ 2laRVO0WzYKTYfYYUsFlD62ewnHT9NWJWppmwDDiRyMwysxaiV2PwODC/Wy9RdkC YN6tqdIuplM6IOTP2H0P2NgU3oEF1lMqmsg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1694500197; x=1694586597; bh=diupV9epe/WAB 1dSYoAveuB/NbQoKDDhp1Eu5i522Pk=; b=BVv8d3N3SBRuIQMzBIJxkyc5qOCUC 9Szek8Jjb/gQj4QUDvIlYKliD0F6ETN4m7ILRfXg8Ja2TT9ES/hC7SfvyCrkRAXz 5eVe7POyQX8sWtjDiNghM2xvZ6T+Fe/2ZdZDSvdzkmOEB0wdX8yduCxFqcCMkniV cS5/p5OXTcQyQtPaPZbRjhK9bjp/+ag2wvBYeedDNtCaJsv91uERUZt2p8iR914f jhdXxI63GV37BjjrIOAGLN3wcmt1Fl5JnAS83RVWVxeAJ7hNzhMKYgDEapgR23MB D07mBO/hqKLzP4Tm6XfgFoKr0ins40101oRu8gEL0sm6cS4vokv6HQCQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeihedguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhkfgtggfuffgjvefvfhfosehmtdhmrehhtdejnecuhfhrohhmpeflohhs thgvihhnucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonh highhsvghnrdhnvghtqeenucggtffrrghtthgvrhhnpeejtdejffeggfeuffeuvefhveek ffdtiedtffelteeuiefgvdejheeihfehheekgfenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhn ihhgshgvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Sep 2023 02:29:55 -0400 (EDT) From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= Message-Id: <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> Content-Type: multipart/mixed; boundary="Apple-Mail=_F29D2F9D-B7F9-424F-8522-303783573221" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Date: Tue, 12 Sep 2023 08:29:41 +0200 In-Reply-To: <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> To: Dmitry Gutov References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --Apple-Mail=_F29D2F9D-B7F9-424F-8522-303783573221 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 12 Sep 2023, at 00:23, Dmitry Gutov wrote: >=20 > Hi Jostein! >=20 > The patch looks good overall (though I haven't tested it). >=20 > On 11/09/2023 22:37, Jostein Kj=C3=B8nigsen wrote: >=20 > > So to fix that, I=E2=80=99ve tried to anchor the query to top-level = constructs which typically does not nest. Looking at the query for = js.el, I can only assume that you were trying to too solve the same = problem, Dmitry? >=20 > That's right. >=20 >> + ((arguments (jsx_element) @jsx)) >> + ((parenthesized_expression = (jsx_element) @jsx)))))) >=20 > These two contexts actually seem missing in my patch for js-ts-mode. = :-) >=20 > OTOH, it seems like the ones that _are_ included there, are missing = here. Don't they? >=20 > ((variable_declarator value: (jsx_element) @jsx)) >=20 > corresponds do >=20 > let v =3D
...
>=20 > ((assignment_expression right: (jsx_element) @jsx)) >=20 > corresponds do >=20 > v =3D

...

>=20 > (with variable declared previously), and >=20 > ((return_statement (jsx_element) @jsx)) >=20 > corresponds to >=20 > function f() { > return

...
; > } Good feedback. I=E2=80=99ve tested and included those as well. Attached = is a new patch. --Apple-Mail=_F29D2F9D-B7F9-424F-8522-303783573221 Content-Disposition: attachment; filename=0001-typescript-ts-mode-Fix-syntax-properties-for-regexp-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-typescript-ts-mode-Fix-syntax-properties-for-regexp-.patch" Content-Transfer-Encoding: quoted-printable =46rom=2016eb97efd5442e65eebd83bce2469aaee6d11697=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20=3D?UTF-8?q?Jostein=3D20Kj=3DC3=3DB8nigsen?=3D=20= =0ADate:=20Tue,=205=20Sep=202023=2021:29:27=20= +0200=0ASubject:=20[PATCH]=20typescript-ts-mode:=20Fix=20syntax=20= properties=20for=20regexp=0A=20expressions.=0A=0A-=20Also=20handle=20= JSX-elements=20in=20TSX-files=20as=20generic=20strings.=0A---=0A=20= lisp/progmodes/typescript-ts-mode.el=20|=2039=20= ++++++++++++++++++++++++++++=0A=201=20file=20changed,=2039=20= insertions(+)=0A=0Adiff=20--git=20a/lisp/progmodes/typescript-ts-mode.el=20= b/lisp/progmodes/typescript-ts-mode.el=0Aindex=20= 441cdc1f7aa..4bf4cf1f85f=20100644=0A---=20= a/lisp/progmodes/typescript-ts-mode.el=0A+++=20= b/lisp/progmodes/typescript-ts-mode.el=0A@@=20-473,6=20+473,7=20@@=20= typescript-ts-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20(keyword=20string=20escape-sequence)=0A=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20(constant=20expression=20identifier=20number=20= pattern=20property)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(function=20bracket=20delimiter)))=0A+=20=20=20=20(setq-local=20= syntax-propertize-function=20#'ts-ts--syntax-propertize)=0A=20=0A=20=20=20= =20=20(treesit-major-mode-setup)))=0A=20=0A@@=20-529,9=20+530,47=20@@=20= tsx-ts-mode=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (keyword=20string=20escape-sequence)=0A=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(constant=20expression=20identifier=20jsx=20number=20= pattern=20property)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20(function=20bracket=20delimiter)))=0A+=20=20=20=20(setq-local=20= syntax-propertize-function=20#'tsx-ts--syntax-propertize)=0A=20=0A=20=20=20= =20=20(treesit-major-mode-setup)))=0A=20=0A+(defvar=20ts-ts--s-p-query=0A= +=20=20(when=20(treesit-available-p)=0A+=20=20=20=20= (treesit-query-compile=20'typescript=0A+=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'(((regex=20pattern:=20= (regex_pattern)=20@regexp))))))=0A+=0A+(defvar=20tsx-ts--s-p-query=0A+=20= =20=20=20=20=20(when=20(treesit-available-p)=0A+=20=20=20=20=20=20=20=20= (treesit-query-compile=20'tsx=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'(((regex=20pattern:=20= (regex_pattern)=20@regexp))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= ((variable_declarator=20value:=20(jsx_element)=20@jsx))=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20((assignment_expression=20right:=20(jsx_element)=20@jsx))=0A+=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20((arguments=20(jsx_element)=20@jsx))=0A+=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20((parenthesized_expression=20(jsx_element)=20@jsx))=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20((return_statement=20(jsx_element)=20@jsx))))))=0A+=0A= +(defun=20ts-ts--syntax-propertize=20(beg=20end)=0A+=20=20(let=20= ((captures=20(treesit-query-capture=20'typescript=20ts-ts--s-p-query=20= beg=20end)))=0A+=20=20=20=20(ts-ts--syntax-propertize-captures=20= captures)))=0A+=0A+(defun=20tsx-ts--syntax-propertize=20(beg=20end)=0A+=20= =20(let=20((captures=20(treesit-query-capture=20'tsx=20tsx-ts--s-p-query=20= beg=20end)))=0A+=20=20=20=20(ts-ts--syntax-propertize-captures=20= captures)))=0A+=0A+(defun=20ts-ts--syntax-propertize-captures=20= (captures)=0A+=20=20(pcase-dolist=20(`(,name=20.=20,node)=20captures)=0A= +=20=20=20=20(let*=20((ns=20(treesit-node-start=20node))=0A+=20=20=20=20=20= =20=20=20=20=20=20(ne=20(treesit-node-end=20node))=0A+=20=20=20=20=20=20=20= =20=20=20=20(syntax=20(pcase-exhaustive=20name=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20('regexp=0A+=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20(cl-decf=20ns)=0A+=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(cl-incf=20ne)=0A+=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (string-to-syntax=20"\"/"))=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20('jsx=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(string-to-syntax=20"|")))))=0A+=20=20=20=20=20=20= (put-text-property=20ns=20(1+=20ns)=20'syntax-table=20syntax)=0A+=20=20=20= =20=20=20(put-text-property=20(1-=20ne)=20ne=20'syntax-table=20= syntax))))=0A+=0A=20(if=20(treesit-ready-p=20'tsx)=0A=20=20=20=20=20= (add-to-list=20'auto-mode-alist=20'("\\.tsx\\'"=20.=20tsx-ts-mode)))=0A=20= =0A--=20=0A2.39.2=20(Apple=20Git-143)=0A=0A= --Apple-Mail=_F29D2F9D-B7F9-424F-8522-303783573221 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 =E2=80=94 Jostein --Apple-Mail=_F29D2F9D-B7F9-424F-8522-303783573221-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 12 19:15:16 2023 Received: (at 65470) by debbugs.gnu.org; 12 Sep 2023 23:15:16 +0000 Received: from localhost ([127.0.0.1]:60290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgCbE-0000kp-Fd for submit@debbugs.gnu.org; Tue, 12 Sep 2023 19:15:16 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:42601) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgCbB-0000kb-Hm for 65470@debbugs.gnu.org; Tue, 12 Sep 2023 19:15:14 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 668EA5C00B7; Tue, 12 Sep 2023 19:15:03 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 12 Sep 2023 19:15:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694560503; x=1694646903; bh=7UNHWa7WMQUrSf4s1YSvPkDnuDNBiEmSTr+ oeAwU9Vk=; b=ALgUFPzMY7k7C9W3H5FBJ7+4qgyS1hvLCQS8mzDXowsIx47lAc6 BPouaKDOdBzNhp34qo9vm9A6CrC+Y+R+uLEP6crC9i6ga6wBXhf7+y25718wIcle AbSgrTlOsCVWtB64f4uCN12UmdUqeSDSMs6DHMQ5onbGa6ceScQjyJa0sIl7JCQ5 8kH81zJ6dDy9Q0rRuNUsKsQacyW7wfv57Igtn6S1ZchOjXdOLMqyyaWmmbCKE5qI 6d+AWATBiBOX18TAerbrKHXzuRb82p6VqW6npW0qrAsJJ/Q2hPUIDcw2pATWBn06 B9XvGkoS2rLhFXjuFJB2y2ZTSAwPGj9P8vg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1694560503; x=1694646903; bh=7UNHWa7WMQUrSf4s1YSvPkDnuDNBiEmSTr+ oeAwU9Vk=; b=dQaB9Ymq7BuZqlQn20BuKzJsh7AZ9lzFMys1zxsFq4RAgX20axY oG7CQSsnLZaLhxJaUjv+mCFk7n9ULPG7IiU8+H6GUm/JKftoyUbC+/6kF/z/FQRU ITzthXfC9DegJIq/cZ1myD5fCNvP6SAvMc982sBMt5oiAiyZ9xdarONB4BWpColw zsabdiuJS0CGyN1VVR5eo6ebe3t1fs+rlOQIcXdplea0Wl8eZoODM5BFXKvh3F9i FtnwcuJHXCBANZVBa4xRSGKVTu15BBpgJ6TdxP91Lm1zjHCEcacWeL9zYLtcLUZk Df+tibzY2PaYvZkNcaBjOFmwFDhUgLdb1+g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeijedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Sep 2023 19:15:01 -0400 (EDT) Message-ID: Date: Wed, 13 Sep 2023 02:14:59 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> From: Dmitry Gutov In-Reply-To: <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 12/09/2023 09:29, Jostein Kjønigsen wrote: > Good feedback. I’ve tested and included those as well. Attached is a new patch. Thanks! Installed. It would've been better with a commit message too (next time). Speaking of the TSX difficulties, though, which Yuan hinted at recently: I think the current fix (tsx-ts-mode--font-lock-compatibility-bb1f97b) is not working. To be clear, that's unrelated to the current patch. Basically, the query for ((member_expression) @capture) succeeds, but then the more complex one fails with Structure error at: 22 (jsx_opening_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face) (jsx_closing_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face) (jsx_self_closing_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face) This patch seems to fix that and bring JSX syntax highlighting back: diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 57382c9cb31..7108ff49b28 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -163,7 +163,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b ;; but then raises an error if the wrong node type is used. So it is ;; important to check with the new node type (member_expression) (condition-case nil - (progn (treesit-query-capture language '((member_expression) @capture)) + (progn (treesit-query-capture language '(jsx_opening_element (member_expression) @capture)) '((jsx_opening_element [(member_expression (identifier)) (identifier)] @typescript-ts-jsx-tag-face) From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 15 08:11:43 2023 Received: (at 65470) by debbugs.gnu.org; 15 Sep 2023 12:11:43 +0000 Received: from localhost ([127.0.0.1]:42319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh7fi-00064N-JS for submit@debbugs.gnu.org; Fri, 15 Sep 2023 08:11:42 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:54855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh7fg-000649-LM for 65470@debbugs.gnu.org; Fri, 15 Sep 2023 08:11:41 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id A3CE8320034E; Fri, 15 Sep 2023 08:11:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Fri, 15 Sep 2023 08:11:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= secure.kjonigsen.net; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1694779886; x=1694866286; bh=7S zfr26V9W6mAzx9+z3AyqgbHu3cOspRkuLM06b7MtE=; b=AWkIK1k8I1xLXQhYw8 JCGKV/vsfIH8UJyoBXy2RKaP4o4gphbsz0pTLgxsShvx0Yba8vxRhxKgXQli53Se 6Lc+b8BnU0a9J5/YB2GxlB+aflkqKL054OBagnTtU5Iv+S8SAF7qrKomYYE+iY0C I42Jdcncl90LWiHCO9Wyhf+4PruR80mOXKrDDYLKAtQXY0n1OoBO1XO4AQl+Vapw P7Ok3Z6ayux2LrfD7ETS/3PYOxZNcoqubosyd/p/c/Z2xCSgTQopaHidCzS4UnKG Vl6RQIRhb0l4kGZmeMT8YIRvScqlTExOAyrs2JpaBR1aCWbBUOrepKQoYLEV+b6E 4Qvg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694779886; x=1694866286; bh=7Szfr26V9W6mAzx9+z3AyqgbHu3cOspRkuL M06b7MtE=; b=hmb/AobkgErKz2JNZbG9Fz3cTja5DwMm4gPgPlQdupiVyPw0zUv BxdyPzVQPCpCMAEH1nExKNe5NasaDo2B+hWPQDbciEtZ2ZKo4alOTlIHdFEv6DEf XVCsJYhBplQIpRk5/kxJvQdMNhd9FJc/oEo2bbg/IQLcpPhl2cuKgMQw1hUN/LaK 9m0ajOT0vHlRDQKnbIE0PI9nmSUX1pibqNqzTPkWhdmpAwRrJN16UlMXrWDE4W/T /y6cdfnsfGe65ooBFDtmsLsZtTmWPwcyQooiErNfsqEyMIMGsL5TbbS8t+5ZGxWw 89fa7iwBv3Kxv59APHgi8LSnEUyS1jc+hfQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejvddggeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffvefgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpeflohhs thgvihhnucfmjhppnhhighhsvghnuceojhhoshhtvghinhesshgvtghurhgvrdhkjhhonh highhsvghnrdhnvghtqeenucggtffrrghtthgvrhhnpeevueffheeiledttdegudegveef tedtheelteetjedvieejhfdvtdffvdduheehtdenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehjohhsthgvihhnsehsvggtuhhrvgdrkhhjohhn ihhgshgvnhdrnhgvth X-ME-Proxy: Feedback-ID: ib2f84088:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Sep 2023 08:11:24 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching From: =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= In-Reply-To: Date: Fri, 15 Sep 2023 14:11:12 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> To: Dmitry Gutov X-Mailer: Apple Mail (2.3731.700.6) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?utf-8?Q?Jostein_Kj=C3=B8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > On 13 Sep 2023, at 01:14, Dmitry Gutov wrote: >=20 > On 12/09/2023 09:29, Jostein Kj=C3=B8nigsen wrote: >> Good feedback. I=E2=80=99ve tested and included those as well. = Attached is a new patch. >=20 > Thanks! Installed. It would've been better with a commit message too = (next time). >=20 > Speaking of the TSX difficulties, though, which Yuan hinted at = recently: I think the current fix = (tsx-ts-mode--font-lock-compatibility-bb1f97b) is not working. To be = clear, that's unrelated to the current patch. >=20 > Basically, the query for ((member_expression) @capture) succeeds, but = then the more complex one fails with >=20 > Structure error at: 22 > (jsx_opening_element [(member_expression (identifier)) (identifier)] = @typescript-ts-jsx-tag-face) (jsx_closing_element [(member_expression = (identifier)) (identifier)] @typescript-ts-jsx-tag-face) = (jsx_self_closing_element [(member_expression (identifier)) = (identifier)] @typescript-ts-jsx-tag-face) >=20 > This patch seems to fix that and bring JSX syntax highlighting back: >=20 > diff --git a/lisp/progmodes/typescript-ts-mode.el = b/lisp/progmodes/typescript-ts-mode.el > index 57382c9cb31..7108ff49b28 100644 > --- a/lisp/progmodes/typescript-ts-mode.el > +++ b/lisp/progmodes/typescript-ts-mode.el > @@ -163,7 +163,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b > ;; but then raises an error if the wrong node type is used. So it is > ;; important to check with the new node type (member_expression) > (condition-case nil > - (progn (treesit-query-capture language '((member_expression) = @capture)) > + (progn (treesit-query-capture language '(jsx_opening_element = (member_expression) @capture)) > '((jsx_opening_element > [(member_expression (identifier)) (identifier)] > @typescript-ts-jsx-tag-face) >=20 I really don=E2=80=99t know this part of the code very well. If you=E2=80=99= ve identified an issue/bug for a specific TSX use-case, and found a fix = for it, I have no objections to it being applied. =E2=80=94 Jostein From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 15 09:36:16 2023 Received: (at 65470) by debbugs.gnu.org; 15 Sep 2023 13:36:17 +0000 Received: from localhost ([127.0.0.1]:42441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh8zY-0008WC-K9 for submit@debbugs.gnu.org; Fri, 15 Sep 2023 09:36:16 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:38203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qh8zT-0008Vt-Of for 65470@debbugs.gnu.org; Fri, 15 Sep 2023 09:36:15 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 2B4A65C00DB; Fri, 15 Sep 2023 09:36:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Fri, 15 Sep 2023 09:36:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694784960; x=1694871360; bh=qRASEDU+7czjkuGIHtwNQjAq6TypVpZapQ1 cgB6xCjA=; b=mfIkYg8DekbUV9uEVP+a3GSx/Lr614RX0OfU2BSmorHH9M0YDZW xcMI3+1uc1Y0IivJTtih87w1hw0MDTYlAFrLkn4WApopEcsrWd9IA0RuZht0sWRI zyoNes1pjsQgf8eiT/1kFHOE4KGsO4th7KX8+DG9V3PewoTXdlfzbCzTwWdQEugs eTa06Ncvm2TYp526lCB4CZ9CesP2nPtJm3ucxBiHx1ZxP+tgksYznwOkivMWFDoE fXkY90KGM1zmqKidYSPHMPb63qPB7wZLAEM1nHG5//xQ9+z7iZiGuwwt/g4lT/ri LRhKK6C4oGU2BofwSoHQk4ysDT9WllfmPlQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694784960; x=1694871360; bh=qRASEDU+7czjkuGIHtwNQjAq6TypVpZapQ1 cgB6xCjA=; b=F+xRHhGHY11pP+GEi+4JK/2/F4cCAU+DnTL5A5R8wYwWTNQPU4A cgBZ5yCcAkGgTHwWq0xAIYlsFm6MdSn1a8JFeiJOBdvyVOlt1chdD9c032QrBSUI i72V6WdJTYx3OchMb1LpilheFyFJN7ucv3q2j3uJ9XRIAgLQS+2eXo8jR3R3FQb3 3wEM2aPw+VaQ/dpa8vvCsEBcomnGpFtOeW5t7v0PrxSq6LElUOmCcfgEoxCBwIQg 6S6NPh7rh00P7aYiSyJOroQHKQ29L6Aw6TZyDBFjwyGKRR03MAe7UO+wh2ZdhQUR DYmwdr3owi3DMT2JlL16EbgJ2LhZaIG4ybA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejvddgieegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Sep 2023 09:35:57 -0400 (EDT) Message-ID: <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> Date: Fri, 15 Sep 2023 16:35:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 65470 Cc: Yuan Fu , 65470@debbugs.gnu.org, Theodor Thornhill , btuin@mailo.com, Eli Zaretskii , =?UTF-8?Q?Jostein_Kj=c3=b8nigsen?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 15/09/2023 15:11, Jostein Kjønigsen wrote: >> This patch seems to fix that and bring JSX syntax highlighting back: >> >> diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el >> index 57382c9cb31..7108ff49b28 100644 >> --- a/lisp/progmodes/typescript-ts-mode.el >> +++ b/lisp/progmodes/typescript-ts-mode.el >> @@ -163,7 +163,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b >> ;; but then raises an error if the wrong node type is used. So it is >> ;; important to check with the new node type (member_expression) >> (condition-case nil >> - (progn (treesit-query-capture language '((member_expression) @capture)) >> + (progn (treesit-query-capture language '(jsx_opening_element (member_expression) @capture)) >> '((jsx_opening_element >> [(member_expression (identifier)) (identifier)] >> @typescript-ts-jsx-tag-face) >> > I really don’t know this part of the code very well. If you’ve identified an issue/bug for a specific TSX use-case, and found a fix for it, I have no objections to it being applied. No problem, pushed that to emacs-29, thanks. Just wanted to notify in advance in case somebody had an opinion on this change. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 01:54:57 2023 Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 05:54:57 +0000 Received: from localhost ([127.0.0.1]:45228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhOGe-0002Mq-Nx for submit@debbugs.gnu.org; Sat, 16 Sep 2023 01:54:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42152) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhOGb-0002MY-HT for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 01:54:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhOGN-0002c2-Sx; Sat, 16 Sep 2023 01:54:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=X1RPKOfT8MNnZ2Kr7sOn3uA0Ltri+huVMnksIYIilHU=; b=DvcJ+IN4UjpKZTo2g/Cj orkajFiSow8fWVlFv8DiQCL0Kd460ptbHdzu+GdPe2gyv9QPgBDl77ctHvqZKxVK1g+C4bv5DqWyM 6I/14/80M/WdCX4mNXBQfnL7b5Q8UVeEpu+CTiKEJzODNqRPiEpt8hqmaVUIxlN02A1qHeomjM1HG +WJxwdgVpCB111739e52SObtmsH0X6AgOzU+3a+M1kFD7cf47X/MUZSZYUbAm0xDqR+3SMKCRJ/p0 CNsn7xhhm9snbWZorna/t3Y9u0c11FpeGruK3MyBLDSspZm1ku6PHUcm+gsmg+yqC6bwahQjqshxA pQcradN6f/MIQA==; Date: Sat, 16 Sep 2023 08:54:32 +0300 Message-Id: <835y4ak6hz.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov , Stefan Monnier In-Reply-To: <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> (message from Dmitry Gutov on Fri, 15 Sep 2023 16:35:55 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Fri, 15 Sep 2023 16:35:55 +0300 > Cc: Eli Zaretskii , Yuan Fu , > Theodor Thornhill , > Jostein Kjønigsen , btuin@mailo.com, > 65470@debbugs.gnu.org > From: Dmitry Gutov > > On 15/09/2023 15:11, Jostein Kjønigsen wrote: > >> This patch seems to fix that and bring JSX syntax highlighting back: > >> > >> diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el > >> index 57382c9cb31..7108ff49b28 100644 > >> --- a/lisp/progmodes/typescript-ts-mode.el > >> +++ b/lisp/progmodes/typescript-ts-mode.el > >> @@ -163,7 +163,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b > >> ;; but then raises an error if the wrong node type is used. So it is > >> ;; important to check with the new node type (member_expression) > >> (condition-case nil > >> - (progn (treesit-query-capture language '((member_expression) @capture)) > >> + (progn (treesit-query-capture language '(jsx_opening_element (member_expression) @capture)) > >> '((jsx_opening_element > >> [(member_expression (identifier)) (identifier)] > >> @typescript-ts-jsx-tag-face) > >> > > I really don’t know this part of the code very well. If you’ve identified an issue/bug for a specific TSX use-case, and found a fix for it, I have no objections to it being applied. > > 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? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 07:20:44 2023 Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 11:20:44 +0000 Received: from localhost ([127.0.0.1]:45571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhTLw-0008Jo-3N for submit@debbugs.gnu.org; Sat, 16 Sep 2023 07:20:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhTLt-0008JY-CS for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 07:20:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhTLf-0007Fv-JC; Sat, 16 Sep 2023 07:20:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=rsMGuDKLyr70eaqDeMgv/iSgQpsnWRoj48kYYwAfo1g=; b=a1GHhtgyJQFTDjBLtprd 1cM0Q8mo/gwwBzuxFhLiOmPz5PXCd0KsZDr309Ahnj0hqUTm+VZpA1GG9mcz5Fcd15MJsaEHfxJpH iniYajhUJsmxf6Wg8dUn6WLJxEnLlutDvvufUwaoDJMc/87RpXpjHzQTV8pdjgKvVFQ0ZUxT6Dy2p TG2BxcxTe7cqSQSzFKZTP2Lw1LHIaFU4Y3wT3BlWwMXB2uVIvr1Ffp++76UozOUZCHe+XpqEa9CPz SJCjeFsjWlJN2ZMciaND4yBEcD11SL+X80TPVoTYBQ0dYz5+DazmfbdAqY5C061ee9tRK+UN3PaNN Uolvqn2Wwuybeg==; Date: Sat, 16 Sep 2023 14:20:16 +0300 Message-Id: <834jjuicun.fsf@gnu.org> From: Eli Zaretskii To: dmitry@gutov.dev In-Reply-To: <835y4ak6hz.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Sep 2023 08:54:32 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, monnier@iro.umontreal.ca, btuin@mailo.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, > jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net > Date: Sat, 16 Sep 2023 08:54:32 +0300 > From: Eli Zaretskii > > > Date: Fri, 15 Sep 2023 16:35:55 +0300 > > Cc: Eli Zaretskii , Yuan Fu , > > Theodor Thornhill , > > Jostein Kjønigsen , btuin@mailo.com, > > 65470@debbugs.gnu.org > > From: Dmitry Gutov > > > > On 15/09/2023 15:11, Jostein Kjønigsen wrote: > > >> This patch seems to fix that and bring JSX syntax highlighting back: > > >> > > >> diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el > > >> index 57382c9cb31..7108ff49b28 100644 > > >> --- a/lisp/progmodes/typescript-ts-mode.el > > >> +++ b/lisp/progmodes/typescript-ts-mode.el > > >> @@ -163,7 +163,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b > > >> ;; but then raises an error if the wrong node type is used. So it is > > >> ;; important to check with the new node type (member_expression) > > >> (condition-case nil > > >> - (progn (treesit-query-capture language '((member_expression) @capture)) > > >> + (progn (treesit-query-capture language '(jsx_opening_element (member_expression) @capture)) > > >> '((jsx_opening_element > > >> [(member_expression (identifier)) (identifier)] > > >> @typescript-ts-jsx-tag-face) > > >> > > > I really don’t know this part of the code very well. If you’ve identified an issue/bug for a specific TSX use-case, and found a fix for it, I have no objections to it being applied. > > > > 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? This also causes byte-compilation warnings on a system that has no tree-sitter installed: In end of data: progmodes/typescript-ts-mode.el:498:17: Warning: the function ‘treesit-node-end’ is not known to be defined. progmodes/typescript-ts-mode.el:497:17: Warning: the function ‘treesit-node-start’ is not known to be defined. progmodes/typescript-ts-mode.el:474:6: Warning: the function ‘treesit-query-compile’ is not known to be defined. Could you please fix these? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 07:40:41 2023 Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 11:40:41 +0000 Received: from localhost ([127.0.0.1]:45582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhTfE-000323-F4 for submit@debbugs.gnu.org; Sat, 16 Sep 2023 07:40:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhTfA-00031o-KO for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 07:40:38 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhTev-0003T5-VM; Sat, 16 Sep 2023 07:40:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=RgBiPQTqN+xbFVq5ntn6NWHhfP86/TPn6E30EWtPhoM=; b=gRW6Enu6cY9Ul1r4CW3T mNqJ7QxgPnQiP6ZlWE9u1oHhhL3xkxlQr+ZbXUxu1wodzSWhrG84XldSkXzJ0ELwhyAa7d6a/Uibr CsB1+3l/Ap4xXwkYLrwsQHvVuqx3IUO1QDAVz8OY61OZbUtaGQYqkuazlyIfWWlH4HRyq5nZAkqdO A465P+hHOUjL8Omr4E7ohEIoWrsmhQfYywPP1HgvqGKeMsf4h1UDqHym2oJ/qrZHpMZD4Suxtl0Qk KTBpu/sbXL9/gthZnIc77lnR9wAZRk4CBZsMj4IuEi+WcuvS1+j1fU/u32Og2YbVH8NnT6pdmE4yR 22oTF2qicbMmxA==; Date: Sat, 16 Sep 2023 14:40:02 +0300 Message-Id: <831qeyibxp.fsf@gnu.org> From: Eli Zaretskii To: dmitry@gutov.dev, casouri@gmail.com In-Reply-To: <834jjuicun.fsf@gnu.org> (message from Eli Zaretskii on Sat, 16 Sep 2023 14:20:16 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> <834jjuicun.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, jostein@secure.kjonigsen.net, 65470@debbugs.gnu.org, theo@thornhill.no, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, > jostein@secure.kjonigsen.net, monnier@iro.umontreal.ca, btuin@mailo.com > Date: Sat, 16 Sep 2023 14:20:16 +0300 > From: Eli Zaretskii > > > Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, > > jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net > > Date: Sat, 16 Sep 2023 08:54:32 +0300 > > From: Eli Zaretskii > > > > > Date: Fri, 15 Sep 2023 16:35:55 +0300 > > > Cc: Eli Zaretskii , Yuan Fu , > > > Theodor Thornhill , > > > Jostein Kjønigsen , btuin@mailo.com, > > > 65470@debbugs.gnu.org > > > From: Dmitry Gutov > > > > > > On 15/09/2023 15:11, Jostein Kjønigsen wrote: > > > >> This patch seems to fix that and bring JSX syntax highlighting back: > > > >> > > > >> diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el > > > >> index 57382c9cb31..7108ff49b28 100644 > > > >> --- a/lisp/progmodes/typescript-ts-mode.el > > > >> +++ b/lisp/progmodes/typescript-ts-mode.el > > > >> @@ -163,7 +163,7 @@ tsx-ts-mode--font-lock-compatibility-bb1f97b > > > >> ;; but then raises an error if the wrong node type is used. So it is > > > >> ;; important to check with the new node type (member_expression) > > > >> (condition-case nil > > > >> - (progn (treesit-query-capture language '((member_expression) @capture)) > > > >> + (progn (treesit-query-capture language '(jsx_opening_element (member_expression) @capture)) > > > >> '((jsx_opening_element > > > >> [(member_expression (identifier)) (identifier)] > > > >> @typescript-ts-jsx-tag-face) > > > >> > > > > I really don’t know this part of the code very well. If you’ve identified an issue/bug for a specific TSX use-case, and found a fix for it, I have no objections to it being applied. > > > > > > 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? > > This also causes byte-compilation warnings on a system that has no > tree-sitter installed: > > In end of data: > progmodes/typescript-ts-mode.el:498:17: Warning: the function ‘treesit-node-end’ is not known to be defined. > progmodes/typescript-ts-mode.el:497:17: Warning: the function ‘treesit-node-start’ is not known to be defined. > progmodes/typescript-ts-mode.el:474:6: Warning: the function ‘treesit-query-compile’ is not known to be defined. > > Could you please fix these? I fixed this myself by simply declaring the functions the byte-compiler was complaining about, but I'd be happier if someone could explain these warnings, since the offending functions are not called anywhere in the code I could see. What did I miss? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 09:59:35 2023 Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 13:59:35 +0000 Received: from localhost ([127.0.0.1]:48191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhVpe-0004Ps-Vz for submit@debbugs.gnu.org; Sat, 16 Sep 2023 09:59:35 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:53976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhVpc-0004Pe-SF for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 09:59:33 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 254F01000A3; Sat, 16 Sep 2023 09:59:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1694872758; bh=3nbpWZ5D13cNeoTcjjrB+r2h3O8UgHUPccYTjNuml6M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FAs223AzFvDLAfLU6nrgiymDWP6o+Yiaz76gIhD54aCBa58tLdqGry+Cte7DzUDms vN/yVAnw/5394qe8m8utyeaKh1F+1JwpRZrjGtlnJXXIWJ4I0h7ZIKSAjj677lbgtL 7OfG9b+BV61oPpTNkvihk2Tcug1US7cb1g4CKT8tsn869QhaG8dIs+2btuw5yeh9Ww M/wP2NUJphlTWjjneurcKZzQJKYCHpIuYsBocpnpGjuBpfVbZAQerbPaWefjEZLVR0 z1v4pX4aRXd8HXf56hNtbucH8F+9/I/jS0hlqnLkkQjDeGG9Q7stquiBA1DHIfsWcC MxJCj2aun8IOg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id DA738100046; Sat, 16 Sep 2023 09:59:18 -0400 (EDT) Received: from pastel (unknown [104.247.237.102]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 98DEC120302; Sat, 16 Sep 2023 09:59:18 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching In-Reply-To: <835y4ak6hz.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Sep 2023 08:54:32 +0300") Message-ID: References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Date: Sat, 16 Sep 2023 09:59:11 -0400 MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.068 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, Dmitry Gutov , jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> 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`). Stefan 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 (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 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 16:05:57 2023 Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 20:05:57 +0000 Received: from localhost ([127.0.0.1]:48575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhbYC-0000kP-RP for submit@debbugs.gnu.org; Sat, 16 Sep 2023 16:05:57 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:50515) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhbY9-0000k9-50 for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 16:05:56 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 69DAE32001FC; Sat, 16 Sep 2023 16:05:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sat, 16 Sep 2023 16:05:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694894738; x=1694981138; bh=g3BR7dEC0xx97a/JI2AoNtoQ+fyn/4oyA+R AEy//7yI=; b=cc9kD7Vgfrp1XZXJ8bSf9xQykT7F2s9VwNrS+HxCaW+5nZEnoTX JucsMpg614yCDUvcVKWa85AylFimHKW2Pq8ht05qoR0KqMt2tSf/NsgoB7Ga9QHz xqkh/oqxpv4zm9TQDX/x6sObO1nZATThl+ZGYdcgyOh8BsQlL5fmh9QcOV97pfRB zmWvlsvZGwveAXSQ0Vv+qC7QfRlDkMo/D/9fwBE9BoX2ut69+FtCcDAzQ+pZZ2nu GaXcYd5/sZhOpXHrPmxCKdb6YTxJejo1gVG05uvNeR2VuIs86qrd4levuqFEVDnW ER7Ikwuhq1ydwIOu+GNo4sGpDiinbBlM/EQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694894738; x=1694981138; bh=g3BR7dEC0xx97a/JI2AoNtoQ+fyn/4oyA+R AEy//7yI=; b=fikyuJgzvljrBntxLlICrWK/RkfHTmHuvICdpHbOp3RDtmc87XH nrcRD6mPKF9p9NFfrDJRZ6tFt/uf2ZmvZ55ZPQnUsHXofOsHk5pb+SxrJ+rln4QL +ecru31f53W+WS5QSZH5SQ8Zb/kgKSCTRJZ3bA3sDq106TBFcn45IDXztqrTKuUq O99sWSKh+vSkyZwwG36YIJPbBZLGJusl6qClCK+vgUy4P3GVFfDoGapsnsPlcyM5 ERz0C3rOAlWjYDuoQMK+gGMlfQWQZBN1o6AWma4IoueqTPUKxjuFSqtaAOK2ullq rVuy+4GaeiWX5roJhbJIK9U5LwjlSdUkd8Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejgedgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpeeigfetveehveevffehledtueekieeikeeufeegudfgfeeghfdulefgfeev ledvveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Sep 2023 16:05:36 -0400 (EDT) Message-ID: <476cebcf-68d9-254d-816c-54476046cf5e@gutov.dev> Date: Sat, 16 Sep 2023 23:05:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: Stefan Monnier , Eli Zaretskii References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 16 16:08:09 2023 Received: (at 65470) by debbugs.gnu.org; 16 Sep 2023 20:08:10 +0000 Received: from localhost ([127.0.0.1]:48584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhbaL-0000oY-JD for submit@debbugs.gnu.org; Sat, 16 Sep 2023 16:08:09 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:47611) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhbaJ-0000oB-Af for 65470@debbugs.gnu.org; Sat, 16 Sep 2023 16:08:07 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id F0F73320030E; Sat, 16 Sep 2023 16:07:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sat, 16 Sep 2023 16:07:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1694894873; x=1694981273; bh=n3nmKcD9S8X+PNyjL6AAyc9mU+2UKFKh9IX PZxw6oaM=; b=T1EE0bKNfSEJReApFmd9f8EsscPMM2d2WiKLiRILzBr1L1LboLt pDElUsZPmhnmdg2iXqxu2vQaHXE21ntF044lcslXeYSLwNny537+w1OvdF+kOTYc 0nmktx5pekuzr3nQXDe8qSklokdiNpcOggFnorjpAl6usnRHz0l/2bh64GrEf98W 2PEFUoRr+a2uHo8J2JGUgEf1Av7pozUPA+tqLKX0kXxO9nLWE819mhauYj4UXOTq NxzPlgU2h6QGRNEZ1m1t+3vrUtXJc+zgJkHrtmZX6hjr6LVjg4JCe9fb1P82cork FliIjCj+5QZdyEd12PpDvh/Lo2xk+urYOSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1694894873; x=1694981273; bh=n3nmKcD9S8X+PNyjL6AAyc9mU+2UKFKh9IX PZxw6oaM=; b=e23IHAH925cdq5XAKJqDExRg2gULX8Xyq5jOAtWWbpWRUm4ybk2 Xk9PMOV2D6SYDQ0JCSLmxtwSqZvncBraCnYkA6TUkOX4gzDq7uiL6XID5ziGDodL W1yKj2AHWFd4vZGQ8mRdotfCaf+6wdCbhOrtC918UGXasJw+9scdIguslbxhRPEE cfJvrTQrOgQoh1MVOkcZ3IS/uemI4TlPLMpa6O/MGzXKKSpKz+OqG6KVXZ/fM5DU y0x3/z8f7uxH1R/QxLzHoqd15KzEs1Ijb3UmEZB3LQMEewIqHs/50zWk5h/D3EjI RCi7+AG/X7MaKPu4yHgcgxPVsRrqrC/+dBg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudejgedgudeggecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomhepffhm ihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrg htthgvrhhnpefhffehleejffegffeugefhkeektdffgfehjedvgeejtedtudehueffgffg feejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 16 Sep 2023 16:07:51 -0400 (EDT) Message-ID: <30f77d0f-dd3a-bca1-9106-0d2513ba5340@gutov.dev> Date: Sat, 16 Sep 2023 23:07:50 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching Content-Language: en-US To: Eli Zaretskii , casouri@gmail.com References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> <834jjuicun.fsf@gnu.org> <831qeyibxp.fsf@gnu.org> From: Dmitry Gutov In-Reply-To: <831qeyibxp.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.2 (--) X-Debbugs-Envelope-To: 65470 Cc: btuin@mailo.com, jostein@secure.kjonigsen.net, 65470@debbugs.gnu.org, theo@thornhill.no, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.2 (---) On 16/09/2023 14:40, Eli Zaretskii wrote: >> This also causes byte-compilation warnings on a system that has no >> tree-sitter installed: >> >> In end of data: >> progmodes/typescript-ts-mode.el:498:17: Warning: the function ‘treesit-node-end’ is not known to be defined. >> progmodes/typescript-ts-mode.el:497:17: Warning: the function ‘treesit-node-start’ is not known to be defined. >> progmodes/typescript-ts-mode.el:474:6: Warning: the function ‘treesit-query-compile’ is not known to be defined. >> >> Could you please fix these? > I fixed this myself by simply declaring the functions the > byte-compiler was complaining about, but I'd be happier if someone > could explain these warnings, since the offending functions are not > called anywhere in the code I could see. What did I miss? treesit-node-start/end are called in tsx-ts--syntax-propertize-captures (note the rename I just performed), and treesit-query-compile is called in *-ts--s-p-query's init forms. Both added in commit 1fb2fb501f3 reviewed by yours truly, so, sorry about that. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 17 01:22:21 2023 Received: (at 65470) by debbugs.gnu.org; 17 Sep 2023 05:22:21 +0000 Received: from localhost ([127.0.0.1]:48875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhkEe-0004CA-VH for submit@debbugs.gnu.org; Sun, 17 Sep 2023 01:22:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhkEc-0004Bx-AU for 65470@debbugs.gnu.org; Sun, 17 Sep 2023 01:22:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhkEO-0008Ry-6V; Sun, 17 Sep 2023 01:22:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vHDdk3DR3dEK5ndi70lVwJQ5BokYlNZm5iGqcYQBryg=; b=p+j/1/Kw9G9u Kk7Tqhn2uBdjMrWQ2QSur9TRC+SECPW/mFTyM6V0oBIF2DVbDDm8f4eo3kacNfatX5csBNMW1JSqe 5ajYFkYx04/Bi22RTewIer98nST8i3ef5CMZ6LhfEFH8nkedyt0Ihx6xBkkx1zw8ioqP1JFM8aOcv 3Mawz719MzprbIfi7vnIglsHhmNs8gzljFg5kn7s7nju824CNJJ89F1dKDPBeCYA4anB4ar/XuxDh 3o8rcFVJ6qCD85r4kTmvcBeM8ZCatBXu79zvZaSC9dCOzJVWnMEc7UEhYQB5MlVHmUu/byWmYW2cm VYU78j2D2aZkg+eYbEw9NA==; Date: Sun, 17 Sep 2023 08:22:00 +0300 Message-Id: <83jzspgyrr.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <476cebcf-68d9-254d-816c-54476046cf5e@gutov.dev> (message from Dmitry Gutov on Sat, 16 Sep 2023 23:05:35 +0300) Subject: Re: bug#65470: 29.1.50; js-ts-mode: regex pattern can cause incorrect parenthesis matching References: <127B5BEA-A24B-48A3-9827-85B7CDB67D10@secure.kjonigsen.net> <5f823f8f-d249-f4a1-71e6-083e47d0d123@gutov.dev> <83jztbeeh2.fsf@gnu.org> <03415a27-f082-b204-cece-19a9859e178d@gutov.dev> <8334zze5l4.fsf@gnu.org> <1363c54f-5109-f000-3333-78d291b2096d@gutov.dev> <2D516F0C-D7A8-49D2-8009-F911EFC55C78@secure.kjonigsen.net> <2f525ebe-74e5-dcbe-4403-5e9ae001795c@gutov.dev> <5e57b91b-2967-d82d-eca5-65dc206887cf@gutov.dev> <16E4F60E-5216-457F-A79F-F8FBB5A01D61@secure.kjonigsen.net> <6638462f-89fe-97c4-f008-27e1e2415d2b@gutov.dev> <835y4ak6hz.fsf@gnu.org> <476cebcf-68d9-254d-816c-54476046cf5e@gutov.dev> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65470 Cc: casouri@gmail.com, 65470@debbugs.gnu.org, theo@thornhill.no, jostein@secure.kjonigsen.net, monnier@iro.umontreal.ca, btuin@mailo.com, jostein@kjonigsen.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 16 Sep 2023 23:05:35 +0300 > Cc: jostein@secure.kjonigsen.net, casouri@gmail.com, theo@thornhill.no, > jostein@kjonigsen.net, btuin@mailo.com, 65470@debbugs.gnu.org > From: Dmitry Gutov > > 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. Thanks, compiles cleanly now. From unknown Mon Aug 11 18:16:06 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 15 Oct 2023 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator