emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 2033f950fa: * lisp/textmodes/paragraphs.el (repunctuate-sentences


From: Juri Linkov
Subject: master 2033f950fa: * lisp/textmodes/paragraphs.el (repunctuate-sentences): Region for NO-QUERY.
Date: Tue, 28 Dec 2021 14:52:24 -0500 (EST)

branch: master
commit 2033f950fa37e9177c07eee0f5cab8a0eda37c4b
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * 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 98362b8579..acb26fd1c1 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))))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]