GNU bug report logs -
#22143
24.5; Emacs blocked on long lines.
Previous Next
Reported by: Oleksandr Gavenko <gavenkoa <at> gmail.com>
Date: Fri, 11 Dec 2015 17:33:01 UTC
Severity: normal
Merged with 3219,
4123,
9589,
13675,
15555,
18530,
24523,
30457,
32523,
40007
Found in versions 23.1, 24.2, 24.2.93, 24.3, 24.5, 26.0.91, 27.0.50, 28.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 22143 <at> debbugs.gnu.org (full text, mbox):
Oleksandr Gavenko <gavenkoa <at> gmail.com> writes:
> It is usual for me to open files with large lines in Emacs.
>
> Some times this was log, or executable, or dump.
>
> But usually this was minified .js or .json file.
>
> And only thing I can do is to live with slowness or to kill Emacs and may be
> clean corresponding desktop-mode entries for *bad* file.
>
> I contribute piece to:
>
> http://emacs.stackexchange.com/questions/598/how-do-i-handle-files-with-extremely-long-lines
>
> Here it is:
>
> (setq line-number-display-limit large-file-warning-threshold)
> (setq line-number-display-limit-width 200)
>
> (defun my--is-file-large ()
> "If buffer too large and my cause performance issue."
> (< large-file-warning-threshold (buffer-size)))
>
> (define-derived-mode my-large-file-mode fundamental-mode "LargeFile"
> "Fixes performance issues in Emacs for large files."
> ;; (setq buffer-read-only t)
> (setq bidi-display-reordering nil)
> (jit-lock-mode nil)
> (buffer-disable-undo)
> (set (make-variable-buffer-local 'global-hl-line-mode) nil)
> (set (make-variable-buffer-local 'line-number-mode) nil)
> (set (make-variable-buffer-local 'column-number-mode) nil) )
>
> (add-to-list 'magic-mode-alist (cons #'my--is-file-large #'my-large-file-mode))
>
> But it is for a large files (but help me in many case because files with long
> lines usually also themselves big). I didn't investigate how to make test for long
> lines jet.
>
> Even with those settings some files (usually minified .js libraries or .json
> files) froze Emacs. I think due to js-mode, but...
>
> I would like to hear solution for long line issue or a way to detect long
> lines and prevent file from opening (or decide to risk if lines is not toooo
> long).
>
> My point instead of restarting Emacs daemon - safely warn about long lines so
> I have a chance to preserve my Emacs session before Emacs die.
Is this better with so-long.el?
etc/PROBLEMS says:
*** Editing files with very long lines is slow.
For example, simply moving through a file that contains hundreds of
thousands of characters per line is slow, and consumes a lot of CPU.
This is a known limitation of Emacs with no solution at this time.
Is there anything more we can/should do in this case short of rewriting
the display engine? Does it make sense to track this limitation in a
bug report?
Best regards,
Stefan Kangas
This bug report was last modified 2 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.