all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#54769: 28.1; Incorrect sql comment highlighting
@ 2022-04-07 16:30 emacsq via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-04-08 13:45 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: emacsq via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-04-07 16:30 UTC (permalink / raw)
  To: 54769


[-- Attachment #1.1: Type: text/plain, Size: 828 bytes --]

Attached a small test.sql file where the statement after the comment incorrectly gets comment face.

Looks like the two kinds of comment styles confuses the highlighter:

"You can include a comment in a statement in two ways:

Begin the comment with a slash and an asterisk (/*). Proceed with the text of the comment. This text can span multiple lines. End the comment with an asterisk and a slash (*/). The opening and terminating characters need not be separated from the text by a space or a line break.
Begin the comment with -- (two hyphens). Proceed with the text of the comment. This text cannot extend to a new line. End the comment with a line break.
"

If you remove the hyphens from the /* */ comment then the higlighting is correct.

Such SQL worked fine for me with 27.1, so something must have happened since then.

[-- Attachment #1.2: Type: text/html, Size: 1549 bytes --]

[-- Attachment #2: test.sql --]
[-- Type: application/sql, Size: 127 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#54769: 28.1; Incorrect sql comment highlighting
  2022-04-07 16:30 bug#54769: 28.1; Incorrect sql comment highlighting emacsq via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-04-08 13:45 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-08 13:45 UTC (permalink / raw)
  To: emacsq; +Cc: 54769

emacsq <laszlomail@protonmail.com> writes:

> Attached a small test.sql file where the statement after the comment incorrectly gets
> comment face.

[...]

> /*---*/;
> INSERT INTO `student` (`id`, `name`, `class`, `mark`, `gender`) VALUES (1, 'John Deo', 'Four', 75, 'female');

The trigger for this behaviour seems to be the dash before the asterisk.
This also displays the incorrect behaviour:

/* aa -*/;
INSERT INTO `student` (`id`, `name`, `class`, `mark`, `gender`) VALUES (1, 'John Deo', 'Four', 75, 'female');

This doesn't:

/* aa - */;
INSERT INTO `student` (`id`, `name`, `class`, `mark`, `gender`) VALUES (1, 'John Deo', 'Four', 75, 'female');

And the problem seems to be introduced by:

commit 70825a4d313fddd6f80a1840d775384e848daf9f
Author:     Lars Ingebrigtsen <larsi@gnus.org>
AuthorDate: Mon Aug 10 13:24:19 2020 +0200

    Fix problem with /- incorrectly starting a comment in SQL mode
    
    * lisp/progmodes/sql.el (sql-mode): Move all the syntax setup
    stuff here (bug#35646).  Add handling of -* and /- from Kristian
    Hole <kristian@hole.priv.no>.

The previous bug was that -* would start a comment, but the fix makes -*
inhibit ending a comment instead.

I've now fixed this in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-08 13:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-07 16:30 bug#54769: 28.1; Incorrect sql comment highlighting emacsq via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-04-08 13:45 ` Lars Ingebrigtsen

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.