]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/textmodes/paragraphs.el (repunctuate-sentences): Region for NO-QUERY.
authorJuri Linkov <juri@linkov.net>
Tue, 28 Dec 2021 19:51:54 +0000 (21:51 +0200)
committerJuri Linkov <juri@linkov.net>
Tue, 28 Dec 2021 19:51:54 +0000 (21:51 +0200)
Use region boundaries also for the case when NO-QUERY arg is non-nil
(bug#52769).

lisp/textmodes/paragraphs.el

index 98362b857945c0a806006cd13fa3532b89fa1e49..acb26fd1c1233b21b40bd8ac23880710462b63a0 100644 (file)
@@ -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))))