GNU bug report logs - #77081
[PATCH] New minor mode: `electric-block-comment-mode'

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Mon, 17 Mar 2025 19:41:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Subject: bug#77081: closed (Re: bug#77081: [PATCH] New minor mode:
 `electric-block-comment-mode')
Date: Sat, 29 Mar 2025 11:05:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#77081: [PATCH] New minor mode: `electric-block-comment-mode'

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 77081 <at> debbugs.gnu.org.

-- 
77081: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=77081
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: 77081-done <at> debbugs.gnu.org
Subject: Re: bug#77081: [PATCH] New minor mode: `electric-block-comment-mode'
Date: Sat, 29 Mar 2025 14:03:57 +0300
> 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.

[Message part 3 (message/rfc822, inline)]
From: Elijah Gabe Pérez <eg642616 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] New minor mode: `electric-block-comment-mode'
Date: Mon, 17 Mar 2025 13:40:24 -0600
[Message part 4 (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 5 (text/html, inline)]
[0001-New-minor-mode-electric-block-comment-mode.patch (text/x-patch, attachment)]
[Message part 7 (text/plain, inline)]
-- 
                                          - E.G via GNU Emacs and Org.

This bug report was last modified 106 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.