Subject: bug#34520: closed (Re: bug#34520: delete-matching-lines should report how many lines it deleted)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 28 Feb 2019 21:34:02 +0000

Your bug report

#34520: delete-matching-lines should report how many lines it deleted

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
34520: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34520
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#34520: delete-matching-lines should report how many lines it deleted
From: Juri Linkov <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Thu, 28 Feb 2019 23:33:10 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

>> +    (when interactive (message "Deleted %d matching line%s"
>> +			       count
>> +			       (if (= count 1) "" "s")))
>> +    count))
>
> The concatenation of "s" trick works only in English, so please avoid
> that.

Ok, waiting for the times when ‘gettext’ will arrive to Emacs.

> This needs NEWS and manual updates.

Done.

Subject: delete-matching-lines should report how many lines it deleted
From: 積丹尼 Dan Jacobson <[email-masked]>
To: [email-masked]
Date: Mon, 18 Feb 2019 08:35:08 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

delete-matching-lines is an alias for ‘flush-lines’ in ‘replace.el’.

It works great... or does it? Can't often tell. That's because well,
if there are matching lines off the screen, you won't really know, so
you have to go down there to have a look... and well, need eagle eyes
often too depending on the pattern and how many similar lines there
still are.

Got an idea!: Simply keep a count of how many lines were deleted, and
report that in the minibuffer, if using interactively.

What if there were no matching lines?
Then say
Deleted 0 matching lines.
Or beep "No matching lines!"

Try this with matching lines all below the visible part of the buffer:
C-x h [mark-whole-buffer]
M-x delete-matching-lines zzzzz

See the feeling (felt nothing, did it work in the first place one wonders?)