Subject: bug#44653: 28.0.50; sql-mode gets confused about string literals

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 28 Jan 2021 05:35:54 +0100

Dale Sedivec <[email-masked]> writes:

> 1. Create an sql-mode buffer with electric-pair-mode turned on
>
> 2. Type ', which results in '|' with point at |
>
> 3. Type ' again
>
> Desired behavior, and pre-40231's patch behavior (IIRC): ''| with point at |
>
> Post-40231 behavior: ''|'

Ah, yes, that's definitely a bug.

Poking away at this, it seems like the base issue here is that

(electric-pair-syntax-info ?')

inside

'foo'|'

in sql-mode now returns nil instead of 

(34 39 nil nil), as it did in Emacs 27.  (electric-pair-mode works by
having the ' inserted first, and then it starts asking for syntax info.)
At this point, the new syntax rule in sql mode has decided that

'foo''

we're still in the string, so there's nothing for electric-pair-mode to
do.

I'm not sure how this should be fixed...  Hm...  At 

'foo''|

we're in a string, but

'foo'|'

we're probably not?  (| marks point.)  Perhaps that can be used...
somehow...

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