GNU bug report logs - #45652
so-long mode not triggered despite big file with very long lines

Previous Next

Package: emacs;

Reported by: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>

Date: Mon, 4 Jan 2021 13:03:02 UTC

Severity: minor

Merged with 45955

Done: Phil Sainty <psainty <at> orcon.net.nz>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 45652 <at> debbugs.gnu.org, 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>
Subject: bug#45652: so-long mode not triggered despite big file with very long lines
Date: Tue, 12 Jan 2021 20:22:46 +0100
Phil Sainty <psainty <at> orcon.net.nz> writes:

> I'm not sure that so-long itself would find it useful to know any kind
> of averages, but longest line is obviously useful, and the number of
> lines sounds more or less like a freebie, and might be useful too.

The `buffer-line-statistics' function is now on the trunk, and it
returns count/longest/mean, since those three are free-ish.  (I could
also add standard deviation or variance -- it would basically just be a
sqrt and a division per line?)

Testing in a 18MB zip file (which is probably on the outer limits of
what people load into Emacs, size-wise, for editing), it takes 0.002
seconds to compute the data, so for real usage, it should be
unnoticeable.

The data for that file is

(81472 2632 220.35040259229885)

There's a bit more newlines in that zip file than I'd expect?  I mean,
if it was totally random, it should be 255 or something?

Anyway, I digress.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




This bug report was last modified 3 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.