From: Lars Ingebrigtsen Date: Fri, 8 Apr 2022 13:45:07 +0000 (+0200) Subject: Fix sql-mode comment-end parsing X-Git-Tag: emacs-29.0.90~1931^2~684 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8b3748c234e8be8c2b34c263cb216fef5a5f2279;p=emacs.git Fix sql-mode comment-end parsing * lisp/progmodes/sql.el (sql-mode): Fix /* ... -*/ parsing (bug#54769). --- diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 69d16a4357e..13fba0c7058 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