all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Oleksandr Gavenko <gavenkoa@gmail.com>
Cc: 22143@debbugs.gnu.org
Subject: bug#22143: 24.5; Emacs blocked on long lines.
Date: Fri, 21 Aug 2020 06:53:24 -0700	[thread overview]
Message-ID: <CADwFkmnByt-UUdNvCfb0Omy6j1N02XB=5Funw3Lr7iopWrq1AQ@mail.gmail.com> (raw)
In-Reply-To: <87d1ud6kw8.fsf@gavenkoa.example.com> (Oleksandr Gavenko's message of "Fri, 11 Dec 2015 17:54:31 +0200")

Oleksandr Gavenko <gavenkoa@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





  parent reply	other threads:[~2020-08-21 13:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 15:54 bug#22143: 24.5; Emacs blocked on long lines Oleksandr Gavenko
2018-04-05 14:41 ` Michael Heerdegen
2018-04-05 15:00   ` Eli Zaretskii
2018-04-05 15:20     ` Michael Heerdegen
2018-04-05 15:34       ` Eli Zaretskii
2020-08-21 13:53 ` Stefan Kangas [this message]
2020-08-21 14:01   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADwFkmnByt-UUdNvCfb0Omy6j1N02XB=5Funw3Lr7iopWrq1AQ@mail.gmail.com' \
    --to=stefan@marxist.se \
    --cc=22143@debbugs.gnu.org \
    --cc=gavenkoa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.