changeset 67208:af4b92018fde

* 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.
author Chong Yidong <cyd@stupidchicken.com>
date Tue, 29 Nov 2005 22:28:59 +0000
parents 118bc6fc5238
children a0e182783583
files lisp/ChangeLog lisp/hi-lock.el
diffstat 2 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Nov 29 20:48:32 2005 +0000
+++ b/lisp/ChangeLog	Tue Nov 29 22:28:59 2005 +0000
@@ -1,3 +1,9 @@
+2005-11-29  Chong Yidong  <cyd@stupidchicken.com>
+
+	* 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.
+
 2005-11-29  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* international/latexenc.el (latex-inputenc-coding-alist): Reword
--- a/lisp/hi-lock.el	Tue Nov 29 20:48:32 2005 +0000
+++ b/lisp/hi-lock.el	Tue Nov 29 22:28:59 2005 +0000
@@ -331,7 +331,7 @@
                            (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 @@
                            (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 @@
                             (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 @@
 `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