From dccbecaf1b421c60a8846d782fb437d1cad3aa1f Mon Sep 17 00:00:00 2001 From: Joseph Turner Date: Fri, 23 Aug 2024 23:19:33 -0700 Subject: [PATCH] Interpret prefix argument as NO-QUERY in repunctuate-sentences * lisp/textmodes/paragraphs.el (repunctuate-sentences): Respect current-prefix-arg. bug#72704 * etc/NEWS: Announce changes. --- etc/NEWS | 4 ++++ lisp/textmodes/paragraphs.el | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 2ddbab29528..5f9f86bce53 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -95,6 +95,10 @@ When using 'visual-wrap-prefix-mode' in buffers with variable-pitch fonts, the wrapped text will now be lined up correctly so that it's exactly below the text after the prefix on the first line. +--- +** When invoked with a prefix argument, 'repunctuate-sentences' now +replaces text without querying for confirmation. + * Changes in Specialized Modes and Packages in Emacs 31.1 diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index be741e6517b..f9351ef5afe 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -545,12 +545,14 @@ repunctuate-sentences It works using `query-replace-regexp'. In Transient Mark mode, if the mark is active, operate on the contents of the region. Second and third arg START and END specify the region to operate on. -If optional argument NO-QUERY is non-nil, make changes without asking -for confirmation. You can use `repunctuate-sentences-filter' to add -filters to skip occurrences of spaces that don't need to be replaced." +If optional argument NO-QUERY is non-nil (interactively with prefix +argument), make changes without asking for confirmation. You can use +`repunctuate-sentences-filter' to add filters to skip occurrences of +spaces that don't need to be replaced." (declare (interactive-args (start (use-region-beginning)) (end (use-region-end)))) - (interactive (list nil (use-region-beginning) (use-region-end))) + (interactive + (list current-prefix-arg (use-region-beginning) (use-region-end))) (let ((regexp "\\([]\"')]?\\)\\([.?!]\\)\\([]\"')]?\\) +") (to-string "\\1\\2\\3 ")) (if no-query -- 2.41.0