comparison lisp/linum.el @ 104365:fe22bf79af7f

(linum-mode): window-size-change-functions is redundant. Adapt to new window-configuration-change-hook behavior. (linum-after-size, linum-after-config): Remove.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 19 Aug 2009 17:28:52 +0000
parents 4bcf5c96d5ee
children 708c5f10a0be
comparison
equal deleted inserted replaced
104364:82c4f7cce5f9 104365:fe22bf79af7f
80 (add-hook 'post-command-hook (if linum-delay 80 (add-hook 'post-command-hook (if linum-delay
81 'linum-schedule 81 'linum-schedule
82 'linum-update-current) nil t) 82 'linum-update-current) nil t)
83 (add-hook 'after-change-functions 'linum-after-change nil t)) 83 (add-hook 'after-change-functions 'linum-after-change nil t))
84 (add-hook 'window-scroll-functions 'linum-after-scroll nil t) 84 (add-hook 'window-scroll-functions 'linum-after-scroll nil t)
85 (add-hook 'window-size-change-functions 'linum-after-size nil t) 85 ;; Using both window-size-change-functions and
86 ;; window-configuration-change-hook seems redundant. --Stef
87 ;; (add-hook 'window-size-change-functions 'linum-after-size nil t)
86 (add-hook 'change-major-mode-hook 'linum-delete-overlays nil t) 88 (add-hook 'change-major-mode-hook 'linum-delete-overlays nil t)
87 (add-hook 'window-configuration-change-hook 89 (add-hook 'window-configuration-change-hook
88 'linum-after-config nil t) 90 ;; FIXME: If the buffer is shown in N windows, this
91 ;; will be called N times rather than once. We should use
92 ;; something like linum-update-window instead.
93 'linum-update-current nil t)
89 (linum-update-current)) 94 (linum-update-current))
90 (remove-hook 'post-command-hook 'linum-update-current t) 95 (remove-hook 'post-command-hook 'linum-update-current t)
91 (remove-hook 'post-command-hook 'linum-schedule t) 96 (remove-hook 'post-command-hook 'linum-schedule t)
92 (remove-hook 'window-size-change-functions 'linum-after-size t) 97 ;; (remove-hook 'window-size-change-functions 'linum-after-size t)
93 (remove-hook 'window-scroll-functions 'linum-after-scroll t) 98 (remove-hook 'window-scroll-functions 'linum-after-scroll t)
94 (remove-hook 'after-change-functions 'linum-after-change t) 99 (remove-hook 'after-change-functions 'linum-after-change t)
95 (remove-hook 'window-configuration-change-hook 'linum-after-config t) 100 (remove-hook 'window-configuration-change-hook 'linum-update-current t)
96 (remove-hook 'change-major-mode-hook 'linum-delete-overlays t) 101 (remove-hook 'change-major-mode-hook 'linum-delete-overlays t)
97 (linum-delete-overlays))) 102 (linum-delete-overlays)))
98 103
99 ;;;###autoload 104 ;;;###autoload
100 (define-globalized-minor-mode global-linum-mode linum-mode linum-on) 105 (define-globalized-minor-mode global-linum-mode linum-mode linum-on)
173 (linum-update-current))) 178 (linum-update-current)))
174 179
175 (defun linum-after-scroll (win start) 180 (defun linum-after-scroll (win start)
176 (linum-update (window-buffer win))) 181 (linum-update (window-buffer win)))
177 182
178 (defun linum-after-size (frame) 183 ;; (defun linum-after-size (frame)
179 (linum-after-config)) 184 ;; (linum-after-config))
180 185
181 (defun linum-schedule () 186 (defun linum-schedule ()
182 ;; schedule an update; the delay gives Emacs a chance for display changes 187 ;; schedule an update; the delay gives Emacs a chance for display changes
183 (run-with-idle-timer 0 nil #'linum-update-current)) 188 (run-with-idle-timer 0 nil #'linum-update-current))
184 189
185 (defun linum-after-config () 190 ;; (defun linum-after-config ()
186 (walk-windows (lambda (w) (linum-update (window-buffer w))) nil 'visible)) 191 ;; (walk-windows (lambda (w) (linum-update (window-buffer w))) nil 'visible))
187 192
188 (defun linum-unload-function () 193 (defun linum-unload-function ()
189 "Unload the Linum library." 194 "Unload the Linum library."
190 (global-linum-mode -1) 195 (global-linum-mode -1)
191 ;; continue standard unloading 196 ;; continue standard unloading