bug#40231: sql.el: patch for syntax table propertizing escaped apostrophes in SQL strings as punctuation syntax class
Dear Emacs folks, dear Michael,
sql.el parses SQL strings containing escaped (double) apostrophes as separate strings (e.g. jumping right between the two apostrophes with forward-sexp) because it uses only parsing by syntax table, which cannot handle this construct.
This should be an adequate description of the limitation/bug, but more details are available at:
The attached is a diff against sql.el version 3.6 as shipped with Emacs 26.3. that implements propertizing such double apostrophes within strings with a punctuation syntax table property. (I have posted the code with exhaustive comments, which I thought excessive for working code, at the above URL.) My tests were movement commands across sexps, which crossed the whole string, and the return value of
which returned a list such as
(1 129 139 39 nil nil 0 nil 154 (129) nil)
when between two such apostrophes, just like when elsewhere in a string. I have done no further testing.
I do hope this meets the standards for a patch, as I've never submitted one before.
Best regards to everybody, and stay well!
Florian v. Savigny
Siebenpfeiffer Str. 25