aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2006-08-29 13:28:00 +0000
committerChong Yidong2006-08-29 13:28:00 +0000
commit3775cb5cd8807c9f8781e89dbe0afcfc80f3bcac (patch)
treee771aa2c693771883ff4c47eed2f31cadfd01367
parentbda420a33939fb272f2d06b3a58560b3385a1443 (diff)
downloademacs-3775cb5cd8807c9f8781e89dbe0afcfc80f3bcac.tar.gz
emacs-3775cb5cd8807c9f8781e89dbe0afcfc80f3bcac.zip
* hl-line.el (hl-line): New face.
(hl-line-face): Use it.
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/hl-line.el34
2 files changed, 27 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 78e0ee532f6..c14eb65d15e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
12006-08-29 Chong Yidong <cyd@stupidchicken.com> 12006-08-29 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * hl-line.el (hl-line): New face.
4 (hl-line-face): Use it.
5
3 * image-mode.el (image-mode): Fix last fix. 6 * image-mode.el (image-mode): Fix last fix.
4 Suggested by Kim F. Storm. 7 Suggested by Kim F. Storm.
5 8
diff --git a/lisp/hl-line.el b/lisp/hl-line.el
index c2d2d293010..757a398086d 100644
--- a/lisp/hl-line.el
+++ b/lisp/hl-line.el
@@ -64,16 +64,37 @@
64 64
65;;; Code: 65;;; Code:
66 66
67(defvar hl-line-overlay nil
68 "Overlay used by Hl-Line mode to highlight the current line.")
69(make-variable-buffer-local 'hl-line-overlay)
70
71(defvar global-hl-line-overlay nil
72 "Overlay used by Global-Hl-Line mode to highlight the current line.")
73
67(defgroup hl-line nil 74(defgroup hl-line nil
68 "Highlight the current line." 75 "Highlight the current line."
69 :version "21.1" 76 :version "21.1"
70 :group 'editing) 77 :group 'editing)
71 78
72(defcustom hl-line-face 'highlight 79(defface hl-line
73 "Face with which to highlight the current line." 80 '((t :inherit highlight))
74 :type 'face 81 "Default face for highlighting the current line in Hl-Line mode."
82 :version "22.1"
75 :group 'hl-line) 83 :group 'hl-line)
76 84
85(defcustom hl-line-face 'hl-line
86 "Face with which to highlight the current line in Hl-Line mode."
87 :type 'face
88 :group 'hl-line
89 :set (lambda (symbol value)
90 (set symbol value)
91 (dolist (buffer (buffer-list))
92 (with-current-buffer buffer
93 (when hl-line-overlay
94 (overlay-put hl-line-overlay 'face hl-line-face))))
95 (when global-hl-line-overlay
96 (overlay-put global-hl-line-overlay 'face hl-line-face))))
97
77(defcustom hl-line-sticky-flag t 98(defcustom hl-line-sticky-flag t
78 "*Non-nil means highlight the current line in all windows. 99 "*Non-nil means highlight the current line in all windows.
79Otherwise Hl-Line mode will highlight only in the selected 100Otherwise Hl-Line mode will highlight only in the selected
@@ -92,13 +113,6 @@ It should return nil if there's no region to be highlighted.
92 113
93This variable is expected to be made buffer-local by modes.") 114This variable is expected to be made buffer-local by modes.")
94 115
95(defvar hl-line-overlay nil
96 "Overlay used by Hl-Line mode to highlight the current line.")
97(make-variable-buffer-local 'hl-line-overlay)
98
99(defvar global-hl-line-overlay nil
100 "Overlay used by Global-Hl-Line mode to highlight the current line.")
101
102;;;###autoload 116;;;###autoload
103(define-minor-mode hl-line-mode 117(define-minor-mode hl-line-mode
104 "Buffer-local minor mode to highlight the line about point. 118 "Buffer-local minor mode to highlight the line about point.