emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8b3748c234: Fix sql-mode comment-end parsing


From: Lars Ingebrigtsen
Subject: master 8b3748c234: Fix sql-mode comment-end parsing
Date: Sat, 9 Apr 2022 06:29:34 -0400 (EDT)

branch: master
commit 8b3748c234e8be8c2b34c263cb216fef5a5f2279
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix sql-mode comment-end parsing
    
    * lisp/progmodes/sql.el (sql-mode): Fix /* ... -*/ parsing
    (bug#54769).
---
 lisp/progmodes/sql.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 69d16a4357..13fba0c705 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -4195,7 +4195,18 @@ must tell Emacs.  Here's how to do that in your init 
file:
                    nil)))
                ;; Propertize rules to not have /- and -* start comments.
                ("\\(/-\\)" (1 "."))
-               ("\\(-\\*\\)" (1 "."))))
+               ("\\(-\\*\\)"
+                (1
+                 (if (save-excursion
+                       (not (ppss-comment-depth
+                             (syntax-ppss (match-beginning 1)))))
+                     ;; If we're outside a comment, we don't let -*
+                     ;; start a comment.
+                    (string-to-syntax ".")
+                   ;; Inside a comment, ignore it to avoid -*/ not
+                   ;; being intepreted as a comment end.
+                   (forward-char -1)
+                   nil)))))
   ;; Set syntax and font-face highlighting
   ;; Catch changes to sql-product and highlight accordingly
   (sql-set-product (or sql-product 'ansi)) ; Fixes bug#13591



reply via email to

[Prev in Thread] Current Thread [Next in Thread]