> This isn't fundamentally about comments at all. For example, these
> multichar pairs could include the opening "case" and closing "esac" in a
> shell script, right?
Maybe 'electric-pair-mode' should support string delimiters
in addition to characters, e.g.
(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.