/[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.18 by lektu, Wed Mar 27 10:22:34 2002 UTC revision 1.19 by lute, Tue May 6 15:34:54 2003 UTC
# Line 46  Line 46 
46  ;; `hl-line-highlight', on `post-command-hook', activates it again  ;; `hl-line-highlight', on `post-command-hook', activates it again
47  ;; across the window width.  ;; across the window width.
48    
 ;; You could make variable `hl-line-mode' buffer-local to avoid  
 ;; highlighting specific buffers, when the global mode is used.  
   
49  ;;; Code:  ;;; Code:
50    
51  (defgroup hl-line nil  (defgroup hl-line nil
# Line 72  Uses functions `hl-line-unhighlight' and Line 69  Uses functions `hl-line-unhighlight' and
69    nil nil nil    nil nil nil
70    (if hl-line-mode    (if hl-line-mode
71        (progn        (progn
72          (add-hook 'pre-command-hook #'hl-line-unhighlight)          (add-hook 'pre-command-hook #'hl-line-unhighlight nil t)
73          (add-hook 'post-command-hook #'hl-line-highlight))          (add-hook 'post-command-hook #'hl-line-highlight nil t))
74      (hl-line-unhighlight)      (hl-line-unhighlight)
75      (remove-hook 'pre-command-hook #'hl-line-unhighlight)      (remove-hook 'pre-command-hook #'hl-line-unhighlight t)
76      (remove-hook 'post-command-hook #'hl-line-highlight)))      (remove-hook 'post-command-hook #'hl-line-highlight t)))
77    
78  ;;;###autoload  ;;;###autoload
79  (easy-mmode-define-global-mode  (easy-mmode-define-global-mode
80   global-hl-line-mode hl-line-mode hl-line-mode   global-hl-line-mode hl-line-mode (lambda () (hl-line-mode 1))
81   :group 'hl-line)   :group 'hl-line)
82    
83  (defun hl-line-highlight ()  (defun hl-line-highlight ()
84    "Active the Hl-Line overlay on the current line in the current window.    "Active the Hl-Line overlay on the current line in the current window.
85  \(Unless it's a minibuffer window.)"  \(Unless it's a minibuffer window.)"
86    (when hl-line-mode                    ; Could be made buffer-local.    (when hl-line-mode            ; Might be changed outside the mode function.
87      (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer      (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer
88        (unless hl-line-overlay        (unless hl-line-overlay
89          (setq hl-line-overlay (make-overlay 1 1)) ; to be moved          (setq hl-line-overlay (make-overlay 1 1)) ; to be moved

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

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