emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 fafcf02c85 3/3: Fix syntax tables of tree-sitter modes (bug#598


From: Yuan Fu
Subject: emacs-29 fafcf02c85 3/3: Fix syntax tables of tree-sitter modes (bug#59807)
Date: Tue, 13 Dec 2022 21:06:49 -0500 (EST)

branch: emacs-29
commit fafcf02c856ef8fd712ff75e8999dfb0f6d97f07
Author: Kai Ma <justksqsf@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Fix syntax tables of tree-sitter modes (bug#59807)
    
    Tree-sitter modes should use the same syntax table as the
    non-tree-sitter ones.
    
    * lisp/progmodes/js.el (js-mode-syntax-table)
    (js-ts-mode)
    * lisp/progmodes/python.el (python-ts-mode)
    * lisp/progmodes/sh-script.el (bash-ts-mode)
    
    Copyright-paperwork-exempt: yes
    
    xx
---
 lisp/progmodes/js.el        | 3 ++-
 lisp/progmodes/python.el    | 1 +
 lisp/progmodes/sh-script.el | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 1de0f3442f..02990813ef 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -686,7 +686,7 @@ This variable is like `sgml-attribute-offset'."
     (modify-syntax-entry ?$ "_" table)
     (modify-syntax-entry ?` "\"" table)
     table)
-  "Syntax table for `js-mode'.")
+  "Syntax table for `js-mode' and `js-ts-mode'.")
 
 (defvar-local js--quick-match-re nil
   "Autogenerated regexp used by `js-mode' to match buffer constructs.")
@@ -3843,6 +3843,7 @@ Currently there are `js-mode' and `js-ts-mode'."
 
 \\<js-ts-mode-map>"
   :group 'js
+  :syntax-table js-mode-syntax-table
   (when (treesit-ready-p 'javascript)
     ;; Borrowed from `js-mode'.
     (setq-local prettify-symbols-alist js--prettify-symbols-alist)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 0e0898ffe2..ee05862550 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -6619,6 +6619,7 @@ implementations: `python-mode' and `python-ts-mode'."
   "Major mode for editing Python files, using tree-sitter library.
 
 \\{python-ts-mode-map}"
+  :syntax-table python-mode-syntax-table
   (when (treesit-ready-p 'python)
     (treesit-parser-create 'python)
     (setq-local treesit-font-lock-feature-list
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index e170d18afe..76e8d5b074 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1611,6 +1611,7 @@ with your script for an edit-interpret-debug cycle."
   "Major mode for editing Bash shell scripts.
 This mode automatically falls back to `sh-mode' if the buffer is
 not written in Bash or sh."
+  :syntax-table sh-mode-syntax-table
   (when (treesit-ready-p 'bash)
     (setq-local treesit-font-lock-feature-list
                 '(( comment function)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]