leungbk · 2022-07-29 01:44
I saw that a week or so ago, a fix for the long-lines issue had been merged into the master branch. It works pretty well for me when viewing strace output without `so-long-mode`. Thanks to the upstream contributors.
7890yuiop · 2022-07-29 02:53
Yep, there's a bunch of ongoing work on that area, both for the display code and the font-lock code. My impression (I've not been following closely) is that there are issues still being worked through, but it sounds very promising.
yankfade · 2022-07-29 02:55
Thanks for pointing this out. Long line handling is probably still the most frustrating part of emacs for me, even using master from a few months ago with the usual suggested config optimizations. I'll have to test with the latest master.
kikechan · 2022-07-29 04:13
> usual suggested config optimizations
Could you list them?
yankfade · 2022-07-29 04:36
afk, so I can't look at my config specifically now, but I remember going through this guide :https://200ok.ch/posts/2020-09-29_comprehensive_guide_on_handling_long_lines_in_emacs.html. I'm also using native compilation. I'll try to remember to look for anything else that's relevant. Long lines don't completely lock up emacs like they once did, but searching is still pretty slow at times.
kikechan · 2022-07-29 04:40
Thank you!
yankfade · 2022-07-29 05:25
No problem!
Atemu12 · 2022-07-29 11:59
What exactly does this fix entail?
Does it mean I can open a MiB large JSON file without line breaks without emacs becoming unresponsive for half an hour?
_viz_ · 2022-07-29 12:17
Yes, that's what it means.
EDIT: You might need to fiddle around with the long-line-threshold variable for the optimisation to kick in if your line is not long enough.
_viz_ · 2022-07-29 12:22
Here's what NEWS says,
** Emacs is now capable of editing files with very long lines.
The display of long lines has been optimized, and Emacs should no
longer choke when a buffer on display contains long lines. The
variable 'long-line-threshold' controls whether and when these display
optimizations are in effect.
If you still experience slowdowns while editing files with long lines,
this may be due to line truncation, or to one of the enabled minor
modes, or to the current major mode. Try turning off line truncation
with 'C-x x t', or try disabling all known slow minor modes with
'M-x so-long-minor-mode', or try disabling both known slow minor modes
and the major mode with 'M-x so-long-mode', or visit the file with
'M-x find-file-literally' instead of the usual 'C-x C-f'.
Note that the display optimizations in these cases may cause the
buffer to be occasionally mis-fontified.
Atemu12 · 2022-07-29 12:30
How does it do that?
_viz_ · 2022-07-29 15:03
You will be better served by reading the relevant bug reports yourself, lest I end up saying the wrong thing (since I did not follow that discussion too closely).
7890yuiop · 2022-07-29 15:05
FWIW, you can already (since 27.1) "open a MiB large JSON file without line breaks without emacs becoming unresponsive for half an hour" (or indeed a 19M single-line JSON file in [this example](https://emacs.stackexchange.com/questions/598/how-do-i-prevent-extremely-long-lines-making-emacs-slow)), if you enable `global-so-long-mode` in your init file. If you actually need to do some editing in that buffer, your best option is to then switch to `longlines-mode` (which you can do via the so-long menu). The improvements for Emacs 29 ought to make these things redundant; but in earlier versions of Emacs I recommend making use of them.