all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Manuel Giraud via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: simenheg@runbox.com, 62027@debbugs.gnu.org, mardani29@yahoo.es
Subject: bug#62027: Subject: 29.0.60; Breaking change in forward-sentence/backward-sentence
Date: Tue, 07 Mar 2023 20:07:44 +0100	[thread overview]
Message-ID: <87wn3s9y7z.fsf@ledu-giraud.fr> (raw)
In-Reply-To: <83cz5k5viq.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 07 Mar 2023 19:19:41 +0200")

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

Eli Zaretskii <eliz@gnu.org> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Revert-forward-sentence-default-function-to-return-t.patch --]
[-- Type: text/x-patch, Size: 1692 bytes --]

From c1cfd5e99c5227e9c75fc6b3dbb50e60e44c12d0 Mon Sep 17 00:00:00 2001
From: Manuel Giraud <manuel@ledu-giraud.fr>
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


  reply	other threads:[~2023-03-07 19:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07  7:31 bug#62027: Subject: 29.0.60; Breaking change in forward-sentence/backward-sentence Simen Heggestøyl
2023-03-07  9:35 ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-07 11:03   ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-07 13:07     ` Eli Zaretskii
2023-03-07 16:07       ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-07 16:17         ` Eli Zaretskii
2023-03-07 16:42           ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-07 17:19             ` Eli Zaretskii
2023-03-07 19:07               ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-03-07 19:32                 ` Eli Zaretskii
2023-03-08  6:50                   ` Simen Heggestøyl
2023-03-08  8:38                     ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-08 15:52                       ` Drew Adams
2023-03-08 16:52                         ` Eli Zaretskii
2023-03-08 17:52                           ` Drew Adams
2023-03-08 19:46                             ` Eli Zaretskii
2023-03-08 16:51                       ` Eli Zaretskii
2023-03-08 21:02                         ` Manuel Giraud via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wn3s9y7z.fsf@ledu-giraud.fr \
    --to=bug-gnu-emacs@gnu.org \
    --cc=62027@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=manuel@ledu-giraud.fr \
    --cc=mardani29@yahoo.es \
    --cc=simenheg@runbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.