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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: lorniu <lorniu@HIDDEN>; Keywords: moreinfo; merged with #76497; Done: Juri Linkov <juri@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug marked as fixed in version 31.0.50, send any further explanations to 76679 <at> debbugs.gnu.org and lorniu <lorniu@HIDDEN> Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.
Merged 76497 76679. Request was from Juri Linkov <juri@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 13 Mar 2025 18:46:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 13 14:46:46 2025
Received: from localhost ([127.0.0.1]:58104 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tsnZt-0002rR-Ki
	for submit <at> debbugs.gnu.org; Thu, 13 Mar 2025 14:46:45 -0400
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:43103)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>)
 id 1tsnZr-0002qz-Ii; Thu, 13 Mar 2025 14:46:43 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 8E07A44349;
 Thu, 13 Mar 2025 18:46:35 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the
 narrowed buffer under c-ts-mode
In-Reply-To: <87ldtbo5s8.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
 <87y0xcrb9f.fsf@HIDDEN> <86msdrdbgg.fsf@HIDDEN>
 <87ldtbo5s8.fsf@HIDDEN>
Date: Thu, 13 Mar 2025 20:45:09 +0200
Message-ID: <87cyekwz0q.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdekjeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohephedprhgtphhtthhopegtohhnthhrohhlseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomhdprhgtphhtthhopehlohhrnhhiuhesghhmrghilhdrtghomhdprhgtphhtthhopeejieeijeelseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepvghlihiisehgnhhurdhorhhg
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, lorniu@HIDDEN, casouri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

merge 76679 76497
close 76679 31.0.50
thanks

> @@ -3417,9 +3417,10 @@ treesit-forward-sentence
>  by `text' and `sentence' in `treesit-thing-settings'."
>    (if (treesit-node-match-p (treesit-node-at (point)) 'text t)
>        (funcall #'forward-sentence-default-function arg)
> -    (funcall
> -     (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing)
> -     'sentence (abs arg))))
> +    (or (funcall
> +         (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing)
> +         'sentence (abs arg))
> +        (goto-char (if (> arg 0) (point-max) (point-min))))))

Actually this is not so simple, because also need to handle
range boundaries as well.  So pushed the change that stops
at the 'treesit-parser' overlay's end.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 11 Mar 2025 17:22:16 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 11 13:22:16 2025
Received: from localhost ([127.0.0.1]:45392 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ts3J1-0000Fc-ME
	for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 13:22:16 -0400
Received: from relay6-d.mail.gandi.net ([2001:4b98:dc4:8::226]:38919)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1ts3Io-0000Eg-C7
 for 76679 <at> debbugs.gnu.org; Tue, 11 Mar 2025 13:22:03 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 6EFE2442BB;
 Tue, 11 Mar 2025 17:21:52 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the
 narrowed buffer under c-ts-mode
In-Reply-To: <86msdrdbgg.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
 <87y0xcrb9f.fsf@HIDDEN> <86msdrdbgg.fsf@HIDDEN>
Date: Tue, 11 Mar 2025 19:17:03 +0200
Message-ID: <87ldtbo5s8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvddvkedvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopeejieeijeelseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomhdprhgtphhtthhopehlohhrnhhiuhesghhmrghilhdrtghomhdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, lorniu@HIDDEN, casouri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> 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.

Ok, this patch provides the same behavior as for forward-sentence:

diff --git a/lisp/treesit.el b/lisp/treesit.el
index 319dc5a41fc..f94c97c2e7c 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -3417,9 +3417,10 @@ treesit-forward-sentence
 by `text' and `sentence' in `treesit-thing-settings'."
   (if (treesit-node-match-p (treesit-node-at (point)) 'text t)
       (funcall #'forward-sentence-default-function arg)
-    (funcall
-     (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing)
-     'sentence (abs arg))))
+    (or (funcall
+         (if (> arg 0) #'treesit-end-of-thing #'treesit-beginning-of-thing)
+         'sentence (abs arg))
+        (goto-char (if (> arg 0) (point-max) (point-min))))))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 11 Mar 2025 14:41:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 11 10:41:34 2025
Received: from localhost ([127.0.0.1]:44956 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ts0nV-0003LN-TX
	for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 10:41:34 -0400
Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:44193)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1ts0nS-0003L8-Dt
 for 76679 <at> debbugs.gnu.org; Tue, 11 Mar 2025 10:41:31 -0400
Received: by mail-ed1-x536.google.com with SMTP id
 4fb4d7f45d1cf-5e6ff035e9aso1232812a12.0
 for <76679 <at> debbugs.gnu.org>; Tue, 11 Mar 2025 07:41:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741704084; x=1742308884; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=HkbSe+VhIVhBEcfJqXvrNultHYnxqBRCd3vEL8cFO3Q=;
 b=WXGGjx5qluysvw4z8v2hsSOHskwFi57Vb0eUwAM8aIVc6IJEzxikwzRrt1VWSQFXmx
 0T4HrRWkSFPzTK5F5QzWG7VjM3daM5lKVKWJI3MJq0G2deOVsrQaNihLBh8nd8p4N4Jv
 m94/fCrEnqVqytoLqTqXgB57INxRaovm9BvwrhKUN0ju4IAQ7+yo3qOPQGjdG2q+XiRZ
 /QgYISs5Ygl2hAJTTsiNKxhTDYVQ+nn8lkY8bRU5C5++1ZcoXNk4j3uQKZmwPaM/2l37
 h/5rRjaXAwM3anBEONEwB7BPDhHUM/dZ9erQwhuHMY6QwC5vibwGK2QlKJOEluO7gkeq
 kzsg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741704084; x=1742308884;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=HkbSe+VhIVhBEcfJqXvrNultHYnxqBRCd3vEL8cFO3Q=;
 b=Lt5S/geUxSVNCSfCTvKHe9BQ8/PphW2OzuIpdxWpZeybKBmk6ZUm08MVFFfLuBBN0Q
 V+2wDzvppxPRj1oxQ6r5giJf0YyBbkQstir2b+xVshshd91x8wmI+MBW6QJjTvfsI3Bu
 hfvBhyJOSQV0cEdIH+MB3zQDtBXwJs2hjCBQXcdfierhEmZta5VTi8xUzQ6nWnOsTibz
 WEodluHONhw9GKpd4BftOoYl4gJSZnMscLrRPMc2IXiP8Lp8yQhAfvgChZ9SjUEO2FUB
 q3tbbLH33QE1rMohwz/DSr/r20qxxWGkOgMFrloR4p9Dz7wTx3aqRntZS41h/fOnurJs
 gr/g==
X-Forwarded-Encrypted: i=1;
 AJvYcCX5Xqxat/CDkvjfJa7irx/yikhxFJJvZ+a+Sj1mU+Mcmxa/6KL0l1iKFvaW0ouy3IHaoKyo9A==@debbugs.gnu.org
X-Gm-Message-State: AOJu0YyBGU3tkZurqxri5mhCr5seRCAhjxD9rSpSvoEuIjTCSsk6DRKj
 XjCgdJ5PfxK0TB4Jg0YgJT+jOoH70apYts4muujC5oLeAS/6QrBZt91RGcgTCqaYzm6VvpKIFd6
 w5RglFL450zuW99dkdrWHaiFhS1c=
X-Gm-Gg: ASbGncuKzeZoBIgSE5Ivy+oEu51U8hdduss1I8amVpLSu/mg8s7cCOUPkTNtzCGC4ET
 iSqgXTXp9ZXIdta5sSf2MjnXsiZhWERCVkAGfQZBECKv3IPwoX7RNGkUh7nmLjEVUkW4ZYZ3K6+
 QcNGjTlAw0wgpP8hjDOSRsj6yJfio27+qDonUA+A==
X-Google-Smtp-Source: AGHT+IGIg+b2CwUitbKOW6xZ3yxFtVVuBc/IPKcRNcQr9b62Fe5UovtkxdE6fkfgUwSCWV/YY7dkeZEfXoey7hzGuI8=
X-Received: by 2002:a05:6402:50c8:b0:5d0:ed71:3ce4 with SMTP id
 4fb4d7f45d1cf-5e75de57db0mr5762201a12.6.1741704083975; Tue, 11 Mar 2025
 07:41:23 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Tue, 11 Mar 2025 10:41:22 -0400
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87a59sowwu.fsf@HIDDEN>
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
 <87y0xcrb9f.fsf@HIDDEN>
 <CADwFkm=7yq3uaMteQzKSShqm4fhKxKEo4reUgsdwBS4jQWThbw@HIDDEN>
 <87a59sowwu.fsf@HIDDEN>
MIME-Version: 1.0
Date: Tue, 11 Mar 2025 10:41:22 -0400
X-Gm-Features: AQ5f1JoZa7mftteXlhv51EwT3iebUSceBIMjESMfzcye0YFfI9UfNIePm4pGNng
Message-ID: <CADwFkmnTRSL3YqBMOL4EmU0wRnaL52RBeOSpmbyO=+agwbA7FA@HIDDEN>
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the narrowed
 buffer under c-ts-mode
To: Juri Linkov <juri@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Yuan Fu <casouri@HIDDEN>, lorniu <lorniu@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Juri Linkov <juri@HIDDEN> writes:

>>> 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?
>>
>> Isn't that what forward-sentence does in e.g. text-mode?  So wouldn't
>> doing that in C-like languages be consistent with that?
>
> When you set the end of the narrowed region at the middle
> of the sentence either in text-mode or in C-like languages,
> then use forward-sentence to move the end of the narrowed region,
> then widen with 'C-x n w', point will be not at the end
> of the sentence.  This behavior makes no sense.
>
> Regardless of the fact that treesit-forward-sentence works
> differently from forward-sentence, their both results make no sense.
>
> There is no meaningful difference whether to keep point at its old
> position as treesit-forward-sentence does, or move point to the
> middle of the sentence as forward-sentence does.
>
> So I think there is no bug here.

Doesn't it make sense to be consistent with `fundamental-mode`?

Consider this case:

    (progn
      (get-buffer-create "mybuf99")
      (pop-to-buffer "mybuf99")
      (erase-buffer)
      (insert "sentence sentence sentence.")
      (goto-char (point-min))
      (narrow-to-region (point-min) 15)
      (forward-sentence)
      (widen))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 11 Mar 2025 13:18:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 11 09:18:40 2025
Received: from localhost ([127.0.0.1]:42207 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trzVH-00073q-IU
	for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 09:18:39 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:56422)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1trzVE-00073c-5l
 for 76679 <at> debbugs.gnu.org; Tue, 11 Mar 2025 09:18:37 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1trzV7-0003bI-Jr; Tue, 11 Mar 2025 09:18:29 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=gj/bqB30oTsKjPg7bBwuIqHjYws1p08UtC5SWyEF5yU=; b=Y8oIlFAPzRwk
 WNhUexsKHuLOYWdo/xMHeXwHRvvoBdlM5DcGLtNacFlFSWoXsZi4IG8kPFDuucpEqJZHwa8QLSHZc
 wa5n3Re3cW9nXT4C5n/q+vKmiZ9rCpuCPSTLotr1lxwfkhDmqm4DOAeCZw33VU+Bf874+uSwNyNeQ
 BLDdrb0B7xJRCP96gRfKQNqXdSmr06bdjnjQxEJHlO2cViybLkmBmB/veCz3KgriVtMEMHomU0QNa
 j3meuinNO/Mtval9y836xv7RfNDmayCmtnALPW5Pc/nN3xEgZRpZU5LAawk0IAEQ9BOCR6rU0750L
 Pq11mBR06veDK3+5056cFw==;
Date: Tue, 11 Mar 2025 15:18:27 +0200
Message-Id: <86y0xbbt98.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87a59sowwu.fsf@HIDDEN> (message from Juri Linkov on
 Tue, 11 Mar 2025 09:24:05 +0200)
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the
 narrowed buffer under c-ts-mode
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
 <87y0xcrb9f.fsf@HIDDEN>
 <CADwFkm=7yq3uaMteQzKSShqm4fhKxKEo4reUgsdwBS4jQWThbw@HIDDEN>
 <87a59sowwu.fsf@HIDDEN>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, lorniu@HIDDEN, casouri@HIDDEN,
 stefankangas@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> From: Juri Linkov <juri@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>,  76679 <at> debbugs.gnu.org,  lorniu
>  <lorniu@HIDDEN>,  Yuan Fu <casouri@HIDDEN>
> Date: Tue, 11 Mar 2025 09:24:05 +0200
> 
> >> 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?
> >
> > Isn't that what forward-sentence does in e.g. text-mode?  So wouldn't
> > doing that in C-like languages be consistent with that?
> 
> When you set the end of the narrowed region at the middle
> of the sentence either in text-mode or in C-like languages,
> then use forward-sentence to move the end of the narrowed region,
> then widen with 'C-x n w', point will be not at the end
> of the sentence.  This behavior makes no sense.

Why does it not make sense?  What else would you expect a movement
command to do?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 11 Mar 2025 12:00:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 11 08:00:19 2025
Received: from localhost ([127.0.0.1]:42008 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tryHS-00019d-UE
	for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 08:00:19 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:52216)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tryHM-0000WJ-TX
 for 76679 <at> debbugs.gnu.org; Tue, 11 Mar 2025 08:00:13 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tryHE-0003Wr-G7; Tue, 11 Mar 2025 08:00:05 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=t6BNT6OHeXTR8WU3pzroA0IQxX5dC5HqqK9354gpeWY=; b=I9F18WmXkAEy
 8Awa9pok929svsHLNOl0m2juYVQ5mf19VMSERrw0X+/yAOPv3zYBLRJMuuQzRuY3ZrVbODTwWnoYB
 G/wuyOym14WQLAzonpAzmCPSykO/lAAmD4D59e0D42SKRID97+kjqNwTV5UFeZ6vP55mSloK+TTae
 CgutKqXvjZWlRzmpDgv5pcc/bQf1ciQ/GXAq0dJwL6hvFKovGKV/kVX1CxHSFB4ZC885c+oLisIjX
 5PpGQQM0rsgxzGtBWcpYAIZpuZNYV9JL+EYldDhugTT8a6Lcj5lsKhxgWUFxjUe+Kb+kh1y/7ia3T
 5Fs+FRtduZ1A77aict97Hg==;
Date: Tue, 11 Mar 2025 13:59:59 +0200
Message-Id: <86msdrdbgg.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
In-Reply-To: <87y0xcrb9f.fsf@HIDDEN> (message from Juri Linkov on
 Mon, 10 Mar 2025 20:28:12 +0200)
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the
 narrowed buffer under c-ts-mode
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
 <87y0xcrb9f.fsf@HIDDEN>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, lorniu@HIDDEN, casouri@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> From: Juri Linkov <juri@HIDDEN>
> Cc: lorniu <lorniu@HIDDEN>,  Yuan Fu <casouri@HIDDEN>,
>   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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 11 Mar 2025 07:34:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 11 03:34:35 2025
Received: from localhost ([127.0.0.1]:41336 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tru8I-0000sA-IH
	for submit <at> debbugs.gnu.org; Tue, 11 Mar 2025 03:34:34 -0400
Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:45887)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1tru8F-0000rm-OM
 for 76679 <at> debbugs.gnu.org; Tue, 11 Mar 2025 03:34:32 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id D2EF54442F;
 Tue, 11 Mar 2025 07:34:22 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Stefan Kangas <stefankangas@HIDDEN>
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the
 narrowed buffer under c-ts-mode
In-Reply-To: <CADwFkm=7yq3uaMteQzKSShqm4fhKxKEo4reUgsdwBS4jQWThbw@HIDDEN>
Organization: LINKOV.NET
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
 <87y0xcrb9f.fsf@HIDDEN>
 <CADwFkm=7yq3uaMteQzKSShqm4fhKxKEo4reUgsdwBS4jQWThbw@HIDDEN>
Date: Tue, 11 Mar 2025 09:24:05 +0200
Message-ID: <87a59sowwu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvdduieegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohephedprhgtphhtthhopegtrghsohhurhhisehgmhgrihhlrdgtohhmpdhrtghpthhtoheplhhorhhnihhusehgmhgrihhlrdgtohhmpdhrtghpthhtohepjeeiieejleesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopehsthgvfhgrnhhkrghnghgrshesghhmrghilhdrtghomh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>,
 Yuan Fu <casouri@HIDDEN>, lorniu <lorniu@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> 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?
>
> Isn't that what forward-sentence does in e.g. text-mode?  So wouldn't
> doing that in C-like languages be consistent with that?

When you set the end of the narrowed region at the middle
of the sentence either in text-mode or in C-like languages,
then use forward-sentence to move the end of the narrowed region,
then widen with 'C-x n w', point will be not at the end
of the sentence.  This behavior makes no sense.

Regardless of the fact that treesit-forward-sentence works
differently from forward-sentence, their both results make no sense.

There is no meaningful difference whether to keep point at its old
position as treesit-forward-sentence does, or move point to the
middle of the sentence as forward-sentence does.

So I think there is no bug here.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 10 Mar 2025 19:18:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 10 15:18:34 2025
Received: from localhost ([127.0.0.1]:39835 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trie1-0003tN-S6
	for submit <at> debbugs.gnu.org; Mon, 10 Mar 2025 15:18:34 -0400
Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:47573)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>)
 id 1tridz-0003t8-3u
 for 76679 <at> debbugs.gnu.org; Mon, 10 Mar 2025 15:18:31 -0400
Received: by mail-ed1-x531.google.com with SMTP id
 4fb4d7f45d1cf-5e5b56fc863so6655906a12.3
 for <76679 <at> debbugs.gnu.org>; Mon, 10 Mar 2025 12:18:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1741634305; x=1742239105; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:from:to:cc:subject:date:message-id:reply-to;
 bh=BBKdlHSqbwPf1s4ViiHKiFVxDSuK7iZOzhUnEFjOumg=;
 b=JtPLY+MqOzkH3TvAnwRgArzdkur4ImVxdXze2nYKQvreZqvKtEUCJukx7tCWKVs7wO
 Oe96TetnArA5STuo4Hdy0W+/xUFEJ1Z1w+eefyqclheJgWj2fgzbrt5KrngR1kFt8oJW
 4BoMPAC3FzYJIJRz7Z/+FjTaLEl8qI7PpF1+irHzauQbhjuAkWnvbetJBq+L/B2+s2us
 D7szQAKaeCCeC6ey4rvV0cTqYJAmJLRN1hsirv1wmrfRlQ/Vik/20T8jv3OdaHWTWwno
 urS1AQUQyO+RjXd0sIxCx2wc/zh03tqLup3hAld7g3vtUWqMtPnL70hxa1qw0ScegqtJ
 l/1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1741634305; x=1742239105;
 h=cc:to:subject:message-id:date:mime-version:references:in-reply-to
 :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=BBKdlHSqbwPf1s4ViiHKiFVxDSuK7iZOzhUnEFjOumg=;
 b=XIhGxqdw1XLS7EvaZTSQ3kjAKMSuRlqhSdlc0mVni7zrJ0R3egRNa0bpHHInmoTLrC
 HYfSsLvP/7G9jZLSph/dQl58fvSBOZAyI23rCs91dWmMnId1u/tMBQT5MjdwwYzBppYq
 W5tbnPv8viGU7PeGfFFe5gHnD8iZjud7dlzakSSv3ms4B4pxEtwKm9Xbij6HSp0IvH2b
 GgU89hMqPaJOFSe9tmg1EdnX9nNnvXCxdxRgc/UH32T1cqonGoBdlgvPJvBaQ3uFP2Hw
 drOB3P5h1VxmXe5SSRh5kQKoDZzKrfsxV5d1tigO/7B46KXWTnazLi+4Ecy9VPFssIw/
 4NuA==
X-Gm-Message-State: AOJu0YyMLrdytZy/AUNvFrwG6gIbjJIuU1iCwIodtpfSPzQW/JyXoDmF
 K0oXd28JY4N48iRfShwlnjAevpYEP6/ue66WT/2xpVbFr8j4zvbxLdxn3ISAAjFx8EWkK8OJuZI
 w39AoFXoNiMMwQJ8RKJDckHtzDTg=
X-Gm-Gg: ASbGncsR8tqAnwk8qGoWPn5Dn4Ao1Y273NBxJKqD68l3tZyMyhtzZ38KiI5NB9rIe6Z
 I84xGERfhyNyBXa+H7NidAHGbYs7jWg7LifMvVJg7c7KQlHzp38SynODPmBuZtYcNqWTlBrEg1k
 BRbIqgRV45rE9mxCIQbF5E0nB17mlfzeFAUPwNrA==
X-Google-Smtp-Source: AGHT+IGBxaZEcMhsbQVS0fEU3Fp1N9sDsDF3hvxpxOGLORFqXt29iTiJLEQ9jVxzPljnT3SKstFqTmPYm4z8CgV/ALw=
X-Received: by 2002:a05:6402:27d3:b0:5e5:9a2b:167a with SMTP id
 4fb4d7f45d1cf-5e75e436431mr1268354a12.17.1741634304675; Mon, 10 Mar 2025
 12:18:24 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Mon, 10 Mar 2025 15:18:24 -0400
From: Stefan Kangas <stefankangas@HIDDEN>
In-Reply-To: <87y0xcrb9f.fsf@HIDDEN>
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
 <87y0xcrb9f.fsf@HIDDEN>
MIME-Version: 1.0
Date: Mon, 10 Mar 2025 15:18:24 -0400
X-Gm-Features: AQ5f1JqQEtcg-vWE-nKnmmW4LISnI8_ICi7HjFWjjUhkr4CVjjJDRfrv1xUYwsM
Message-ID: <CADwFkm=7yq3uaMteQzKSShqm4fhKxKEo4reUgsdwBS4jQWThbw@HIDDEN>
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the narrowed
 buffer under c-ts-mode
To: Juri Linkov <juri@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, lorniu <lorniu@HIDDEN>,
 Yuan Fu <casouri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Juri Linkov <juri@HIDDEN> writes:

> 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?

Isn't that what forward-sentence does in e.g. text-mode?  So wouldn't
doing that in C-like languages be consistent with that?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 10 Mar 2025 18:37:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Mar 10 14:37:09 2025
Received: from localhost ([127.0.0.1]:39751 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trhzw-0001wD-Vv
	for submit <at> debbugs.gnu.org; Mon, 10 Mar 2025 14:37:09 -0400
Received: from relay4-d.mail.gandi.net ([2001:4b98:dc4:8::224]:49959)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1trhzp-0001vC-6u
 for 76679 <at> debbugs.gnu.org; Mon, 10 Mar 2025 14:37:01 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 97C7D4451C;
 Mon, 10 Mar 2025 18:36:53 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76679: 31.0.50; forward-sentence not working in the
 narrowed buffer under c-ts-mode
In-Reply-To: <8634fmh6gm.fsf@HIDDEN>
Organization: LINKOV.NET
References: <87mse37u6n.fsf@HIDDEN> <8634fmh6gm.fsf@HIDDEN>
Date: Mon, 10 Mar 2025 20:28:12 +0200
Message-ID: <87y0xcrb9f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvddttdekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopeejieeijeelseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtoheptggrshhouhhrihesghhmrghilhdrtghomhdprhgtphhtthhopehlohhrnhhiuhesghhmrghilhdrtghomhdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrgh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org, lorniu <lorniu@HIDDEN>,
 Yuan Fu <casouri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at 76679 <at> debbugs.gnu.org:


Received: (at 76679) by debbugs.gnu.org; 9 Mar 2025 09:57:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 09 05:57:40 2025
Received: from localhost ([127.0.0.1]:58427 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1trDPg-0005sW-DO
	for submit <at> debbugs.gnu.org; Sun, 09 Mar 2025 05:57:40 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:57662)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1trDPe-0005sC-I7
 for 76679 <at> debbugs.gnu.org; Sun, 09 Mar 2025 05:57:38 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1trDPY-0001Os-CI; Sun, 09 Mar 2025 05:57:32 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=+9+vAc6TtagYE54aLl3htj9i/VbjerD/Fx8s+UzSlKA=; b=VdrCHXtMljti
 KY71Jt0Vke8aNbEvYo/C2hv/jbPUc/jieXrL/shAUQ7HsWfhqPz8KCwWwfIWxfcycx9w0Aay8kOdG
 tPkoJBokZiu3W6p0VmmzUH6kwcEdhBQqPVi5WNBBNawMWzleSyDaBMiXcz4887Sug39+ksz5OOVry
 QeCHlzVMHrIQaq6Wu8PtJmlkLRVBtbkLjehgf9QmhxNJiq1dp3cxiU4HmofqvQI+Vba9BGnTurZ/h
 wkj/OZo9w/o+JQBTx2QEd9i6igRzy3bCTMbkOM1vm6zjptNEooWkWJxa44Oz1362dWuRn+Y8fS7zZ
 aTWFjm09hJY/pNlgyJX0+Q==;
Date: Sun, 09 Mar 2025 11:57:29 +0200
Message-Id: <8634fmh6gm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: lorniu <lorniu@HIDDEN>, Yuan Fu <casouri@HIDDEN>,
 Juri Linkov <juri@HIDDEN>
In-Reply-To: <87mse37u6n.fsf@HIDDEN> (message from lorniu on Sun, 02 Mar
 2025 15:44:48 +0800)
Subject: Re: bug#76679: 31.0.50;
 forward-sentence not working in the narrowed buffer under c-ts-mode
References: <87mse37u6n.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76679
Cc: 76679 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: lorniu <lorniu@HIDDEN>
> Date: Sun, 02 Mar 2025 15:44:48 +0800
> 
> 
> 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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Mar 2025 10:22:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Mar 02 05:22:45 2025
Received: from localhost ([127.0.0.1]:53920 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1togT6-00061P-DL
	for submit <at> debbugs.gnu.org; Sun, 02 Mar 2025 05:22:45 -0500
Received: from lists.gnu.org ([2001:470:142::17]:47336)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <lorniu@HIDDEN>) id 1toe0V-0001cv-3j
 for submit <at> debbugs.gnu.org; Sun, 02 Mar 2025 02:45:05 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <lorniu@HIDDEN>) id 1toe0P-0006WU-Nq
 for bug-gnu-emacs@HIDDEN; Sun, 02 Mar 2025 02:44:57 -0500
Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <lorniu@HIDDEN>) id 1toe0O-0000fb-CZ
 for bug-gnu-emacs@HIDDEN; Sun, 02 Mar 2025 02:44:57 -0500
Received: by mail-pl1-x631.google.com with SMTP id
 d9443c01a7336-2234e5347e2so68887435ad.1
 for <bug-gnu-emacs@HIDDEN>; Sat, 01 Mar 2025 23:44:54 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1740901493; x=1741506293; darn=gnu.org;
 h=mime-version:message-id:date:subject:to:from:from:to:cc:subject
 :date:message-id:reply-to;
 bh=LIEhPo2C8BpJXU8kHzE0zpxs+3+nL277SRIMXSuMlr8=;
 b=DgAOGgN5v8+6UEypDRpWcioa3L7Ozm23Cbz+ojcs+hd/MnsJ0Xjp2CqF6muuwqAmf7
 4K/bdmIo4QHyRJW9h7ydsVJqt3pFcTu8PQgc9l8xPSAfVIRMuOT09hRQg0xodnryTc5D
 Ic0yX5qPVSomgppakm0acbyrjwvscRwF47NvZIygrW7+mWWnzEn7tm7RIEKQu8rT34h9
 s2UCs3kFDJTYiA9Bo/fNjqMpAalv+aqOnAXXfDn2S7XMh54wJ84oJo6P3I1kBrNqBA78
 PJAe1tIskRwaBLI4x9OJ5LHPIAr2Mkkd/74ShbrsJnDVuFq3eNGfsrfpD3rhAZu8fYq0
 zqVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1740901493; x=1741506293;
 h=mime-version:message-id:date:subject:to:from:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=LIEhPo2C8BpJXU8kHzE0zpxs+3+nL277SRIMXSuMlr8=;
 b=kbcmu6CUJDTMubLtJNnNAxJaiCzVNYqyE8LVb1vczKJrc4A3BvYudglut4lXvYuuAs
 /BJgPZud1qAL9lVQc0jymrCbPS5PhHUFBjk98GguoEfQhHh1ODBe2FaP2//IB8cju2Qj
 xjCxIHppUJMFTOJ/rfROlc+tbo2HoMw8ES5iLJFG2EwwFfT/Hs4kv7BIrC8MIIobo6zy
 JjtmypyByCsg+v5iTPV2pT+7rJAS2xFfoqAPlEMp/3Iuwk+kqr7HZNKMJC73RRir6h0b
 sO5hktiPev6InPYYjfH+50cxu4PXJ52i+/j7BrRj3DM2pU0FO+wNFL5rA4recRNs1SEB
 A6dQ==
X-Gm-Message-State: AOJu0YwufNX1NL/m1oSt/9w5zhdsNJnD7gk0++qsG1b254LQfZlLtCxd
 o/dtgTPMHk+v0sLTCX4w5RYb1YbtkiOMmziWsPH/TXhzvlvkMnsTTOXKxQ==
X-Gm-Gg: ASbGncu66DBP1lRrZsNUTayvkpdz84EhFB5Bt/gOhktJGOv+W2y8we5XskqQo/30u5H
 5CG86ojMbXBMGi3Vdy/DQAPTzvmB2mc08cCAEpcuUdyp9HhtJwI5I5/B5K+TeUmhgiiFktLobbo
 5Q7Xnrn2dfiNVwK2RtL5DqT52iM9C4RqNYz9PJmpJ2CDhxp9sTfCxlAo4Rloh/yVkZeETRicmDO
 m9O1UdX34DU6czAlcxZfop0J5hkEvHw2tXZ3Cwe+3e8lHE8T9ECJZegJb9WxrURCfPfWzCzR8Gg
 XW0BS3wAE3Q6RkxWWlu7ivG1J3FhVTQKfA==
X-Google-Smtp-Source: AGHT+IEoqTLRlkQuwPg8ArWNnK7uMM9CLaT1G1b/YnjrvzJUz9F/z5HZVhFqT/+0hfIi7WvLXSq7AQ==
X-Received: by 2002:a05:6a00:4f94:b0:736:339b:8296 with SMTP id
 d2e1a72fcca58-736339b83c4mr7024025b3a.18.1740901492932; 
 Sat, 01 Mar 2025 23:44:52 -0800 (PST)
Received: from svarch ([119.132.19.195]) by smtp.gmail.com with ESMTPSA id
 d2e1a72fcca58-7364e72b7a3sm259680b3a.74.2025.03.01.23.44.50
 for <bug-gnu-emacs@HIDDEN>
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sat, 01 Mar 2025 23:44:52 -0800 (PST)
From: lorniu <lorniu@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; forward-sentence not working in the narrowed buffer under
 c-ts-mode
X-Debbugs-Cc: 
Date: Sun, 02 Mar 2025 15:44:48 +0800
Message-ID: <87mse37u6n.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=2607:f8b0:4864:20::631;
 envelope-from=lorniu@HIDDEN; helo=mail-pl1-x631.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 02 Mar 2025 05:22:43 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)


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.




Acknowledgement sent to lorniu <lorniu@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76679; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 13 Mar 2025 19:00:01 UTC

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