Mercurial > emacs
comparison lisp/hl-line.el @ 51018:5edeb93ad9c0
(hl-line-highlight, global-hl-line-highlight): Use
`line-beginning-position' to determine the beginning of the next
line.
author | Lute Kamstra <lute@gnu.org> |
---|---|
date | Fri, 16 May 2003 09:27:36 +0000 |
parents | f79532778159 |
children | 695cf19ef79e |
comparison
equal
deleted
inserted
replaced
51017:2cc9a56fe7e8 | 51018:5edeb93ad9c0 |
---|---|
122 (setq hl-line-overlay (make-overlay 1 1)) ; to be moved | 122 (setq hl-line-overlay (make-overlay 1 1)) ; to be moved |
123 (overlay-put hl-line-overlay 'face hl-line-face)) | 123 (overlay-put hl-line-overlay 'face hl-line-face)) |
124 (overlay-put hl-line-overlay | 124 (overlay-put hl-line-overlay |
125 'window (unless hl-line-sticky-flag (selected-window))) | 125 'window (unless hl-line-sticky-flag (selected-window))) |
126 (move-overlay hl-line-overlay | 126 (move-overlay hl-line-overlay |
127 (line-beginning-position) (1+ (line-end-position)))) | 127 (line-beginning-position) (line-beginning-position 2))) |
128 (hl-line-unhighlight))) | 128 (hl-line-unhighlight))) |
129 | 129 |
130 (defun hl-line-unhighlight () | 130 (defun hl-line-unhighlight () |
131 "Deactivate the Hl-Line overlay on the current line." | 131 "Deactivate the Hl-Line overlay on the current line." |
132 (if hl-line-overlay | 132 (if hl-line-overlay |
156 (unless global-hl-line-overlay | 156 (unless global-hl-line-overlay |
157 (setq global-hl-line-overlay (make-overlay 1 1)) ; to be moved | 157 (setq global-hl-line-overlay (make-overlay 1 1)) ; to be moved |
158 (overlay-put global-hl-line-overlay 'face hl-line-face)) | 158 (overlay-put global-hl-line-overlay 'face hl-line-face)) |
159 (overlay-put global-hl-line-overlay 'window (selected-window)) | 159 (overlay-put global-hl-line-overlay 'window (selected-window)) |
160 (move-overlay global-hl-line-overlay | 160 (move-overlay global-hl-line-overlay |
161 (line-beginning-position) (1+ (line-end-position)))))) | 161 (line-beginning-position) (line-beginning-position 2))))) |
162 | 162 |
163 (defun global-hl-line-unhighlight () | 163 (defun global-hl-line-unhighlight () |
164 "Deactivate the Global-Hl-Line overlay on the current line." | 164 "Deactivate the Global-Hl-Line overlay on the current line." |
165 (if global-hl-line-overlay | 165 (if global-hl-line-overlay |
166 (delete-overlay global-hl-line-overlay))) | 166 (delete-overlay global-hl-line-overlay))) |