diff options
| author | Eli Zaretskii | 2017-06-04 19:27:13 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-06-04 19:27:13 +0300 |
| commit | bd3c6eeca1c69f95ab0c5eea5b542d0334abde68 (patch) | |
| tree | b85bc1adc97cc93b99affa5d5a2d00f40c2cb776 | |
| parent | 7dd9e7e95c1e4502b7a9fd6a18211208bd2914a5 (diff) | |
| download | emacs-bd3c6eeca1c69f95ab0c5eea5b542d0334abde68.tar.gz emacs-bd3c6eeca1c69f95ab0c5eea5b542d0334abde68.zip | |
Avoid slow startup in daemon mode when global-linum-mode is on
* lisp/linum.el (linum-on): Don't turn on linum-mode in a
non-client frame of a daemon session. (Bug#27210)
| -rw-r--r-- | lisp/linum.el | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/linum.el b/lisp/linum.el index 8baa263f0b3..9cfb94dab68 100644 --- a/lisp/linum.el +++ b/lisp/linum.el | |||
| @@ -112,7 +112,16 @@ Linum mode is a buffer-local minor mode." | |||
| 112 | (define-globalized-minor-mode global-linum-mode linum-mode linum-on) | 112 | (define-globalized-minor-mode global-linum-mode linum-mode linum-on) |
| 113 | 113 | ||
| 114 | (defun linum-on () | 114 | (defun linum-on () |
| 115 | (unless (minibufferp) | 115 | (unless (or (minibufferp) |
| 116 | ;; Turning linum-mode in the daemon's initial frame | ||
| 117 | ;; could significantly slow down startup, if the buffer | ||
| 118 | ;; in which this is done is large, because Emacs thinks | ||
| 119 | ;; the "window" spans the entire buffer then. This | ||
| 120 | ;; could happen when restoring session via desktop.el, | ||
| 121 | ;; if some large buffer was under linum-mode when | ||
| 122 | ;; desktop was saved. So we disable linum-mode for | ||
| 123 | ;; non-client frames in a daemon session. | ||
| 124 | (and (daemonp) (null (frame-parameter nil 'client)))) | ||
| 116 | (linum-mode 1))) | 125 | (linum-mode 1))) |
| 117 | 126 | ||
| 118 | (defun linum-delete-overlays () | 127 | (defun linum-delete-overlays () |