2

When working on huge files, it seems that when hide-show collapses a large multi-line block, linum still creates hidden overlays for every line in the hidden block leading to unresponsive emacs. Is there a way to fix linum?

To reproduce: Create a new file, enable c-mode, hs-minor-mode and linum-mode, create a huge block by typing: { C-u 10000 RET } then execute hs-hide-all and watch Emacs become unresponsive.

Tohiko
  • 1,589
  • 1
  • 10
  • 22
  • 1
    Try the `nlinum` package from GNU ELPA. Does that work better for you? – phils Feb 08 '17 at 17:58
  • Yes, there is a way to fix `linum.el`, but nobody *really* cares (except me). For starters, it can be restricted to only the visible window -- requiring a modification of the C source code to be efficient so that `window-start` and `window-end` values are always accurate [ https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22404 ]. Second, the `line-number-at-pos` can be replaced with `(format-mode-line "%l")` [with some exceptions http://emacs.stackexchange.com/questions/3821/a-faster-method-to-obtain-line-number-at-pos-in-large-buffers ]. Third, it can be written to exclude invisible lines. – lawlist Feb 08 '17 at 18:54
  • 1
    Yes! nlinum seems to do the trick. – Tohiko Feb 09 '17 at 09:53

0 Answers0