GNU bug report logs -
#71459
29.3; reindent-then-newline-and-indent bug when newline triggers abbrev expansion
Previous Next
Reported by: z <at> bcc32.com
Date: Mon, 10 Jun 2024 04:11:02 UTC
Severity: normal
Found in version 29.3
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #10 received at 71459-done <at> debbugs.gnu.org (full text, mbox):
> From: z <at> bcc32.com
> Date: Sun, 09 Jun 2024 23:42:58 -0400
>
> 1. emacs -Q
> 2. Open an empty buffer in a mode like conf-mode. Enable abbrev-mode.
> 3. Type "# this is a comment", select the line, and run M-x
> add-mode-abbrev, give it some abbrev like "tc".
> 4. On a new line, type tc and then M-x reindent-then-newline-and-indent
>
> I expect this to insert "# this is a comment", but instead it inserts
> "#this is a comment". Note the missing space between the
> comment-start marker and the comment text.
>
> For context, this came up in a major mode (ledger-mode) where I had
> bound RET to reindent-then-newline-and-indent, so it happens quite
> freqently to me.
>
> I think just making reindent-then-newline-and-indent use a marker for
> the initial value of `pos' would work, but I haven't thought about it
> very much.
Thanks, I went with your suggestion of using a marker. I installed
the change on the master branch, and I'm therefore closing this bug.
This bug report was last modified 344 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.