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

From: Elijah Gabe Pérez <[email-masked]>
Date: Sat, 19 Jul 2025 12:26:59 -0600

Alan Mackenzie <[email-masked]> writes:

>> > 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?

comment-dwim sometimes doesn't insert the comments where i want, it
mostly insert the comments at the end of the line, or indent them
according to `comment-column` (which ofc can be configured, but in most
the cases, it will not work as expected).

> Surely anybody typing /* explicitly will being doing so on a
> rare occasion when she _doesn't_ want the closing */ also inserted.

The feature can be optional, enabled via an user option or command,
similar to `c-toggle-auto-newline`.

>> > 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.

Right, but calling comment-dwim in some modes doesn't insert a block
comment, even if those modes supports block comments, (e.g. js-mode)

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