changeset 50847:47453bc2423e

Removed an erroneous comment. (hl-line-mode): Use buffer local hooks. (global-hl-line-mode): Turn local modes on unconditionally. (hl-line-highlight): Comment fix.
author Lute Kamstra <lute@gnu.org>
date Tue, 06 May 2003 15:34:54 +0000
parents 1ac6f8245bff
children 094f6044edfd
files lisp/hl-line.el
diffstat 1 files changed, 6 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/hl-line.el	Tue May 06 15:16:27 2003 +0000
+++ b/lisp/hl-line.el	Tue May 06 15:34:54 2003 +0000
@@ -46,9 +46,6 @@
 ;; `hl-line-highlight', on `post-command-hook', activates it again
 ;; across the window width.
 
-;; You could make variable `hl-line-mode' buffer-local to avoid
-;; highlighting specific buffers, when the global mode is used.
-
 ;;; Code:
 
 (defgroup hl-line nil
@@ -72,21 +69,21 @@
   nil nil nil
   (if hl-line-mode
       (progn
-	(add-hook 'pre-command-hook #'hl-line-unhighlight)
-	(add-hook 'post-command-hook #'hl-line-highlight))
+	(add-hook 'pre-command-hook #'hl-line-unhighlight nil t)
+	(add-hook 'post-command-hook #'hl-line-highlight nil t))
     (hl-line-unhighlight)
-    (remove-hook 'pre-command-hook #'hl-line-unhighlight)
-    (remove-hook 'post-command-hook #'hl-line-highlight)))
+    (remove-hook 'pre-command-hook #'hl-line-unhighlight t)
+    (remove-hook 'post-command-hook #'hl-line-highlight t)))
 
 ;;;###autoload
 (easy-mmode-define-global-mode
- global-hl-line-mode hl-line-mode hl-line-mode
+ global-hl-line-mode hl-line-mode (lambda () (hl-line-mode 1))
  :group 'hl-line)
 
 (defun hl-line-highlight ()
   "Active the Hl-Line overlay on the current line in the current window.
 \(Unless it's a minibuffer window.)"
-  (when hl-line-mode			; Could be made buffer-local.
+  (when hl-line-mode		; Might be changed outside the mode function.
     (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer
       (unless hl-line-overlay
 	(setq hl-line-overlay (make-overlay 1 1)) ; to be moved