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:42:46 +0100 Message-ID: <877czda3w9.fsf@thornhill.no> References: <15b365bb-9cd1-03c4-638c-489f93d679e1@secure.kjonigsen.net> 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="3909"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jostein@kjonigsen.net, eliz@gnu.org, casuri@gmail.com 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:43:14 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 1p07Rh-0000mp-QG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 21:43:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p07RY-0000Mx-Qv; Tue, 29 Nov 2022 15:43:04 -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 1p07RY-0000LN-1M for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 15:43:04 -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 1p07RW-0000QR-Jz for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 15:43:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p07RW-0000Vp-Fe for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 15:43:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <15b365bb-9cd1-03c4-638c-489f93d679e1@secure.kjonigsen.net> Resent-From: Theodor Thornhill Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Nov 2022 20:43:02 +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.16697545741962 (code B ref 59689); Tue, 29 Nov 2022 20:43:02 +0000 Original-Received: (at 59689) by debbugs.gnu.org; 29 Nov 2022 20:42:54 +0000 Original-Received: from localhost ([127.0.0.1]:56215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p07RO-0000Va-1P for submit@debbugs.gnu.org; Tue, 29 Nov 2022 15:42:54 -0500 Original-Received: from out2.migadu.com ([188.165.223.204]:16733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p07RK-0000VU-SF for 59689@debbugs.gnu.org; Tue, 29 Nov 2022 15:42:52 -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=1669754568; 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; bh=/gDCulYXR2Rd6cQPtCoQpFhfpu/OFSyss/Z3v7q5vTQ=; b=MZj9cZepXWgm6TU4acTjm0nz9XZHtjmKcAy7r2oKas7s4PomhbMRdPslBuq4td73rxxR4L pVQrB4IHprOdUrlI4Jh8cjvXYqeUp7NWCfgAElXaD/B08HSaP+m738lespE4OZpccoDnes WgK7HIAIDVvF3B069aizhodku7uB4bQkm2affzSTF1v/k1n/JMWw/5/orbdTXzqB8YGAuF 3f8H9msIxi2vjLUkKq7oQEWgkqJuvlrTXyJI++bB0vaddoWkr1a5QaPRsJ4tYIa1J8Z1XZ ZTy2kPdBZFH0y5EEY89sDU4pB5HOXlNUytvSuE5hk1B1i2CVpQtZHKO8BihEZA== 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:249437 Archived-At: --=-=-= Content-Type: text/plain Hi all. Here's a patch fixing this bug. This also fixes the same problem for all the ts-modes. The regression was introduced in d5dc1dbf7cb263d8ff541a0def028c2d7d24f82b See attached patch. Theo --=-=-= 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 --=-=-=--