bug#37459: 26.2; sql syntax highlight problem when escaping single quote
From:
ndame
Subject:
bug#37459: 26.2; sql syntax highlight problem when escaping single quote
Date:
Fri, 20 Sep 2019 15:28:54 +0200 (CEST)
I poked around for the problem and found this in sql-mode Help:
Note that SQL doesn't have an escape character unless you specify
one. If you specify backslash as escape character in SQL, you
must tell Emacs. Here's how to do that in your init file:
So it worked, but then I realized there are different sql modes and
the default is ANSI, so I changed it to Mysql to test it, but that
didn't help either.
Then I checked the mysql syntax setting and backslash was missing
there too, though backslash is an escape character for mysql by
default:
So I changed the syntax for mysql by adding backslash:
:syntax-alist ((?# . "< b") (?\\ . "\\"))
and this fixed it.
There are 3 takeaways:
1. The incorrect example in sql-mode Help should be fixed.
2. Since backslash is an escape character in mysql it may be set as
such by default if the user chooses mysql mode.
3. The user may not realize he is in an incorrect sql mode. Maybe when
the user activates sql mode for the first time emacs should tell him
that ansi is the default and ask him if he wants to change it?