From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62027: Subject: 29.0.60; Breaking change in forward-sentence/backward-sentence Date: Tue, 07 Mar 2023 20:07:44 +0100 Message-ID: <87wn3s9y7z.fsf@ledu-giraud.fr> References: <874jqxkoey.fsf@runbox.com> <87y1o8c39u.fsf@ledu-giraud.fr> <834jqw7lrn.fsf@gnu.org> <87ttywbl59.fsf@ledu-giraud.fr> <83h6uw5ydn.fsf@gnu.org> <87a60obji1.fsf@ledu-giraud.fr> <83cz5k5viq.fsf@gnu.org> Reply-To: Manuel Giraud Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11362"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: simenheg@runbox.com, 62027@debbugs.gnu.org, mardani29@yahoo.es To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 07 20:08:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZcfh-0002gG-3g for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 07 Mar 2023 20:08:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZcfN-0005HX-LW; Tue, 07 Mar 2023 14:08:05 -0500 Original-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 ) id 1pZcfK-0005H6-Et for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 14:08:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZcfK-0004px-6k for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 14:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZcfJ-0006xJ-WC for bug-gnu-emacs@gnu.org; Tue, 07 Mar 2023 14:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Mar 2023 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62027 X-GNU-PR-Package: emacs Original-Received: via spool by 62027-submit@debbugs.gnu.org id=B62027.167821607026720 (code B ref 62027); Tue, 07 Mar 2023 19:08:01 +0000 Original-Received: (at 62027) by debbugs.gnu.org; 7 Mar 2023 19:07:50 +0000 Original-Received: from localhost ([127.0.0.1]:47209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZcf8-0006wu-4C for submit@debbugs.gnu.org; Tue, 07 Mar 2023 14:07:50 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:17290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZcf6-0006wj-4m for 62027@debbugs.gnu.org; Tue, 07 Mar 2023 14:07:49 -0500 DKIM-Signature: v=1; a=ed25519-sha256; c=simple/simple; s=ed25519; bh=PzBXON3F 2MR6Aid99DeG1GIHtMv/FB2oldPismZhsYQ=; h=date:references:in-reply-to: subject:cc:to:from; d=ledu-giraud.fr; b=m27/+MIO0wv9ei+37M7LmH/aR12kkZ X+4QhWGuXZHdWr0sGwfyVHqH/1lL/GWyHeXM/Lhl9TmzPyIpMWYkrwCQ== DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=PzBXON3F2MR6Aid9 9DeG1GIHtMv/FB2oldPismZhsYQ=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=K8UzZ35PisL0ctmmzYLtDYauo5+s1bYshFWBcA succkeH5SwCLz9cpZyca0WNW0ac8bo6wt4sZ/SzaXek8rtffdlshX5UXK4wmApunE8hU7x Sgq66Lxd7N+CDL55yTyw/zFSpDcF8MubcdH3Id7zUSo1bxA19tQ1ESvhsB27KW50na5IdY qfGCjzdtspPxKDOj8R3zJgVVrlUNDl21X0a3yOI3I/QTPzOYPnA28Y3TblP5T+7HI0HmgI vT8JAxVLC9iW1BLaSWBlix4weT2P9D1I5zoz86P5tsIDlbYcS1MDrIk9F2211Z4xh+3Y/m kEtNEC7IPfA52jzmoLRHruJQ== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 7fc08e04 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 7 Mar 2023 20:07:46 +0100 (CET) In-Reply-To: <83cz5k5viq.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 07 Mar 2023 19:19:41 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257497 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: [...] > I tried, but it doesn't apply. Did you produce the patch from the > emacs-29 branch or from some other branch? Sorry, I produced it on master. Here is the one for emacs-29. Will this appear on master at a later time? -- Manuel Giraud --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Revert-forward-sentence-default-function-to-return-t.patch >From c1cfd5e99c5227e9c75fc6b3dbb50e60e44c12d0 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Tue, 7 Mar 2023 20:03:53 +0100 Subject: [PATCH] Revert 'forward-sentence-default-function' to return the point (bug#62027) * lisp/textmodes/paragraphs.el (forward-sentence-default-function): Revert to return the point position. (count-sentences): Adapt to this change. --- lisp/textmodes/paragraphs.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 73abb155aaa..a9e28a3275b 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -477,8 +477,7 @@ forward-sentence (skip-chars-backward " \t\n") (goto-char par-end))) (setq arg (1- arg))) - (let ((npoint (constrain-to-field nil opoint t))) - (not (= npoint opoint))))) + (constrain-to-field nil opoint t))) (defun count-sentences (start end) "Count sentences in current buffer from START to END." @@ -488,8 +487,13 @@ count-sentences (save-restriction (narrow-to-region start end) (goto-char (point-min)) - (while (ignore-errors (forward-sentence)) - (setq sentences (1+ sentences))) + (let* ((prev (point)) + (next (forward-sentence))) + (while (and (not (null next)) + (not (= prev next))) + (setq prev next + next (ignore-errors (forward-sentence)) + sentences (1+ sentences)))) ;; Remove last possibly empty sentence (when (/= (skip-chars-backward " \t\n") 0) (setq sentences (1- sentences))) -- 2.39.1 --=-=-=--