aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Love2000-07-18 11:51:43 +0000
committerDave Love2000-07-18 11:51:43 +0000
commit7013279cb37dde47bc0a8981f1e883aeea01c709 (patch)
tree9d8093850c1bf08669b1e47bb28b9acf2fb8c23b
parentc3bc30c8f3b597b1cd5393acbf48292e9821047b (diff)
downloademacs-7013279cb37dde47bc0a8981f1e883aeea01c709.tar.gz
emacs-7013279cb37dde47bc0a8981f1e883aeea01c709.zip
(hl-line-highlight): Check hl-line-mode.
-rw-r--r--lisp/hl-line.el18
1 files changed, 11 insertions, 7 deletions
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index 641f1fc931e..a3d66135c44 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -44,6 +44,9 @@
44;; `hl-line-highlight', on `post-command-hook', activates it again 44;; `hl-line-highlight', on `post-command-hook', activates it again
45;; across the window width. 45;; across the window width.
46 46
47;; You could make variable `hl-line-mode' buffer-local to avoid
48;; highlighting specific buffers.
49
47;;; Code: 50;;; Code:
48 51
49(defgroup hl-line nil 52(defgroup hl-line nil
@@ -63,13 +66,14 @@
63(defun hl-line-highlight () 66(defun hl-line-highlight ()
64 "Active the Hl-Line overlay on the current line in the current window. 67 "Active the Hl-Line overlay on the current line in the current window.
65\(Unless it's a minibuffer window.)" 68\(Unless it's a minibuffer window.)"
66 (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer 69 (when hl-line-mode ; Could be made buffer-local.
67 (unless hl-line-overlay ; new overlay for this buffer 70 (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer
68 (setq hl-line-overlay (make-overlay 1 1)) ; to be moved 71 (unless hl-line-overlay ; new overlay for this buffer
69 (overlay-put hl-line-overlay 'face hl-line-face)) 72 (setq hl-line-overlay (make-overlay 1 1)) ; to be moved
70 (overlay-put hl-line-overlay 'window (selected-window)) 73 (overlay-put hl-line-overlay 'face hl-line-face))
71 (move-overlay hl-line-overlay 74 (overlay-put hl-line-overlay 'window (selected-window))
72 (line-beginning-position) (1+ (line-end-position))))) 75 (move-overlay hl-line-overlay
76 (line-beginning-position) (1+ (line-end-position))))))
73 77
74(defun hl-line-unhighlight () 78(defun hl-line-unhighlight ()
75 "Deactivate the Hl-Line overlay on the current line in the current window." 79 "Deactivate the Hl-Line overlay on the current line in the current window."