GNU bug report logs - #72704
29.4; repunctuate-sentences ignores NO-QUERY

Previous Next

Package: emacs;

Reported by: Brian Green <briandg <at> gmail.com>

Date: Sun, 18 Aug 2024 22:50:02 UTC

Severity: normal

Found in version 29.4

Full log


Message #29 received at 72704 <at> debbugs.gnu.org (full text, mbox):

From: Joseph Turner <joseph <at> breatheoutbreathe.in>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: briandg <at> gmail.com, Juri Linkov <juri <at> linkov.net>,
 Richard Stallman <rms <at> gnu.org>, 72704 <at> debbugs.gnu.org
Subject: Re: bug#72704: 29.4; repunctuate-sentences ignores NO-QUERY
Date: Sat, 24 Aug 2024 00:51:36 -0700
[Message part 1 (text/plain, inline)]
Visuwesh <visuweshm <at> gmail.com> writes:

> [வெள்ளி ஆகஸ்ட் 23, 2024] Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" wrote:
>
>> [...]
>> Please see the attached patch, which makes repunctuate-sentences respect
>> the current prefix argument.
>>
>> Juri, do I need to update the interactive-args declaration?  I'm not
>> totally clear on how that works.
>>
>> Thank you!
>>
>> Joseph
>>
>> From b5689dd1907fc8e2bd2752d8c8248f3747d52ff3 Mon Sep 17 00:00:00 2001
>> From: Joseph Turner <joseph <at> breatheoutbreathe.in>
>> 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.
>> * etc/NEWS: Announce changes.
>> ---
>>  etc/NEWS                     | 4 ++++
>>  lisp/textmodes/paragraphs.el | 3 ++-
>>  2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> 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..79bfc7fab3c 100644
>> --- a/lisp/textmodes/paragraphs.el
>> +++ b/lisp/textmodes/paragraphs.el
>> @@ -550,7 +550,8 @@ repunctuate-sentences
>>  filters to skip occurrences of spaces that don't need to be replaced."
>
> Should you not update the docstring to say that interactively prefix
> argument implies a non-nil NO-QUERY argument?
> [ P.S. you forgot to include the bug number in the commit log.  ]

You're right on both accounts.  Thanks.  See patch.

>>    (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
[0001-Interpret-prefix-argument-as-NO-QUERY-in-repunctuate.patch (text/x-diff, attachment)]

This bug report was last modified 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.