GNU bug report logs -
#79047
Add some multi-character pairs to some major modes.
Previous Next
Full log
View this message in rfc822 format
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Cc: 79047 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>, John Muhl
> <jm <at> pub.pink>, Stefan Monnier <monnier <at> iro.umontreal.ca>
> Date: Tue, 22 Jul 2025 17:03:34 -0600
>
> Alan Mackenzie <acm <at> muc.de> writes:
>
> > Hello, Elijah.
> >
> > One important point.
> >
> > Are you sure about this? In NEWS, there is the rather sloppily worded
> > entry:
> >
> > ** Electric Pair mode can now pair multiple delimiters at once.
> > You can now insert or wrap text with multiple sets of parentheses and
> > other matching delimiters at once with Electric Pair mode, by providing
> > a prefix argument when inserting one of the delimiters.
> >
> > It uses the sloppy American English ambiguity where "multiple" can mean
> > either "several", or "composed of several parts". In correct British
> > English "multiple" has only the latter meaning.
> >
> > I think in this NEWS entry the meaning "several" was intended, and you
> > may have misread it. I don't think electric-pair-mode has any facilities
> > for pairing a multiple delimiter; only for pairing several of the same
> > delimiter at once, e.g. (((....))).
>
> That is the wrong NEWS entry of the feature.
> The real one is this:
>
> *** Electric Pair mode now supports multi-character paired delimiters.
> 'electric-pair-pairs' and 'electric-pair-text-pairs' now allow using
> strings for multi-character paired delimiters.
>
> To use this, add a list to both electric pair user options: '("/*" . "*/")'.
>
> You can also specify to insert an extra space after the first string
> pair: '("/*" " */" t)'.
>
> > Please check if I am correct or mistaken on this point. If I'm correct,
> > then the prerequisites for implementing this change are absent, and there
> > is nothing more to discuss.
>
> I've tested the feature, it's possible to achieve it:
>
> (setq electric-pair-pairs `((,(regexp-quote "/*") " */" t)))
>
> /* | */
> ^^ After inserting the * character.
> (the extra whitespace is optionally included)
Can we please have a patch to install, which incorporates all the
discussions we had here?
This bug report was last modified 1 day ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.