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 In GNU Emacs 28.1.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-09-06 built on u018594 Repository revision: dd3863d8bcc77c43363bbd041da1c1eb37a3ee32 Repository branch: HEAD Windowing system distributor 'The X.Org Foundation', version 11.0.12201001 System Description: Ubuntu 22.04.1 LTS Configured using: 'configure --with-native-compilation' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK3 ZLIB Important settings: value of $LC_MONETARY: en_GB.UTF-8 value of $LC_NUMERIC: en_GB.UTF-8 value of $LC_TIME: en_GB.UTF-8 value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: windmove-mode: t which-key-mode: t global-company-mode: t company-mode: t recentf-mode: t marginalia-mode: t savehist-mode: t vertico-mode: t shell-dirtrack-mode: t save-place-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: /home/ccpsoeta/.emacs.d/elpa/transient-0.3.7/transient hides /usr/local/share/emacs/28.1.50/lisp/transient Features: (shadow sort mail-extr windmove emacsbug message rmc puny rfc822 mml mml-sec gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils dired-aux modus-vivendi-theme modus-themes mule-util tramp-cmds cursor-sensor ispell pcmpl-args pcmpl-gnu pcmpl-linux pcmpl-unix wgrep grep which-key flymake-proc flymake compile text-property-search thingatpt company-oddmuse company-keywords company-etags etags fileloop generator xref project company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-bbdb company pcase recentf tree-widget wid-edit marginalia savehist vertico python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 time-date ls-lisp format-spec comint ring ansi-color dired-x dired dired-loaddefs printing ps-print ps-print-loaddefs ps-def lpr epa derived epg rfc6068 epg-config saveplace use-package use-package-ensure use-package-delight use-package-diminish use-package-bind-key bind-key easy-mmode use-package-core edmacro kmacro comp comp-cstr warnings rx cl-extra help-mode finder-inf tex-site info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 310995 38845) (symbols 48 20539 0) (strings 32 73046 3183) (string-bytes 1 2942521) (vectors 16 32711) (vector-slots 8 594996 26057) (floats 8 498 121) (intervals 56 532 13) (buffers 992 13))