63 |
|
|
64 |
(defvar hl-line-overlay nil) |
(defvar hl-line-overlay nil) |
65 |
|
|
|
(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. |
|
|
(unless (window-minibuffer-p (selected-window)) ; silly in minibuffer |
|
|
(unless hl-line-overlay |
|
|
(setq hl-line-overlay (make-overlay 1 1)) ; to be moved |
|
|
(overlay-put hl-line-overlay 'face hl-line-face)) |
|
|
(overlay-put hl-line-overlay 'window (selected-window)) |
|
|
(move-overlay hl-line-overlay |
|
|
(line-beginning-position) (1+ (line-end-position)) |
|
|
(current-buffer))))) |
|
|
|
|
|
(defun hl-line-unhighlight () |
|
|
"Deactivate the Hl-Line overlay on the current line in the current window." |
|
|
(if hl-line-overlay |
|
|
(delete-overlay hl-line-overlay))) |
|
|
|
|
66 |
;;;###autoload |
;;;###autoload |
67 |
(define-minor-mode hl-line-mode |
(define-minor-mode hl-line-mode |
68 |
"Minor mode to highlight the line about point in the current window. |
"Minor mode to highlight the line about point in the current window. |
83 |
global-hl-line-mode hl-line-mode hl-line-mode |
global-hl-line-mode hl-line-mode hl-line-mode |
84 |
:group 'hl-line) |
:group 'hl-line) |
85 |
|
|
86 |
|
(defun hl-line-highlight () |
87 |
|
"Active the Hl-Line overlay on the current line in the current window. |
88 |
|
\(Unless it's a minibuffer window.)" |
89 |
|
(when hl-line-mode ; Could be made buffer-local. |
90 |
|
(unless (window-minibuffer-p (selected-window)) ; silly in minibuffer |
91 |
|
(unless hl-line-overlay |
92 |
|
(setq hl-line-overlay (make-overlay 1 1)) ; to be moved |
93 |
|
(overlay-put hl-line-overlay 'face hl-line-face)) |
94 |
|
(overlay-put hl-line-overlay 'window (selected-window)) |
95 |
|
(move-overlay hl-line-overlay |
96 |
|
(line-beginning-position) (1+ (line-end-position)) |
97 |
|
(current-buffer))))) |
98 |
|
|
99 |
|
(defun hl-line-unhighlight () |
100 |
|
"Deactivate the Hl-Line overlay on the current line in the current window." |
101 |
|
(if hl-line-overlay |
102 |
|
(delete-overlay hl-line-overlay))) |
103 |
|
|
104 |
(provide 'hl-line) |
(provide 'hl-line) |
105 |
|
|
106 |
;;; hl-line.el ends here |
;;; hl-line.el ends here |