From: Juri Linkov Date: Tue, 28 Dec 2021 19:51:54 +0000 (+0200) Subject: * lisp/textmodes/paragraphs.el (repunctuate-sentences): Region for NO-QUERY. X-Git-Tag: emacs-29.0.90~3389 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2033f950fa37e9177c07eee0f5cab8a0eda37c4b;p=emacs.git * 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). --- 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))))