bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#35646: In SQL mode /- incorrectly starts a comment


From: Stefan Kangas
Subject: bug#35646: In SQL mode /- incorrectly starts a comment
Date: Mon, 20 Jan 2020 20:44:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi Michael,

Kristian Hole <kristian@hole.priv.no> writes:

> Attached is a patch that fixes this by using the following 
> syntax-propertize-function:
>
> (set (make-local-variable 'syntax-propertize-function)
>      (syntax-propertize-rules
>       ("\\(/-\\)" (1 "."))
>       ("\\(-\\*\\)" (1 "."))))
>
> Adds sql-mode syntax propertize rules to fix comment highlighting
>
> Fixes the issue where -* and /- incorrectly starts comments
> in SQL mode Bug(#35646). This is done by adding a
> syntax-propertize-function to sql-mode.

Could you please take a look also at the below patch?  TIA.

Best regards,
Stefan Kangas

>
> From b6bd0f6f812fdb3200dd240bb8eab5f717ab7c44 Mon Sep 17 00:00:00 2001
> From: kahole <kristian@hole.priv.no>
> Date: Sun, 27 Oct 2019 21:29:48 +0100
> Subject: [PATCH] Adds sql-mode syntax propertize rules to fix comment
>  highlighting
>
> Fixes the issue where -* and /- incorrectly starts comments
> in SQL mode Bug(#35646). This is done by adding a
> syntax-propertize-function to sql-mode.
> ---
>  lisp/progmodes/sql.el | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
> index b17364b08f..645944b34a 100644
> --- a/lisp/progmodes/sql.el
> +++ b/lisp/progmodes/sql.el
> @@ -4253,6 +4253,13 @@ sql-mode
>  
>    ;; (smie-setup sql-smie-grammar #'sql-smie-rules)
>    (set (make-local-variable 'comment-start) "--")
> +
> +  ;; Propertize rules to not have /- and -* start comments
> +  (set (make-local-variable 'syntax-propertize-function)
> +       (syntax-propertize-rules
> +        ("\\(/-\\)" (1 "."))
> +        ("\\(-\\*\\)" (1 "."))))
> +
>    ;; Make each buffer in sql-mode remember the "current" SQLi buffer.
>    (make-local-variable 'sql-buffer)
>    ;; Add imenu support for sql-mode.  Note that imenu-generic-expression





reply via email to

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