]> code.delx.au - gnu-emacs/blobdiff - lisp/hi-lock.el
Minor fixes for text of help-echo in some options.
[gnu-emacs] / lisp / hi-lock.el
index 20961226cb513707e9adfa361ca62f56650d8592..6c7fb5d0c5854b42c5c1273c1648556d5ec97daa 100644 (file)
@@ -1,4 +1,4 @@
-;;; hi-lock.el --- Minor mode for interactive automatic highlighting.
+;;; hi-lock.el --- minor mode for interactive automatic highlighting
 
 ;; Copyright (C) 2000, 2001 Free Software Foundation, Inc.
 
@@ -22,7 +22,7 @@
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
-;;; Commentary
+;;; Commentary:
 ;; 
 ;;  With the hi-lock commands text matching interactively entered
 ;;  regexp's can be highlighted.  For example, `M-x highlight-regexp
@@ -334,7 +334,9 @@ list maintained for regexps, global history maintained for faces.
   (unless hi-lock-mode (hi-lock-mode))
   (or (facep face) (setq face 'rwl-yellow))
   (hi-lock-set-pattern
-   (list (concat "^.*" regexp ".*$") (list 0 (list 'quote face) t))))
+   ;; The \\(?:...\\) grouping construct ensures that a leading ^, +, * or ?
+   ;; or a trailing $ in REGEXP will be interpreted correctly.
+   (list (concat "^.*\\(?:" regexp "\\).*$") (list 0 (list 'quote face) t))))
 
 
 ;;;###autoload
@@ -390,7 +392,7 @@ interactive functions.  \(See `hi-lock-interactive-patterns'.\)
 \\<minibuffer-local-must-match-map>Use \\[minibuffer-complete] to complete a partially typed regexp.
 \(See info node `Minibuffer History'.\)"
   (interactive
-   (if (vectorp (this-command-keys))
+   (if (and (display-popup-menus-p) (vectorp (this-command-keys)))
        (catch 'snafu
         (or
          (x-popup-menu
@@ -420,7 +422,7 @@ interactive functions.  \(See `hi-lock-interactive-patterns'.\)
          (error "No highlighting to remove"))
        (list
         (completing-read "Regexp to unhighlight: "
-                         hi-lock-interactive-patterns t t
+                         hi-lock-interactive-patterns nil t
                          (car (car hi-lock-interactive-patterns))
                          (cons 'history-list 1))))))
   (let ((keyword (assoc regexp hi-lock-interactive-patterns)))