help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Regex to match lines with a specific number of words


From: Joost Kremers
Subject: Re: Regex to match lines with a specific number of words
Date: Sun, 24 Apr 2022 00:21:35 +0200
User-agent: mu4e 1.6.10; emacs 28.1.50

On Sat, Apr 23 2022, Thibaut Verron wrote:
> No problem! The information is in the manual, but hidden behind several
> layers of redirection.
> I find the emacswiki page on regular expressions both more synthetic and
> more informative.

Thanks, I'll check it out.

> Regarding performances, that's a bit strange.
> Is it better if you add ^ and $ around the expression? Or if you add only ^
> and search for exactly 30 repetitions (not 30 or more)?

Well, either version still runs up one CPU core to 100%. The only difference
seems to be that they are more easily interruptable with C-g: Emacs responds
immediately, whereas before it would take seconds to respond to C-g and in one
case it did not respond at all. (I ended up killing Emacs when GNOME popped up a
a suggestion to do so...)

> Le sam. 23 avr. 2022 à 23:34, Joost Kremers <joostkremers@fastmail.fm> a
> écrit :

>> Lemme see if a function that goes through the buffer, splits every line on
>> white space and deletes those that are too long works better.

That actually worked well. It still takes a few seconds to run, but really just
a few seconds. And that's including dumping all the extracted lines into a
separate buffer.



-- 
Joost Kremers
Life has its moments



reply via email to

[Prev in Thread] Current Thread [Next in Thread]