GNU bug report logs -
#61175
30.0.50; c-indent-new-comment-line does not respect electric-pair-open-newline-between-pairs
Previous Next
To reply to this bug, email your comments to 61175 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#61175
; Package
emacs
.
(Mon, 30 Jan 2023 14:33:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
areg05 <areg05 <at> proton.me>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Mon, 30 Jan 2023 14:33:03 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)]
When I use c-indent-new-comment-line in between a pair (for example {} in c-mode), it does not correctly insert the extra newline and indent it, according to electric-pair-open-newline-between-pairs. After some debugging I discovered that this is because in c-indent-new-comment-line the `newline' function gets called non-interactively, which makes electric-pair's hooks not execute. A simple solution is to simply replace the call to `do-line-break' in c-indent-new-comment-line with (newline 1 t) in cc-cmds.el, line 5049. It does not seem break other functionality as the code in question is in a branch that gets executed only when the point is outside a comment or a macro. Also, I think it would be correct to remove the call to indent-to on line 5050 and rely on electric-indent to handle that for us instead.
Thank you.
[Message part 2 (text/html, inline)]
This bug report was last modified 2 years and 191 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.