GNU bug report logs - #76679
31.0.50; forward-sentence not working in the narrowed buffer under c-ts-mode

Previous Next

Package: emacs;

Reported by: lorniu <lorniu <at> gmail.com>

Date: Sun, 2 Mar 2025 10:23:02 UTC

Severity: normal

Tags: moreinfo

Merged with 76497

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 76679 <at> debbugs.gnu.org, lorniu <at> gmail.com, casouri <at> gmail.com
Subject: bug#76679: 31.0.50; forward-sentence not working in the narrowed buffer under c-ts-mode
Date: Tue, 11 Mar 2025 13:59:59 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: lorniu <lorniu <at> gmail.com>,  Yuan Fu <casouri <at> gmail.com>,
>   76679 <at> debbugs.gnu.org
> Date: Mon, 10 Mar 2025 20:28:12 +0200
> 
> >> The code `(forward-thing 'sentence)' is not working in narrowed region
> >> under c-ts-mode.
> >> 
> >> For example, open file `test.c`, then turn on `c-ts-mode', what in the
> >> buffer is:
> >> 
> >>     int main () { return 0; }
> >>   
> >> Now select word `return' and execute `narrow-to-region', then in buffer:
> >> 
> >>     Ireturn
> >> 
> >> where `I' represent the cursor. Now execute:
> >> 
> >>     (forward-thing 'sentence)
> >> 
> >> Then you will find that the cursor is stay still, not moving to the
> >> end. This behavior is not like the ones anywhere else, I think it's a bug.
> >
> > I'm not sure the notion of a "sentence" is well defined in C-like
> > languages.
> >
> > Yuan and Juri, any comments or suggestions?
> 
> We agreed that a "sentence" in C-like languages is a thing that
> ends with a semicolon (or a comma that separates arguments).
> 
> However, this report raises a different question: whether forward-sentence
> should navigate to the end of the narrowed region when the semicolon is hidden?

Nothing else would make sense.  Almost all Emacs commands behave like
there's nothing beyond the end of the narrowed region.  The few
exceptions are only in very specialized cases, which this one isn't,
because it's just a movement command.




This bug report was last modified 70 days ago.

Previous Next


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