GNU bug report logs - #44653
28.0.50; sql-mode gets confused about string literals

Previous Next

Package: emacs;

Reported by: Dale Sedivec <dale <at> codefu.org>

Date: Sun, 15 Nov 2020 06:38:01 UTC

Severity: normal

Found in version 28.0.50

Full log


Message #17 received at 44653 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Dale Sedivec <dale <at> codefu.org>
Cc: 44653 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#44653: 28.0.50; sql-mode gets confused about string literals
Date: Thu, 28 Jan 2021 05:35:54 +0100
Dale Sedivec <dale <at> codefu.org> 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




This bug report was last modified 4 years and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.