From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Theodor Thornhill via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#59689: 29.0.60; csharp-ts-mode: unable to uncomment region commented using comment-region Date: Tue, 29 Nov 2022 21:51:03 +0100 Message-ID: <871qpla3ig.fsf@thornhill.no> References: <877czda3w9.fsf@thornhill.no> Reply-To: Theodor Thornhill Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17556"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, jostein@kjonigsen.net, eliz@gnu.org To: 59689@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 29 21:52:42 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p07as-0004Ie-EZ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 21:52:42 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p07aP-0003zo-MS; Tue, 29 Nov 2022 15:52:13 -0500 Original-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 1p07aH-0003yb-V7 for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 15:52:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p07aG-00020l-8F for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 15:52:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p07aF-0000bS-NL for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 15:52:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Nov 2022 20:52:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59689 X-GNU-PR-Package: emacs Original-Received: via spool by 59689-submit@debbugs.gnu.org id=B59689.16697550682250 (code B ref 59689); Tue, 29 Nov 2022 20:52:03 +0000 Original-Received: (at 59689) by debbugs.gnu.org; 29 Nov 2022 20:51:08 +0000 Original-Received: from localhost ([127.0.0.1]:56253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p07ZM-0000aC-G9 for submit@debbugs.gnu.org; Tue, 29 Nov 2022 15:51:08 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]:21906) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p07ZJ-0000a5-8Y for 59689@debbugs.gnu.org; Tue, 29 Nov 2022 15:51:06 -0500 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=1669755064; 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: in-reply-to:in-reply-to:references:references; bh=fogGqvO3VocSVh9bSVJLJutLnSqkTUaKWgH0GaW4GKE=; b=G3nnJF5bCXclQn1bjwD5h8pjhSmqwgX/b+y3FRHUyEk1zLjYtUpykUaMOTj8K3VFmUZH56 TOBfoVOqbYf6av3PSv8sFn0r6yFbQchh5iAY93KdOFFU6M/fQUAfCV2Eq+a85hDzVMgwsg g4UQd8GH++Xl6HkFvvypaGswvJmfewD3VittVMbW+M0XqA3i+qGXXz23KJhJmBOXiD6MXV U7PkNGwGfKTAQ+30ehNo5ds1lBk43XWLvZ7loHu5p+2aD4qyx0Fi7InWjlbaosqtVGFDK5 pv5av7U168gBWJgvdZYtYbzzJsmRqPkvgB03v4TPe0e6NVRrV5aFfqg3BNtVfg== In-Reply-To: <877czda3w9.fsf@thornhill.no> X-Migadu-Flow: FLOW_OUT X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249439 Archived-At: --=-=-= Content-Type: text/plain Resending with correct address for Yuan... --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-comment-start-skip-in-ts-modes.patch >From 396f02d03faf65ded0b01b7b9aa9eb989aff4291 Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Tue, 29 Nov 2022 21:33:42 +0100 Subject: [PATCH] Fix comment-start-skip in *-ts-modes The new rx-based regex didn't work correctly with C++ style comments, so we revert back to the old non-rx-based comment-start-skip. * lisp/progmodes/c-ts-mode.el (c-ts-mode): Use new regex. * lisp/progmodes/csharp-mode.el (csharp-ts-mode): Use new regex. * lisp/progmodes/java-ts-mode.el (java-ts-mode): Use new regex. * lisp/progmodes/js.el (js-ts-mode): Use new regex. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode): Use new regex. Fixes (Bug#59689) --- lisp/progmodes/c-ts-mode.el | 3 +-- lisp/progmodes/csharp-mode.el | 3 +-- lisp/progmodes/java-ts-mode.el | 3 +-- lisp/progmodes/js.el | 3 +-- lisp/progmodes/typescript-ts-mode.el | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index a79dabcd31..18d0e2a87b 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -546,8 +546,7 @@ c-ts-mode ;; Comments. (setq-local comment-start "/* ") (setq-local comment-end " */") - (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) - (* (syntax whitespace)))) + (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *") (setq-local comment-end-skip (rx (* (syntax whitespace)) (group (or (syntax comment-end) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 3da3079f08..451fedce1b 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -900,8 +900,7 @@ csharp-ts-mode ;; Comments. (setq-local comment-start "// ") (setq-local comment-end "") - (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) - (* (syntax whitespace)))) + (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *") (setq-local comment-end-skip (rx (* (syntax whitespace)) (group (or (syntax comment-end) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index cf2482bb6e..ea3d2144df 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -301,8 +301,7 @@ java-ts-mode ;; Comments. (setq-local comment-start "// ") (setq-local comment-end "") - (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) - (* (syntax whitespace)))) + (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *") (setq-local comment-end-skip (rx (* (syntax whitespace)) (group (or (syntax comment-end) diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index ad1fe62d42..f8d510625c 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3849,8 +3849,7 @@ js-ts-mode ;; Comment. (setq-local comment-start "// ") (setq-local comment-end "") - (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) - (* (syntax whitespace)))) + (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *") (setq-local comment-end-skip (rx (* (syntax whitespace)) (group (or (syntax comment-end) diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 6c926a4e3e..8a5e537213 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -301,8 +301,7 @@ typescript-ts-mode ;; Comments. (setq-local comment-start "// ") (setq-local comment-end "") - (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*"))) - (* (syntax whitespace)))) + (setq-local comment-start-skip "\\(?://+\\|/\\*+\\)\\s *") (setq-local comment-end-skip (rx (* (syntax whitespace)) (group (or (syntax comment-end) -- 2.34.1 --=-=-=--