/[emacs]/emacs/lisp/hl-line.el
ViewVC logotype

Diff of /emacs/lisp/hl-line.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by rms, Sun Jan 20 09:27:07 2002 UTC revision 1.17 by rms, Fri Feb 1 04:18:46 2002 UTC
# Line 63  Line 63 
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.
# Line 101  Uses functions `hl-line-unhighlight' and Line 83  Uses functions `hl-line-unhighlight' and
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

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26