Subject: bug#77823: 31.0.50; M-j regression since commit 4c6b1712a4d

From: Stefan Monnier <[email-masked]>
Date: Tue, 22 Apr 2025 17:25:26 -0400

>>   (setopt electric-pair-pairs `(("case" . "esac")))
>
> Right, but using case for this would be a downside from my POV, if you
> write `case' in a comment for documentation it will auto insert `esac',
> another idea is define a variable in electric-pairs for this kind of pairs
> which specifies if a pair can be expanded in comments/strings.

That's why there is both `electric-pair-pairs' and `electric-pair-text-pairs'.

Another issue if we want to expand the scope of electric-pair is that
when the users type `case` maybe they're just yping `case` but cases
they're actually on their way to typing `cases` or `cased` or `case_nb`
or god knows what else: for those matched thingies that can be prefixes of
arbitrary identifiers, we'd probably want to wait for the user to hit
SPC (like abbrev does) before inserting the closing element.

        Stefan