aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/hi-lock.el
diff options
context:
space:
mode:
authorChong Yidong <[email protected]>2005-11-29 22:28:59 +0000
committerChong Yidong <[email protected]>2005-11-29 22:28:59 +0000
commit597767dac7a956634df23884ae828b8a7dcdeb12 (patch)
treee6c99e765deb5c937057adadbf1c4ab770393e0c /lisp/hi-lock.el
parent13ea43e96a9fed928c892a7f56b1dacfb5487d1c (diff)
* hi-lock.el (hi-lock-line-face-buffer, hi-lock-face-buffer)
(hi-lock-face-phrase-buffer): Use hi-yellow face. (hi-lock-write-interactive-patterns): Use comment-region.
Diffstat (limited to 'lisp/hi-lock.el')
-rw-r--r--lisp/hi-lock.el23
1 files changed, 11 insertions, 12 deletions
diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el
index aa40ad2ae5..4c61be5529 100644
--- a/lisp/hi-lock.el
+++ b/lisp/hi-lock.el
@@ -331,7 +331,7 @@ list maintained for regexps, global history maintained for faces.
(cons (or (car hi-lock-regexp-history) "") 1 )
nil nil 'hi-lock-regexp-history))
(hi-lock-read-face-name)))
- (or (facep face) (setq face 'rwl-yellow))
+ (or (facep face) (setq face 'hi-yellow))
(unless hi-lock-buffer-mode (hi-lock-buffer-mode 1))
(hi-lock-set-pattern
;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
@@ -356,7 +356,7 @@ list maintained for regexps, global history maintained for faces.
(cons (or (car hi-lock-regexp-history) "") 1 )
nil nil 'hi-lock-regexp-history))
(hi-lock-read-face-name)))
- (or (facep face) (setq face 'rwl-yellow))
+ (or (facep face) (setq face 'hi-yellow))
(unless hi-lock-buffer-mode (hi-lock-buffer-mode 1))
(hi-lock-set-pattern regexp face))
@@ -376,7 +376,7 @@ lower-case letters made case insensitive."
(cons (or (car hi-lock-regexp-history) "") 1 )
nil nil 'hi-lock-regexp-history)))
(hi-lock-read-face-name)))
- (or (facep face) (setq face 'rwl-yellow))
+ (or (facep face) (setq face 'hi-yellow))
(unless hi-lock-buffer-mode (hi-lock-buffer-mode 1))
(hi-lock-set-pattern regexp face))
@@ -440,17 +440,16 @@ Interactively added patterns are those normally specified using
`highlight-regexp' and `highlight-lines-matching-regexp'; they can
be found in variable `hi-lock-interactive-patterns'."
(interactive)
- (let ((prefix (format "%s %s:" (or comment-start "") "Hi-lock")))
- (when (> (+ (point) (length prefix)) hi-lock-file-patterns-range)
- (beep)
- (message
- "Warning, inserted keywords not close enough to top of file."))
+ (if (null hi-lock-interactive-patterns)
+ (error "There are no interactive patterns"))
+ (let ((beg (point)))
(mapcar
(lambda (pattern)
- (insert (format "%s (%s) %s\n"
- prefix (prin1-to-string pattern) (or comment-end ""))))
- hi-lock-interactive-patterns)))
-
+ (insert (format "Hi-lock: (%s)\n" (prin1-to-string pattern))))
+ hi-lock-interactive-patterns)
+ (comment-region beg (point)))
+ (when (> (point) hi-lock-file-patterns-range)
+ (warn "Inserted keywords not close enough to top of file")))
;; Implementation Functions