unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
@ 2020-03-04 16:42 ndame
  2020-03-04 16:53 ` Noam Postavsky
  2020-03-04 16:53 ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: ndame @ 2020-03-04 16:42 UTC (permalink / raw)
  To: 39908

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

I was working on a big text data file and I used flush-lines and instead of it saying
nothing it would have been nice to know how many lines were flushed by it.

The same goes for keep-lines. It should say in a message how many lines it flushed
while keeping the matching lines.

[-- Attachment #2: Type: text/html, Size: 307 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-04 16:42 bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed ndame
@ 2020-03-04 16:53 ` Noam Postavsky
  2020-03-04 16:53 ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Noam Postavsky @ 2020-03-04 16:53 UTC (permalink / raw)
  To: 39908

# closing accidental dupe
forwarded 39908 https://debbugs.gnu.org/39907
close 39908
severity 39907 wishlist
quit






^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-04 16:42 bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed ndame
  2020-03-04 16:53 ` Noam Postavsky
@ 2020-03-04 16:53 ` Eli Zaretskii
  2020-03-04 16:54   ` ndame
  2020-03-04 17:12   ` ndame
  1 sibling, 2 replies; 11+ messages in thread
From: Eli Zaretskii @ 2020-03-04 16:53 UTC (permalink / raw)
  To: ndame; +Cc: 39908

> Date: Wed, 4 Mar 2020 16:42:40 +0000 (GMT)
> From: ndame <emacsuser@freemail.hu>
> 
> I was working on a big text data file and I used flush-lines and instead of it saying
> nothing it would have been nice to know how many lines were flushed by it.
> 
> The same goes for keep-lines. It should say in a message how many lines it flushed
> while keeping the matching lines.

Upgrade to Emacs 27, this happens there already.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-04 16:53 ` Eli Zaretskii
@ 2020-03-04 16:54   ` ndame
  2020-03-04 23:37     ` Juri Linkov
  2020-03-04 17:12   ` ndame
  1 sibling, 1 reply; 11+ messages in thread
From: ndame @ 2020-03-04 16:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39908@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 115 bytes --]

>  Upgrade to Emacs 27, this happens there already.

Great, sorry for the noise then. This report can be closed.

[-- Attachment #2: Type: text/html, Size: 133 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-04 16:53 ` Eli Zaretskii
  2020-03-04 16:54   ` ndame
@ 2020-03-04 17:12   ` ndame
  2020-03-04 23:39     ` Juri Linkov
  1 sibling, 1 reply; 11+ messages in thread
From: ndame @ 2020-03-04 17:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39908@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 209 bytes --]

 >  Upgrade to Emacs 27, this happens there already.

I checked the news, but it only mentions flush-lines.

It is also useful for keep-lines to say how many lines it removed, instead
of saying nothing.

[-- Attachment #2: Type: text/html, Size: 246 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-04 16:54   ` ndame
@ 2020-03-04 23:37     ` Juri Linkov
  0 siblings, 0 replies; 11+ messages in thread
From: Juri Linkov @ 2020-03-04 23:37 UTC (permalink / raw)
  To: ndame; +Cc: 39908@debbugs.gnu.org

tags 39907 notabug
close 39907 28.0.50
quit

>>  Upgrade to Emacs 27, this happens there already.
>
> Great, sorry for the noise then. This report can be closed.

Thanks for the report, closed.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-04 17:12   ` ndame
@ 2020-03-04 23:39     ` Juri Linkov
  2020-03-05  9:47       ` ndame
  0 siblings, 1 reply; 11+ messages in thread
From: Juri Linkov @ 2020-03-04 23:39 UTC (permalink / raw)
  To: ndame; +Cc: 39908@debbugs.gnu.org

>  >  Upgrade to Emacs 27, this happens there already.
>
> I checked the news, but it only mentions flush-lines.
>
> It is also useful for keep-lines to say how many lines it removed, instead
> of saying nothing.

keep-lines can't say how many lines it removed, because it doesn't know the number.
And reimplementing it to count the number of removed lines will make it slower.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-04 23:39     ` Juri Linkov
@ 2020-03-05  9:47       ` ndame
  2020-03-05 12:15         ` Noam Postavsky
  0 siblings, 1 reply; 11+ messages in thread
From: ndame @ 2020-03-05  9:47 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 39908@debbugs.gnu.org

[-- Attachment #1: Type: text/plain, Size: 613 bytes --]

 
> keep-lines can't say how many lines it removed, because it doesn't know the number.
> And reimplementing it to count the number of removed lines will make it slower.

keep-lines has two delete-region calls in two separate cases. Even counting only
these deletions and saying "x deletions were performed" is more informative than
saying nothing. It doesn't have to say "number of lines".

I guess most users use it to remove whole lines most of the time, so the match
is usually not split across lines, therefore the number of deletions in these cases is
equal to the number of deleted lines.

 

[-- Attachment #2: Type: text/html, Size: 721 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-05  9:47       ` ndame
@ 2020-03-05 12:15         ` Noam Postavsky
  2020-03-05 16:47           ` ndame
  0 siblings, 1 reply; 11+ messages in thread
From: Noam Postavsky @ 2020-03-05 12:15 UTC (permalink / raw)
  To: ndame; +Cc: 39908@debbugs.gnu.org, Juri Linkov

ndame <emacsuser@freemail.hu> writes:

> I guess most users use it to remove whole lines most of the time, so the match
> is usually not split across lines, therefore the number of deletions in these cases is
> equal to the number of deleted lines.

That would apply to flush-lines (and I think the current counting code
does make that assumption), but not keep-lines.  For keep-lines, if
matches don't span lines, then the number of lines is equal to the
number of lines kept, rather than lines deleted.  And there is less
usefulness in reporting lines kept, since the user can see that directly
(or use M-= (count-words-region)).





^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-05 12:15         ` Noam Postavsky
@ 2020-03-05 16:47           ` ndame
  2020-03-05 17:07             ` Noam Postavsky
  0 siblings, 1 reply; 11+ messages in thread
From: ndame @ 2020-03-05 16:47 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 39908@debbugs.gnu.org, Juri Linkov

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

> For keep-lines, if
> matches don't span lines, then the number of lines is equal to the
> number of lines kept, rather than lines deleted. And there is less
> usefulness in reporting lines kept,

I agree, that's why I suggested keep-lines should also count and report
the number of deletions performed which can be useful info.

This is easy to do by incrementing a counter at the two delete-region calls
in keep-lines.

[-- Attachment #2: Type: text/html, Size: 504 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed
  2020-03-05 16:47           ` ndame
@ 2020-03-05 17:07             ` Noam Postavsky
  0 siblings, 0 replies; 11+ messages in thread
From: Noam Postavsky @ 2020-03-05 17:07 UTC (permalink / raw)
  To: ndame; +Cc: 39908@debbugs.gnu.org, Juri Linkov

ndame <emacsuser@freemail.hu> writes:

> report the number of deletions performed which can be useful info.
>
> This is easy to do by incrementing a counter at the two delete-region calls
> in keep-lines.

No, you are mistaken.  For keep-lines, the number of deletions is equal
to the number of kept lines.  Only for flush-lines the number of
deletions is the same as the number of deleted lines (in both cases,
assuming all matches are on single lines).








^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-03-05 17:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-04 16:42 bug#39908: 26.2; flush-lines and keep-lines should say how many lines were flushed ndame
2020-03-04 16:53 ` Noam Postavsky
2020-03-04 16:53 ` Eli Zaretskii
2020-03-04 16:54   ` ndame
2020-03-04 23:37     ` Juri Linkov
2020-03-04 17:12   ` ndame
2020-03-04 23:39     ` Juri Linkov
2020-03-05  9:47       ` ndame
2020-03-05 12:15         ` Noam Postavsky
2020-03-05 16:47           ` ndame
2020-03-05 17:07             ` Noam Postavsky

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).