unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: "a.soroa" <a.soroa@gmail.com>
Cc: 59919@debbugs.gnu.org
Subject: bug#59919: 28.1.50; "kill-matching-lines" takes forever
Date: Fri, 09 Dec 2022 09:23:38 +0000	[thread overview]
Message-ID: <574c1ceba8a3945384ac@heytings.org> (raw)
In-Reply-To: <87sfhpm07t.fsf@u018594.mail-host-address-is-not-set>


>
> The kill-matching-lines function takes far too long. Trying to kill 
> lines matching the "ssh" regexp in the attached file takes minutes to 
> complete. The actual file I'm working on is much bigger, and emacs just 
> hangs. Reciple to reproduce:
>
> $ bunzip2 log.txt.bz2
> $ emacs -Q log.txt
> M-x kill-matching-lines
> Kill lines containing match for regexp: ssh
>

Are you sure you actually want to _kill_ ("cut" in modern parlance) those 
lines?  In the file you attach, all 10000 lines match "ssh", so it means 
that Emacs "cuts" each of those lines one by one, which of course takes 
(quite) some time.  If you use a regexp that does not match all lines, say 
"109.106.244.80", the effect is almost instantaneous.

Note that there is also a command "flush-lines", is that not the one you 
actually need here?






  reply	other threads:[~2022-12-09  9:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09  8:48 bug#59919: 28.1.50; "kill-matching-lines" takes forever a.soroa
2022-12-09  9:23 ` Gregory Heytings [this message]
2022-12-09 15:18   ` aitor
2022-12-09 15:23     ` Gregory Heytings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=574c1ceba8a3945384ac@heytings.org \
    --to=gregory@heytings.org \
    --cc=59919@debbugs.gnu.org \
    --cc=a.soroa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).