;;; hi-lock.el --- minor mode for interactive automatic highlighting
;; Copyright (C) 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007 Free Software Foundation, Inc.
+;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: David M. Koppelman, koppel@ece.lsu.edu
;; Keywords: faces, minor-mode, matching, display
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
:type '(repeat symbol)
:group 'hi-lock)
-(defcustom hi-lock-file-patterns-policy 'never
+(defcustom hi-lock-file-patterns-policy 'ask
"Specify when hi-lock should use patterns found in file.
If `ask', prompt when patterns found in buffer; if bound to a function,
use patterns when function returns t (function is called with patterns
Write active REGEXPs into buffer as comments (if possible). They may
be read the next time file is loaded or when the \\[hi-lock-find-patterns] command
is issued. The inserted regexps are in the form of font lock keywords.
- (See `font-lock-keywords'.) They may be edited and re-loaded with \\[hi-lock-find-patterns],
+ (See `font-lock-keywords'.) They may be edited and re-loaded with \\[hi-lock-find-patterns],
any valid `font-lock-keywords' form is acceptable. When a file is
loaded the patterns are read if `hi-lock-file-patterns-policy is
'ask and the user responds y to the prompt, or if
\\<minibuffer-local-must-match-map>Use \\[minibuffer-complete] to complete a partially typed regexp.
\(See info node `Minibuffer History'.\)"
(interactive
- (if (and (display-popup-menus-p) (vectorp (this-command-keys)))
+ (if (and (display-popup-menus-p) (not last-nonmenu-event))
(catch 'snafu
(or
(x-popup-menu
(if (null hi-lock-interactive-patterns)
(error "There are no interactive patterns"))
(let ((beg (point)))
- (mapcar
+ (mapc
(lambda (pattern)
(insert (format "%s: (%s)\n"
hi-lock-file-patterns-prefix