Subject: bug#59807: 29.0.60; [PATCH] python-ts-mode does not auto-complete the closing quote

From: Yuan Fu <[email-masked]>
Date: Sat, 3 Dec 2022 23:28:23 -0800

> On Dec 3, 2022, at 11:19 PM, Eli Zaretskii <[email-masked]> wrote:
> 
>> From: Kai Ma <[email-masked]>
>> 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 <[email-masked]>
>> 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