GNU bug report logs -
#35646
In SQL mode /- incorrectly starts a comment
Previous Next
Reported by: mdruiter <at> gmail.com
Date: Thu, 9 May 2019 07:58:01 UTC
Severity: normal
Tags: fixed, patch
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Michael,
Kristian Hole <kristian <at> 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 <at> 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
This bug report was last modified 4 years and 348 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.