all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
@ 2022-12-03 22:27 Kai Ma
  2022-12-04  7:19 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Kai Ma @ 2022-12-03 22:27 UTC (permalink / raw)
  To: 59807

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

When electric-pair-mode is enabled, a single quote ' should be auto
completed to be '' (which means an empty string).  Python-mode correctly
does this, but python-ts-mode does not.  This is clearly a problem
regarding the syntax table.

The attached patch makes python-ts-mode uses the same syntax table as
python-mode's, and fixes this problem.  I also checked a few other ts
modes, and some also have this issue.  For example, js-ts-mode does not
auto complete '' either, which is also fixed by this patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix syntax tables of tree-sitter modes --]
[-- Type: text/x-patch, Size: 3727 bytes --]

From 7f996826bc47bcdd155eb0cc220a48c32cb2619a 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)
(csharp-mode):
* 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):
* lisp/textmodes/css-mode.el (css-ts-mode):
---
 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)


[-- Attachment #3: Type: text/plain, Size: 5 bytes --]


Kai

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  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 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-14  2:08 ` Yuan Fu
  2 siblings, 2 replies; 13+ messages in thread
From: Eli Zaretskii @ 2022-12-04  7:19 UTC (permalink / raw)
  To: Kai Ma, Yuan Fu; +Cc: 59807

> From: Kai Ma <justksqsf@gmail.com>
> Date: Sun, 04 Dec 2022 06:27:18 +0800
> 
> When electric-pair-mode is enabled, a single quote ' should be auto
> completed to be '' (which means an empty string).  Python-mode correctly
> does this, but python-ts-mode does not.  This is clearly a problem
> regarding the syntax table.
> 
> The attached patch makes python-ts-mode uses the same syntax table as
> python-mode's, and fixes this problem.  I also checked a few other ts
> modes, and some also have this issue.  For example, js-ts-mode does not
> auto complete '' either, which is also fixed by this patch.
> 
> >From 7f996826bc47bcdd155eb0cc220a48c32cb2619a 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)
> (csharp-mode):
> * 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):
> * lisp/textmodes/css-mode.el (css-ts-mode):

Thanks, but please format the log message according to our conventions:
there should be a description of the actual changes after the last colon.

Yuan, is it really true that the syntax tables in treesit-supported modes
should be always identical to those of the non-treesit modes?  Or maybe
there could be subtle differences?





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  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
  1 sibling, 1 reply; 13+ messages in thread
From: Yuan Fu @ 2022-12-04  7:28 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Kai Ma, Theodor Thornhill, 59807



> On Dec 3, 2022, at 11:19 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Kai Ma <justksqsf@gmail.com>
>> Date: Sun, 04 Dec 2022 06:27:18 +0800
>> 
>> When electric-pair-mode is enabled, a single quote ' should be auto
>> completed to be '' (which means an empty string).  Python-mode correctly
>> does this, but python-ts-mode does not.  This is clearly a problem
>> regarding the syntax table.
>> 
>> The attached patch makes python-ts-mode uses the same syntax table as
>> python-mode's, and fixes this problem.  I also checked a few other ts
>> modes, and some also have this issue.  For example, js-ts-mode does not
>> auto complete '' either, which is also fixed by this patch.
>> 
>>> From 7f996826bc47bcdd155eb0cc220a48c32cb2619a 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)
>> (csharp-mode):
>> * 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):
>> * lisp/textmodes/css-mode.el (css-ts-mode):
> 
> Thanks, but please format the log message according to our conventions:
> there should be a description of the actual changes after the last colon.
> 
> Yuan, is it really true that the syntax tables in treesit-supported modes
> should be always identical to those of the non-treesit modes?  Or maybe
> there could be subtle differences?

IMO yes. But since I’m not the original author of some of the modes, I included Theo for his opinion.

Yuan






^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  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
  0 siblings, 0 replies; 13+ messages in thread
From: Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-12-04  8:07 UTC (permalink / raw)
  To: Yuan Fu, Eli Zaretskii; +Cc: Kai Ma, 59807



On 4 December 2022 08:28:23 CET, Yuan Fu <casouri@gmail.com> wrote:
>
>
>> On Dec 3, 2022, at 11:19 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>>> From: Kai Ma <justksqsf@gmail.com>
>>> Date: Sun, 04 Dec 2022 06:27:18 +0800
>>> 
>>> When electric-pair-mode is enabled, a single quote ' should be auto
>>> completed to be '' (which means an empty string).  Python-mode correctly
>>> does this, but python-ts-mode does not.  This is clearly a problem
>>> regarding the syntax table.
>>> 
>>> The attached patch makes python-ts-mode uses the same syntax table as
>>> python-mode's, and fixes this problem.  I also checked a few other ts
>>> modes, and some also have this issue.  For example, js-ts-mode does not
>>> auto complete '' either, which is also fixed by this patch.
>>> 
>>>> From 7f996826bc47bcdd155eb0cc220a48c32cb2619a 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)
>>> (csharp-mode):
>>> * 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):
>>> * lisp/textmodes/css-mode.el (css-ts-mode):
>> 
>> Thanks, but please format the log message according to our conventions:
>> there should be a description of the actual changes after the last colon.
>> 
>> Yuan, is it really true that the syntax tables in treesit-supported modes
>> should be always identical to those of the non-treesit modes?  Or maybe
>> there could be subtle differences?
>
>IMO yes. But since I’m not the original author of some of the modes, I included Theo for his opinion.
>
>Yuan
>

I agree!
Theo





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  2022-12-04  7:19 ` Eli Zaretskii
  2022-12-04  7:28   ` Yuan Fu
@ 2022-12-04 12:32   ` Kai Ma
  1 sibling, 0 replies; 13+ messages in thread
From: Kai Ma @ 2022-12-04 12:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Yuan Fu, 59807

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


> On Dec 4, 2022, at 15:19, Eli Zaretskii <eliz@gnu.org> wrote:
> 
> Thanks, but please format the log message according to our conventions:
> there should be a description of the actual changes after the last colon.

Thanks, descriptions added in the revised patch.



Kai

[-- Attachment #2.1: Type: text/html, Size: 2043 bytes --]

[-- Attachment #2.2: 0001-Fix-syntax-tables-of-tree-sitter-modes.patch --]
[-- Type: application/octet-stream, Size: 3974 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'.
---
 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)


[-- Attachment #2.3: Type: text/html, Size: 241 bytes --]

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not  auto-complete the closing quote
  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-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-05  8:22   ` Eli Zaretskii
  2022-12-14  2:08 ` Yuan Fu
  2 siblings, 2 replies; 13+ messages in thread
From: Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-12-05  6:28 UTC (permalink / raw)
  To: Kai Ma; +Cc: Eli Zaretskii, 59807


Kai Ma <justksqsf@gmail.com> writes:

>  On Dec 4, 2022, at 15:19, Eli Zaretskii <eliz@gnu.org> wrote:
>
>  Thanks, but please format the log message according to our conventions:
>  there should be a description of the actual changes after the last colon.
>
> Thanks, descriptions added in the revised patch.

Looks good, thanks. Have you signed the copyright assignment? (BTW, Eli,
what’s the standard way for checking this?)

Yuan





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  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-05  8:22   ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Kai Ma @ 2022-12-05  6:48 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Eli Zaretskii, 59807


> On Dec 5, 2022, at 14:28, Yuan Fu <yuf011@ucsd.edu> wrote:
> 
> Kai Ma <justksqsf@gmail.com> writes:
> 
>> On Dec 4, 2022, at 15:19, Eli Zaretskii <eliz@gnu.org> wrote:
>> 
>> Thanks, but please format the log message according to our conventions:
>> there should be a description of the actual changes after the last colon.
>> 
>> Thanks, descriptions added in the revised patch.
> 
> Looks good, thanks. Have you signed the copyright assignment? (BTW, Eli,
> what’s the standard way for checking this?)

No, I haven’t.  Thanks for the heads up.
I’ve just started the CA process according to CONTRIBUTE.  
Will let you know when I’m done.

Kai




^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not  auto-complete the closing quote
  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-05  8:22   ` Eli Zaretskii
  1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2022-12-05  8:22 UTC (permalink / raw)
  To: Yuan Fu, Kai Ma; +Cc: 59807

On December 5, 2022 8:28:10 AM GMT+02:00, Yuan Fu <yuf011@ucsd.edu> wrote:
> 
> Kai Ma <justksqsf@gmail.com> writes:
> 
> >  On Dec 4, 2022, at 15:19, Eli Zaretskii <eliz@gnu.org> wrote:
> >
> >  Thanks, but please format the log message according to our conventions:
> >  there should be a description of the actual changes after the last colon.
> >
> > Thanks, descriptions added in the revised patch.
> 
> Looks good, thanks. Have you signed the copyright assignment? (BTW, Eli,
> what’s the standard way for checking this?)
> 
> Yuan
> 

The standard way is to ask me.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  2022-12-05  6:48   ` Kai Ma
@ 2022-12-13  1:20     ` Kai Ma
  2022-12-13  2:24       ` Stefan Kangas
  2022-12-13 12:17       ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Kai Ma @ 2022-12-13  1:20 UTC (permalink / raw)
  To: Yuan Fu; +Cc: Eli Zaretskii, 59807

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



> On Dec 5, 2022, at 14:48, Kai Ma <justksqsf@gmail.com> wrote:
> 
> No, I haven’t.  Thanks for the heads up.
> I’ve just started the CA process according to CONTRIBUTE.  
> Will let you know when I’m done.

Sorry for the delay.

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.

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.



[-- Attachment #2.1: Type: text/html, Size: 3076 bytes --]

[-- Attachment #2.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)


[-- Attachment #2.3: Type: text/html, Size: 212 bytes --]

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  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
  2022-12-13 12:17       ` Eli Zaretskii
  1 sibling, 1 reply; 13+ messages in thread
From: Stefan Kangas @ 2022-12-13  2:24 UTC (permalink / raw)
  To: Kai Ma, Yuan Fu; +Cc: Eli Zaretskii, 59807

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.

> 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





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  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
  0 siblings, 0 replies; 13+ messages in thread
From: Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-12-13  5:28 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Kai Ma, 59807, Eli Zaretskii

[-- 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)


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote
  2022-12-13  1:20     ` Kai Ma
  2022-12-13  2:24       ` Stefan Kangas
@ 2022-12-13 12:17       ` Eli Zaretskii
  1 sibling, 0 replies; 13+ messages in thread
From: Eli Zaretskii @ 2022-12-13 12:17 UTC (permalink / raw)
  To: Kai Ma; +Cc: 59807, yuf011

> From: Kai Ma <justksqsf@gmail.com>
> Date: Tue, 13 Dec 2022 09:20:52 +0800
> Cc: Eli Zaretskii <eliz@gnu.org>,
>  59807@debbugs.gnu.org
> 
> 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.
> 
> 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.

Yes, we can still accept this one, but it will probably be the last
one.





^ permalink raw reply	[flat|nested] 13+ messages in thread

* bug#59807: 29.0.60; [PATCH] python-ts-mode does not  auto-complete the closing quote
  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-05  6:28 ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-12-14  2:08 ` Yuan Fu
  2 siblings, 0 replies; 13+ messages in thread
From: Yuan Fu @ 2022-12-14  2:08 UTC (permalink / raw)
  To: yuf011; +Cc: Kai Ma, eliz, Stefan Kangas, 59807-done


Yuan Fu <yuf011@ucsd.edu> writes:

>> 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.

I applied the patch. Due to recent changes on the branch I needed to
modify it a little.  As a result, the patch contains fewer lines of
change.

Yuan





^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-14  2:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-12-13 12:17       ` Eli Zaretskii
2022-12-05  8:22   ` Eli Zaretskii
2022-12-14  2:08 ` Yuan Fu

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.