all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Kangas <stefankangas@gmail.com>
Cc: Kai Ma <justksqsf@gmail.com>,
	59807@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
Date: Mon, 12 Dec 2022 21:28:46 -0800	[thread overview]
Message-ID: <3CA82FC8-F478-4E60-AD15-73EDDA3E96CE@ucsd.edu> (raw)
In-Reply-To: <CADwFkmmXbJ2aAhFC4kGMNWED7p6nKU+8U3ZjeEss=+-w_Bov4w@mail.gmail.com>

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



> On Dec 12, 2022, at 6:24 PM, Stefan Kangas <stefankangas@gmail.com> wrote:
> 
> Kai Ma <justksqsf@gmail.com> writes:
> 
>> Unfortunately, I cannot complete the assignment process, at least for
>> now. The licensing officer at my university is really reluctant to
>> sign a copyright disclaimer for me.
> 
> Thanks for trying.

Yes, thanks!

> 
>> However, the cumulative number of lines changed by me is below 15 so
>> far, so at least for this issue, we can move forward. I’ve added
>> Copyright-paperwork-exempt in the attached patch.
> 
> -ENOPATCH
> 

I can see his patch. I attached it below.

Yuan


[-- Attachment #2: 0001-Fix-syntax-tables-of-tree-sitter-modes.patch --]
[-- Type: application/octet-stream, Size: 4009 bytes --]

From 94e150a2d1a199ac444382c809753fdefa1c1daa Mon Sep 17 00:00:00 2001
From: Kai Ma <justksqsf@gmail.com>
Date: Sun, 4 Dec 2022 06:15:42 +0800
Subject: [PATCH] Fix syntax tables of tree-sitter modes

Tree-sitter modes should use the same syntax table as the
non-tree-sitter ones.
* lisp/progmodes/csharp-mode.el (csharp-mode-syntax-table): Change
docstring.
(csharp-mode): Add ':syntax-table'.
* lisp/progmodes/js.el (js-mode-syntax-table): Change docstring.
(js-ts-mode): Add ':syntax-table'.
* lisp/progmodes/python.el (python-ts-mode): Add ':syntax-table'.
* lisp/progmodes/sh-script.el (bash-ts-mode): Add ':syntax-table'.
* lisp/textmodes/css-mode.el (css-ts-mode): Add ':syntax-table'.

Copyright-paperwork-exempt: yes
---
 lisp/progmodes/csharp-mode.el | 3 ++-
 lisp/progmodes/js.el          | 3 ++-
 lisp/progmodes/python.el      | 1 +
 lisp/progmodes/sh-script.el   | 1 +
 lisp/textmodes/css-mode.el    | 1 +
 5 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 3da3079f08..73f2a6ff9e 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -608,7 +608,7 @@ csharp-compilation-re-dotnet-testfail
 
 (defvar csharp-mode-syntax-table
   (funcall (c-lang-const c-make-mode-syntax-table csharp))
-  "Syntax table used in `csharp-mode' buffers.")
+  "Syntax table used in `csharp-mode' and `csharp-ts-mode' buffers.")
 
 (defvar csharp-mode-map
   (let ((map (c-make-inherited-keymap)))
@@ -890,6 +890,7 @@ csharp-mode
 ;;;###autoload
 (define-derived-mode csharp-ts-mode prog-mode "C#"
   "Major mode for editing C# code."
+  :syntax-table csharp-mode-syntax-table
 
   (unless (treesit-ready-p 'c-sharp)
     (error "Tree-sitter for C# isn't available"))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index ad1fe62d42..11e45178f7 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -686,7 +686,7 @@ js-mode-syntax-table
     (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.")
@@ -3840,6 +3840,7 @@ 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 4fc5d24e2f..c90124b6b9 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -6618,6 +6618,7 @@ 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 @@ bash-ts-mode
   "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)
diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el
index b82886e397..b3654eaa7f 100644
--- a/lisp/textmodes/css-mode.el
+++ b/lisp/textmodes/css-mode.el
@@ -1822,6 +1822,7 @@ css-ts-mode
 can also be used to fill comments.
 
 \\{css-mode-map}"
+  :syntax-table css-mode-syntax-table
   (when (treesit-ready-p 'css)
     ;; Borrowed from `css-mode'.
     (add-hook 'completion-at-point-functions
-- 
2.37.1 (Apple Git-137.1)


  reply	other threads:[~2022-12-13  5:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-03 22:27 bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote Kai Ma
2022-12-04  7:19 ` Eli Zaretskii
2022-12-04  7:28   ` Yuan Fu
2022-12-04  8:07     ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-04 12:32   ` Kai Ma
2022-12-05  6:28 ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-05  6:48   ` Kai Ma
2022-12-13  1:20     ` Kai Ma
2022-12-13  2:24       ` Stefan Kangas
2022-12-13  5:28         ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-12-13 12:17       ` Eli Zaretskii
2022-12-05  8:22   ` Eli Zaretskii
2022-12-14  2:08 ` Yuan Fu

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=3CA82FC8-F478-4E60-AD15-73EDDA3E96CE@ucsd.edu \
    --to=bug-gnu-emacs@gnu.org \
    --cc=59807@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=justksqsf@gmail.com \
    --cc=stefankangas@gmail.com \
    --cc=yuf011@ucsd.edu \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

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