* bug#61175: 30.0.50; c-indent-new-comment-line does not respect electric-pair-open-newline-between-pairs
@ 2023-01-30 13:00 areg05 via Bug reports for GNU Emacs, the Swiss army knife of text editors
0 siblings, 0 replies; only message in thread
From: areg05 via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-01-30 13:00 UTC (permalink / raw)
To: 61175
[-- Attachment #1: Type: text/plain, Size: 829 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 1173 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-30 13:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-30 13:00 bug#61175: 30.0.50; c-indent-new-comment-line does not respect electric-pair-open-newline-between-pairs areg05 via Bug reports for GNU Emacs, the Swiss army knife of text editors
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.