comparison lisp/hl-line.el @ 31846:6e48fd527039

(hl-line-overlay): Don't make it buffer-local. (hl-line-highlight): Specify buffer when moving overlay.
author Dave Love <fx@gnu.org>
date Fri, 22 Sep 2000 17:16:31 +0000
parents 428e9eb82841
children b8a47482f3cd
comparison
equal deleted inserted replaced
31845:4bdcc0f0232f 31846:6e48fd527039
58 "Face with which to highlight the current line." 58 "Face with which to highlight the current line."
59 :type 'face 59 :type 'face
60 :group 'hl-line) 60 :group 'hl-line)
61 61
62 (defvar hl-line-overlay nil) 62 (defvar hl-line-overlay nil)
63 (make-variable-buffer-local 'hl-line-overlay)
64 (put 'hl-line-overlay 'permanent-local t)
65 63
66 (defun hl-line-highlight () 64 (defun hl-line-highlight ()
67 "Active the Hl-Line overlay on the current line in the current window. 65 "Active the Hl-Line overlay on the current line in the current window.
68 \(Unless it's a minibuffer window.)" 66 \(Unless it's a minibuffer window.)"
69 (when hl-line-mode ; Could be made buffer-local. 67 (when hl-line-mode ; Could be made buffer-local.
70 (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer 68 (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer
71 (unless hl-line-overlay ; new overlay for this buffer 69 (unless hl-line-overlay
72 (setq hl-line-overlay (make-overlay 1 1)) ; to be moved 70 (setq hl-line-overlay (make-overlay 1 1)) ; to be moved
73 (overlay-put hl-line-overlay 'face hl-line-face)) 71 (overlay-put hl-line-overlay 'face hl-line-face))
74 (overlay-put hl-line-overlay 'window (selected-window)) 72 (overlay-put hl-line-overlay 'window (selected-window))
75 (move-overlay hl-line-overlay 73 (move-overlay hl-line-overlay
76 (line-beginning-position) (1+ (line-end-position)))))) 74 (line-beginning-position) (1+ (line-end-position))
75 (current-buffer)))))
77 76
78 (defun hl-line-unhighlight () 77 (defun hl-line-unhighlight ()
79 "Deactivate the Hl-Line overlay on the current line in the current window." 78 "Deactivate the Hl-Line overlay on the current line in the current window."
80 (if hl-line-overlay 79 (if hl-line-overlay
81 (delete-overlay hl-line-overlay))) 80 (delete-overlay hl-line-overlay)))