GNU bug report logs -
#77081
[PATCH] New minor mode: `electric-block-comment-mode'
Previous Next
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77081 in the body.
You can then email your comments to 77081 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
emacs-devel <at> gnu.org, bug-gnu-emacs <at> gnu.org
:
bug#77081
; Package
emacs
.
(Mon, 17 Mar 2025 19:41:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Elijah Gabe Pérez <eg642616 <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
emacs-devel <at> gnu.org, bug-gnu-emacs <at> gnu.org
.
(Mon, 17 Mar 2025 19:41:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
This minor automatically lets you close block comment when typing
a block comment start.
Thus...
#+begin_src
typing /* in c-mode
automatically inserts */.
electric-block-comment-mode: on
/*|
^ cursor
/* | */
^ cursor
Or in lua --[[ inserts ]]--.
electric-block-comment-mode: on
--[[|
^ cursor
--[[ | ]]--
^ cursor
#+end_src
and so on.
*However, there is a problem,*
This minor mode uses =block-comment-start= and =block-comment-end=
variables, which most of the major modes do not use or define.
The reason I decided to use these variables is because are more explicit
with the type of comment that is used/supported.
I would like to hear your feedback.
[Message part 2 (text/html, inline)]
[0001-New-minor-mode-electric-block-comment-mode.patch (text/x-patch, attachment)]
[Message part 4 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77081
; Package
emacs
.
(Mon, 17 Mar 2025 19:52:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 77081 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I'm not sure how did this mail sent a CC to emacs-devel list.
I'm sorry for the inconvenience.
[Message part 2 (text/html, inline)]
[Message part 3 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77081
; Package
emacs
.
(Mon, 17 Mar 2025 23:04:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 77081 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I've noticed a little error in the sent patch,
sending fixed one.
[Message part 2 (text/html, inline)]
[0001-New-minor-mode-electric-block-comment-mode.patch (text/x-patch, attachment)]
[Message part 4 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77081
; Package
emacs
.
(Sat, 22 Mar 2025 12:05:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 77081 <at> debbugs.gnu.org (full text, mbox):
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Date: Mon, 17 Mar 2025 17:03:42 -0600
>
> I've noticed a little error in the sent patch,
> sending fixed one.
Thanks.
> --- a/etc/NEWS
> +++ b/etc/NEWS
> @@ -111,6 +111,10 @@ If you have been using these variables in Lisp code (for example, in
> font-lock rules), simply quote the symbol, to use the face directly
> instead of its now-obsolete variable.
>
> +** New minor mode 'electric-block-comment-mode'
> +This mode automatically close block comment typed, thus typing
> +"/*" in c-mode automatically inserts "*/".
> +
This should mention block-comment-start and block-comment-end. Also,
it would be good to name a few modes which support block comments,
just so users of those modes will become interested.
> +(defun electric-block-comment-post-self-insert-function ()
> + "Function that `electric-block-comment' adds to `post-self-insert-hook'.
> +This closes block comment when a block comment start is typed."
This doc string should likewise mention block-comment-start and
block-comment-end.
> +(define-minor-mode electric-block-comment-mode
> + "Toggle automatic close comment blocks (Electric Comment mode).
^^^^^^^^^^^^^^^^^^^^
"closing of block comments"
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77081
; Package
emacs
.
(Sat, 22 Mar 2025 19:52:03 GMT)
Full text and
rfc822 format available.
Message #17 received at 77081 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> --- a/etc/NEWS
>> +++ b/etc/NEWS
>> @@ -111,6 +111,10 @@ If you have been using these variables in Lisp code (for example, in
>> font-lock rules), simply quote the symbol, to use the face directly
>> instead of its now-obsolete variable.
>> +** New minor mode 'electric-block-comment-mode'
>> +This mode automatically close block comment typed, thus typing
>> +"/*" in c-mode automatically inserts "*/".
>> +
> This should mention block-comment-start and block-comment-end. Also,
> it would be good to name a few modes which support block comments,
> just so users of those modes will become interested.
I agree, done.
Sending fixed patch.
[Message part 2 (text/html, inline)]
[0001-New-minor-mode-electric-block-comment-mode.patch (text/x-patch, attachment)]
[Message part 4 (text/plain, inline)]
--
- E.G via GNU Emacs and Org.
Reply sent
to
Eli Zaretskii <eliz <at> gnu.org>
:
You have taken responsibility.
(Sat, 29 Mar 2025 11:05:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Elijah Gabe Pérez <eg642616 <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 29 Mar 2025 11:05:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 77081-done <at> debbugs.gnu.org (full text, mbox):
> From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
> Cc: 77081 <at> debbugs.gnu.org
> Date: Sat, 22 Mar 2025 13:51:42 -0600
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> — a/etc/NEWS
> + b/etc/NEWS
> @@ -111,6 +111,10 @@ If you have been using these variables in Lisp code (for example, in
> font-lock rules), simply quote the symbol, to use the face directly
> instead of its now-obsolete variable.
>
> +** New minor mode 'electric-block-comment-mode'
> +This mode automatically close block comment typed, thus typing
> +"" in c-mode automatically inserts "".
> +
>
> This should mention block-comment-start and block-comment-end. Also,
> it would be good to name a few modes which support block comments,
> just so users of those modes will become interested.
>
> I agree, done.
>
> Sending fixed patch.
Thanks, installed on the master branch, and closing the bug.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 26 Apr 2025 11:24:13 GMT)
Full text and
rfc822 format available.
This bug report was last modified 15 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.