diff options
| author | Lute Kamstra | 2003-05-06 15:35:58 +0000 |
|---|---|---|
| committer | Lute Kamstra | 2003-05-06 15:35:58 +0000 |
| commit | 9df382fe168349595908ecd8bd6184d3ca66628c (patch) | |
| tree | a0e4ca222cc2581ed5b994f50544d26932afd9e0 | |
| parent | 95e60ff9843afdef2077b29ba94e768caf80cb63 (diff) | |
| download | emacs-9df382fe168349595908ecd8bd6184d3ca66628c.tar.gz emacs-9df382fe168349595908ecd8bd6184d3ca66628c.zip | |
Removed an erroneous comment.
(hl-line-mode): Use buffer local hooks.
(global-hl-line-mode): Turn local modes on unconditionally.
(hl-line-highlight): Comment fix.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/hl-line.el | 15 |
2 files changed, 13 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f86cfeea7b0..eae6838ae47 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2003-05-06 Lute Kamstra <lute@occarina.pna.cwi.nl> | ||
| 2 | |||
| 3 | * hl-line.el: Removed an erroneous comment. | ||
| 4 | (hl-line-mode): Use buffer local hooks. | ||
| 5 | (global-hl-line-mode): Turn local modes on unconditionally. | ||
| 6 | (hl-line-highlight): Comment fix. | ||
| 7 | |||
| 1 | 2003-05-06 Richard M. Stallman <rms@gnu.org> | 8 | 2003-05-06 Richard M. Stallman <rms@gnu.org> |
| 2 | 9 | ||
| 3 | * newcomment.el (comment-search-forward): Delete autoload cookie. | 10 | * newcomment.el (comment-search-forward): Delete autoload cookie. |
diff --git a/lisp/hl-line.el b/lisp/hl-line.el index 317788087d0..727f859a32e 100644 --- a/lisp/hl-line.el +++ b/lisp/hl-line.el | |||
| @@ -46,9 +46,6 @@ | |||
| 46 | ;; `hl-line-highlight', on `post-command-hook', activates it again | 46 | ;; `hl-line-highlight', on `post-command-hook', activates it again |
| 47 | ;; across the window width. | 47 | ;; across the window width. |
| 48 | 48 | ||
| 49 | ;; You could make variable `hl-line-mode' buffer-local to avoid | ||
| 50 | ;; highlighting specific buffers, when the global mode is used. | ||
| 51 | |||
| 52 | ;;; Code: | 49 | ;;; Code: |
| 53 | 50 | ||
| 54 | (defgroup hl-line nil | 51 | (defgroup hl-line nil |
| @@ -72,21 +69,21 @@ Uses functions `hl-line-unhighlight' and `hl-line-highlight' on | |||
| 72 | nil nil nil | 69 | nil nil nil |
| 73 | (if hl-line-mode | 70 | (if hl-line-mode |
| 74 | (progn | 71 | (progn |
| 75 | (add-hook 'pre-command-hook #'hl-line-unhighlight) | 72 | (add-hook 'pre-command-hook #'hl-line-unhighlight nil t) |
| 76 | (add-hook 'post-command-hook #'hl-line-highlight)) | 73 | (add-hook 'post-command-hook #'hl-line-highlight nil t)) |
| 77 | (hl-line-unhighlight) | 74 | (hl-line-unhighlight) |
| 78 | (remove-hook 'pre-command-hook #'hl-line-unhighlight) | 75 | (remove-hook 'pre-command-hook #'hl-line-unhighlight t) |
| 79 | (remove-hook 'post-command-hook #'hl-line-highlight))) | 76 | (remove-hook 'post-command-hook #'hl-line-highlight t))) |
| 80 | 77 | ||
| 81 | ;;;###autoload | 78 | ;;;###autoload |
| 82 | (easy-mmode-define-global-mode | 79 | (easy-mmode-define-global-mode |
| 83 | global-hl-line-mode hl-line-mode hl-line-mode | 80 | global-hl-line-mode hl-line-mode (lambda () (hl-line-mode 1)) |
| 84 | :group 'hl-line) | 81 | :group 'hl-line) |
| 85 | 82 | ||
| 86 | (defun hl-line-highlight () | 83 | (defun hl-line-highlight () |
| 87 | "Active the Hl-Line overlay on the current line in the current window. | 84 | "Active the Hl-Line overlay on the current line in the current window. |
| 88 | \(Unless it's a minibuffer window.)" | 85 | \(Unless it's a minibuffer window.)" |
| 89 | (when hl-line-mode ; Could be made buffer-local. | 86 | (when hl-line-mode ; Might be changed outside the mode function. |
| 90 | (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer | 87 | (unless (window-minibuffer-p (selected-window)) ; silly in minibuffer |
| 91 | (unless hl-line-overlay | 88 | (unless hl-line-overlay |
| 92 | (setq hl-line-overlay (make-overlay 1 1)) ; to be moved | 89 | (setq hl-line-overlay (make-overlay 1 1)) ; to be moved |