summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/hl-line.el15
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f86cfeea7b0..eae6838ae47 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2003-05-06 Lute Kamstra <lute@occarina.pna.cwi.nl>
+
+ * hl-line.el: 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.
+
2003-05-06 Richard M. Stallman <rms@gnu.org>
* newcomment.el (comment-search-forward): Delete autoload cookie.
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index 317788087d0..727f859a32e 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -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 @@ Uses functions `hl-line-unhighlight' and `hl-line-highlight' on
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