From 2033f950fa37e9177c07eee0f5cab8a0eda37c4b Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 28 Dec 2021 21:51:54 +0200 Subject: [PATCH] * lisp/textmodes/paragraphs.el (repunctuate-sentences): Region for NO-QUERY. Use region boundaries also for the case when NO-QUERY arg is non-nil (bug#52769). --- lisp/textmodes/paragraphs.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 98362b85794..acb26fd1c12 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -492,8 +492,10 @@ asking for confirmation." (let ((regexp "\\([]\"')]?\\)\\([.?!]\\)\\([]\"')]?\\) +") (to-string "\\1\\2\\3 ")) (if no-query - (while (re-search-forward regexp nil t) - (replace-match to-string)) + (progn + (when start (goto-char start)) + (while (re-search-forward regexp end t) + (replace-match to-string))) (query-replace-regexp regexp to-string nil start end)))) -- 2.39.2