3

I have a constant problem with Emacs that it cannot handle the long line-wrapped printouts in RELP or shell mode. The Emacs process starts running on full CPU and is almost completely unresponsive (sporadically it start to process user commands but then freezes again). This means I have to kill the process and restart Emacs. Obviously, this is a major stability and usability problem, and something which a normal terminal can easily handle.

I am not using any esoteric line wrapping extensions, only the default toggle-truncate-lines is enabled (line wrapping is needed in shell or REPL). The Emacs version is 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.4.2).

Google search around the issue does not return anything useful or similar. Has no one else experienced these problems? Any solution or workaround would be greatly appreciated.

7
  • How long are those "long line"s? Emacs is not good at handling long lines.
    – Stefan
    Nov 18, 2014 at 14:21
  • 1
    @Stefan "long lines" mean something like a printout of couple of hundred thousand of well-sized JSON objects in a lazy sequence, or maybe the 200,000th Fibonacci number. Nothing a good old ^C would have problem with on a bare terminal. Nov 18, 2014 at 16:59
  • 2
    Then it's a known problem: these lines are much too long for Emacs. There are various ways to make them usable, but there are also various ways in which Emacs code doesn't work well for long-lines, so making them work acceptably often involves several tweaks.
    – Stefan
    Nov 18, 2014 at 17:58
  • 1
    @Stefan Emacs is quite often used as shell or REPL environment so I would categorize this issue as severe. I found this bug report, and another one. The later claims the issue did not exist back in version 21, only since 22 to 24, which could indicate it is not a fundamental flaw. It would be great to know the internal details around line wrapping and buffers, find the root cause, and hopefully get this fixed. Nov 19, 2014 at 11:31
  • @Stefan Would you post some of your workarounds as answer in the meantime? Nov 19, 2014 at 11:36

2 Answers 2

1

Various parts of Emacs work "a line at a time", under the assumption that lines are not too long. So long lines like the ones you describe tend to bring Emacs to its knees.

There ae often ways to reduce the pain, but it all depends on the specifics of your case, so without more details as to which major mode you're using (for example), the most obvious first thing to do is to turn off font-lock-mode since it rehighlights the text line-by-line (so after adding, say, 4KB of output to the end of the line, it reprocesses the whole line to highlight it, which in turns means the redisplay code then has to reprocess the whole line to see what part of highlighting might have changed).

0

try Visual Line mode or obsoleted Long Lines mode in old version, should reduce CPU load significantly.

https://www.emacswiki.org/emacs/VisualLineMode

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .