Subject: bug#79047: Add some multi-character pairs to some major modes.

From: Alan Mackenzie <[email-masked]>
Date: Sat, 19 Jul 2025 16:52:45 +0000

Hello, Elijah.

On Sat, Jul 19, 2025 at 10:39:03 -0600, Elijah Gabe Pérez wrote:
> Alan Mackenzie <[email-masked]> writes:

> >> > From: Elijah Gabe Pérez <[email-masked]>
> >> > Date: Fri, 18 Jul 2025 20:04:12 -0600

> >> > Since `electric-pair-mode` now supports multi-character pairs, it would
> >> > be better if some major modes add some of these pairs.

> >> > Before making the patch for this (and to avoid doing another regression
> >> > like bug#77823), here is a list of the modes and their possible pairs:

> >> >  - c-like modes
> >> >      "/*" "*/"

> > Elijah, I'm speaking here from the point of view of CC Mode.

> > What exactly do you mean by "adding" these multi-character pairs?  What
> > would the user see that she doesn't already see?

> These pairs are meant to be used in for auto-close block comments, after
> the user types "/*", the corresponding "*/" will be inserted, packages
> such as smartparens provide this behavior to most C-like modes.

OK, thanks.

But who's going to want to do this when there's M-; `comment-dwim' which
inserts both the comment opener and comment closer in a single key
stroke?  Surely anybody typing /* explicitly will being doing so on a
rare occasion when she _doesn't_ want the closing */ also inserted.

> > Or are you talking about doing something we already do, but in a
> > different way?

> I don't know if CC Mode have something similar.

M-; is common to most (?all) programming and text modes.

> -- 
> - E.G via GNU Emacs and Org.

-- 
Alan Mackenzie (Nuremberg, Germany).