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: Phil Sainty <psainty <at> orcon.net.nz>
To: 積丹尼 Dan Jacobson <jidanni <at> jidanni.org>, 45652 <at> debbugs.gnu.org
Subject: bug#45652: so-long mode not triggered despite big file with very long lines
Date: Tue, 12 Jan 2021 00:28:24 +1300
Hi Dan,

On 5/01/21 12:47 am, 積丹尼 Dan Jacobson wrote:
> Alas, even in my https://www.jidanni.org/comp/configuration/.emacs with
> (global-so-long-mode 1)
> (setq so-long-action 'so-long-minor-mode)
> this certain file does not trigger so-long mode.

I see that Emacs uses js-mode for .har files, so it *is* a targeted
major mode for so-long, which means that it's probably just not meeting
the configured criteria for a file with long lines.  See the docstring
for `so-long-detected-long-line-p' for details.

I'm also in the process of making changes to some of the relevant
default values, so you could test the current WIP version from here:

https://git.savannah.nongnu.org/cgit/so-long.git/plain/so-long.el?h=wip


> Where to get such a file to test?
> Real simple. In Chrome Developer Tools network tab, visit
> https://www.youtube.com/c/jidanni2/playlists?view=1 and right click
> "Save all as HAR with content."

I don't have Chrome installed, sorry; but if it's not a config issue
then I'll be happy to take a look at an example file, if you provide
one (compressed, please).


> Here we see the file(1) command knows a file has very long lines.
> $ file www.youtube.com.har
> www.youtube.com.har: UTF-8 Unicode text, with very long lines
> $ wc www.youtube.com.har
>    45982   330703 14075335 www.youtube.com.har

Those programs have no bearing on so-long's criteria, of course.

In particular, so-long doesn't (by default) look at the whole file,
and the above file is apparently 45,982 lines long.  For context
I am currently looking at increasing the maximum number of lines
checked by so-long (by default) to 500 -- approximately the first
1% of your file.

Even if we go with a larger number, I think it's likely to *be*
a fixed maximum number in the default config, which means there
will always be scope for a file to have its first gigantic line
on the (max+1)th line, and not be detected by so-long.

Hopefully the new default config will be more reliable than before,
though.


-Phil




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.