GNU bug report logs -
#78865
31.0.50; Inconsistency between show-paren-mode and some cursor-movement commands
Previous Next
Reported by: Dani Moncayo <dmoncayo <at> gmail.com>
Date: Sun, 22 Jun 2025 18:55:02 UTC
Severity: normal
Tags: notabug, wontfix
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
On Sun, 22 Jun 2025 20:53:39 +0200 Dani Moncayo <dmoncayo <at> gmail.com> wrote:
> Consider a C source file like the one created with the shell command below [1].
>
> If I visit that file with Emacs and move the cursor just before the
> "[", I see that both square brackets are highlighted -- perfect.
>
> But then, if I type C-M-n from that point, I'd expect the cursor to
> jump from the "[" to the "]". Well, it does not. Instead, the cursor
> jumps just after "f1()".
>
> This behavior seems inconsistent to me, and also doesn't allow me to
> move between those "comment-marks" I like to put sometimes in my code
> to define a kind of logical grouping.
`C-M-n' runs the command `forward-list', whose doc string says: "This
command assumes point is not in a string or comment."
> And BTW, if I change the major mode to text-mode, I get the behavior I
> want -- I can even type C-M-u from anywhere inside that "logical
> group" and jump to its beginning "[".
That's because "//" does not mark a comment in text-mode, which defines
no comment syntax by default. But text-mode recognizes "[" and "]" as
balanced delimiters, so C-M-n and C-M-u work as expected with them.
Steve Berman
> Footnote [1]:
> $ cat <<eof > file1.c
> //[ begin of group foo
>
> int void f1()
> {
> //...
> }
> int void f2()
> {
> //...
> }
>
> //] end of group foo
> eof
This bug report was last modified 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.