all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Theodor Thornhill <theo@thornhill.no>
Cc: 59690@debbugs.gnu.org, 59689@debbugs.gnu.org,
	jostein@kjonigsen.net, eliz@gnu.org
Subject: bug#59689: bug#59690: 29.0.60; typescript-ts-mode: unable to uncomment region commented using comment-region
Date: Thu, 1 Dec 2022 19:56:28 -0800	[thread overview]
Message-ID: <9E07E286-B6B7-4626-A41A-A87ADE402D09@gmail.com> (raw)
In-Reply-To: <87o7solo9v.fsf@thornhill.no>

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



> On Nov 30, 2022, at 2:39 AM, Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors <bug-gnu-emacs@gnu.org> wrote:
> 
> Yuan Fu <casouri@gmail.com> writes:
> 
>> Theodor Thornhill <theo@thornhill.no> writes:
>> 
>>> Resending with correct address for Yuan...
>>> 
>>> 
>> 
>> Oops, sorry. But why it didn’t work? :-( I did a (almost) direct
>> conversion from the old regexp to rx. Let me see if I can fix it with
>> rx.
> 
> If you use the xr package from ELPA you get an rx equivalent, but to me
> that was more unreadable than the plain regex :)

That’s what I used, but perhaps I should change the result of it :-)

Could you try this patch? This should be one-to-one conversion from the plain one.

Yuan


[-- Attachment #2: comment-start.diff --]
[-- Type: application/octet-stream, Size: 3191 bytes --]

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index ad64df6143c..d63a77cb50f 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -566,7 +566,8 @@ c-ts-mode
   ;; Comments.
   (setq-local comment-start "/* ")
   (setq-local comment-end " */")
-  (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*")))
+  (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
+                                         (seq "/" (+ "*")))
                                      (* (syntax whitespace))))
   (setq-local comment-end-skip
               (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 3da3079f089..054dabfed07 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -900,7 +900,8 @@ csharp-ts-mode
   ;; Comments.
   (setq-local comment-start "// ")
   (setq-local comment-end "")
-  (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*")))
+  (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
+                                         (seq "/" (+ "*")))
                                      (* (syntax whitespace))))
   (setq-local comment-end-skip
               (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el
index cf2482bb6ee..2c42505ac94 100644
--- a/lisp/progmodes/java-ts-mode.el
+++ b/lisp/progmodes/java-ts-mode.el
@@ -301,7 +301,8 @@ java-ts-mode
   ;; Comments.
   (setq-local comment-start "// ")
   (setq-local comment-end "")
-  (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*")))
+  (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
+                                         (seq "/" (+ "*")))
                                      (* (syntax whitespace))))
   (setq-local comment-end-skip
               (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index ad1fe62d429..389096147ac 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3849,7 +3849,8 @@ js-ts-mode
     ;; Comment.
     (setq-local comment-start "// ")
     (setq-local comment-end "")
-    (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*")))
+    (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
+                                           (seq "/" (+ "*")))
                                        (* (syntax whitespace))))
     (setq-local comment-end-skip
                 (rx (* (syntax whitespace))
diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el
index 6c926a4e3e0..ddc478f7320 100644
--- a/lisp/progmodes/typescript-ts-mode.el
+++ b/lisp/progmodes/typescript-ts-mode.el
@@ -301,7 +301,8 @@ typescript-ts-mode
     ;; Comments.
     (setq-local comment-start "// ")
     (setq-local comment-end "")
-    (setq-local comment-start-skip (rx (group "/" (or (+ "/") (+ "*")))
+    (setq-local comment-start-skip (rx (or (seq "/" (+ "/"))
+                                           (seq "/" (+ "*")))
                                        (* (syntax whitespace))))
     (setq-local comment-end-skip
                 (rx (* (syntax whitespace))

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




  reply	other threads:[~2022-12-02  3:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 19:47 bug#59689: 29.0.60; csharp-ts-mode: unable to uncomment region commented using comment-region Jostein Kjønigsen
2022-11-29 20:42 ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-29 20:51   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-30 12:44   ` Jostein Kjønigsen
2022-11-30 10:27 ` bug#59689: bug#59690: 29.0.60; typescript-ts-mode: " Yuan Fu
2022-11-30 10:39   ` Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-02  3:56     ` Yuan Fu [this message]
2022-12-02 12:43       ` bug#59690: bug#59689: " Theodor Thornhill via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=9E07E286-B6B7-4626-A41A-A87ADE402D09@gmail.com \
    --to=casouri@gmail.com \
    --cc=59689@debbugs.gnu.org \
    --cc=59690@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=jostein@kjonigsen.net \
    --cc=theo@thornhill.no \
    /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.