;ELC   
;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:46:25 2003
;;; from file /home/pot/gnu/emacs-pretest.new/lisp/hi-lock.el
;;; in Emacs version 21.3
;;; with bytecomp version 2.85.4.1
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.
(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`hi-lock.el' was compiled for Emacs 19.29 or later"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\302\303\304\305\306\307%\207" [require font-lock custom-declare-group hi-lock-interactive-text-highlighting nil "Interactively add and remove font-lock patterns for highlighting text." :group faces] 6)
#@80 Toggle hi-lock, for interactively adding font-lock text-highlighting patterns.
(custom-declare-variable 'hi-lock-mode 'nil '(#$ . 844) :set (lambda (symbol value) (hi-lock-mode (or value 0))) :initialize 'custom-initialize-default :type 'boolean :group 'hi-lock-interactive-text-highlighting :require 'hi-lock)
#@243 Limit of search in a buffer for hi-lock patterns.
When a file is visited and hi-lock mode is on patterns starting
up to this limit are added to font-lock's patterns.  See documentation
of functions `hi-lock-mode' and `hi-lock-find-patterns'.
(custom-declare-variable 'hi-lock-file-patterns-range '10000 '(#$ . 1162) :type 'integer :group 'hi-lock-interactive-text-highlighting)
#@126 List of major modes in which hi-lock will not run.
For security reasons since font lock patterns can specify function
calls.
(custom-declare-variable 'hi-lock-exclude-modes ''(rmail-mode mime/viewer-mode gnus-article-mode) '(#$ . 1547) :type '(repeat symbol) :group 'hi-lock-interactive-text-highlighting)
(byte-code "\300\301\302\303\304\305%\210\306\307\310\311\304\301%\210\306\312\313\314\304\301%\210\306\315\316\314\304\301%\210\306\317\320\314\304\301%\210\306\321\322\314\304\301%\210\306\323\324\314\304\301%\210\306\325\326\314\304\301%\210\306\327\330\314\304\301%\210\306\331\332\314\304\301%\207" [custom-declare-group hi-lock-faces nil "Faces for hi-lock." :group hi-lock-interactive-text-highlighting custom-declare-face hi-yellow ((((background dark)) (:background "yellow" :foreground "black")) (t (:background "yellow"))) "Default face for hi-lock mode." hi-pink ((((background dark)) (:background "pink" :foreground "black")) (t (:background "pink"))) "Face for hi-lock mode." hi-green ((((background dark)) (:background "green" :foreground "black")) (t (:background "green"))) hi-blue ((((background dark)) (:background "light blue" :foreground "black")) (t (:background "light blue"))) hi-black-b ((t (:weight bold))) hi-blue-b ((t (:weight bold :foreground "blue"))) hi-green-b ((t (:weight bold :foreground "green"))) hi-red-b ((t (:weight bold :foreground "red"))) hi-black-hb ((t (:weight bold :height 1.67 :inherit variable-pitch)))] 6)
#@61 Patterns found in file for hi-lock.  Should not be changed.
(defvar hi-lock-file-patterns nil (#$ . 3016))
#@63 Patterns provided to hi-lock by user.  Should not be changed.
(defvar hi-lock-interactive-patterns nil (#$ . 3129))
#@58 History list of faces for hi-lock interactive functions.
(defvar hi-lock-face-history (list "hi-yellow" "hi-pink" "hi-green" "hi-blue" "hi-black-b" "hi-blue-b" "hi-red-b" "hi-green-b" "hi-black-hb") (#$ . 3251))
#@56 History of regexps used for interactive fontification.
(defvar hi-lock-regexp-history nil (#$ . 3469))
#@53 Regexp for finding hi-lock patterns at top of file.
(defvar hi-lock-file-patterns-prefix "Hi-lock" (#$ . 3578))
(byte-code "\300\301!\210\302\301\303\304#\210\300\305!\210\302\305\303\304#\210\300\306!\210\302\306\303\304#\207" [make-variable-buffer-local hi-lock-interactive-patterns put permanent-local t hi-lock-regexp-history hi-lock-file-patterns] 4)
#@24 Menu for hi-lock mode.
(defvar hi-lock-menu (make-sparse-keymap "Hi Lock") (#$ . 3940))
(byte-code "\301\302\303#\210\301\304\305#\210\301\306\307#\210\301\310\311#\210\301\312\313#\210\301\314\315#\207" [hi-lock-menu define-key-after [highlight-regexp] (menu-item "Highlight Regexp..." highlight-regexp :help "Highlight text matching PATTERN (a regexp).") [highlight-phrase] (menu-item "Highlight Phrase..." highlight-phrase :help "Highlight text matching PATTERN (a regexp processed to match phrases).") [highlight-lines-matching-regexp] (menu-item "Highlight Lines..." highlight-lines-matching-regexp :help "Highlight lines containing match of PATTERN (a regexp)..") [unhighlight-regexp] (menu-item "Remove Highlighting..." unhighlight-regexp :help "Remove previously entered highlighting pattern." :enable hi-lock-interactive-patterns) [hi-lock-write-interactive-patterns] (menu-item "Patterns to Buffer" hi-lock-write-interactive-patterns :help "Insert interactively added REGEXPs into buffer at point." :enable hi-lock-interactive-patterns) [hi-lock-find-patterns] (menu-item "Patterns from Buffer" hi-lock-find-patterns :help "Use patterns (if any) near top of buffer.")] 4)
#@22 Key map for hi-lock.
(defvar hi-lock-map (make-sparse-keymap "Hi Lock") (#$ . 5134))
(byte-code "\303\304\305#\210\303\306\307#\210\303\310\311#\210\303\312\313#\210\303\314\315#\210\303\316\317#\210\320	\236\2040 \320B	B\320\n\236\204: \321\nB\303\207" [hi-lock-map minor-mode-map-alist minor-mode-alist define-key "wi" hi-lock-find-patterns "wl" highlight-lines-matching-regexp "wp" highlight-phrase "wh" highlight-regexp "wr" unhighlight-regexp "wb" hi-lock-write-interactive-patterns hi-lock-mode (hi-lock-mode " H")] 4)
#@1882 Toggle minor mode for interactively adding font-lock highlighting patterns.

If ARG positive turn hi-lock on.  Issuing a hi-lock command will also
turn hi-lock on.  When hi-lock is turned on, a "Regexp Highlighting"
submenu is added to the "Edit" menu.  The commands in the submenu,
which can be called interactively, are:

\[highlight-regexp] REGEXP FACE
  Highlight matches of pattern REGEXP in current buffer with FACE.

\[highlight-phrase] PHRASE FACE
  Highlight matches of phrase PHRASE in current buffer with FACE.
  (PHRASE can be any REGEXP, but spaces will be replaced by matches
  to whitespace and initial lower-case letters will become case insensitive.)
 
\[highlight-lines-matching-regexp] REGEXP FACE
  Highlight lines containing matches of REGEXP in current buffer with FACE.

\[unhighlight-regexp] REGEXP
  Remove highlighting on matches of REGEXP in current buffer.

\[hi-lock-write-interactive-patterns]
  Write active REGEXPs into buffer as comments (if possible). They will
  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],
  any valid `font-lock-keywords' form is acceptable.

\[hi-lock-find-patterns]
  Re-read patterns stored in buffer (in the format produced by \[hi-lock-write-interactive-patterns]).

When hi-lock is started and if the mode is not excluded, the
beginning of the buffer is searched for lines of the form:
  Hi-lock: FOO
where FOO is a list of patterns. These are added to the font lock keywords
already present.  The patterns must start before position (number
of characters into buffer) `hi-lock-file-patterns-range'.  Patterns
will be read until
 Hi-lock: end
is found. A mode is excluded if it's in the list `hi-lock-exclude-modes'.
(defalias 'hi-lock-mode #[(&optional arg) "\n\204 ?\202 \306\n!\307V	\204K \203K \310\311\312\"\210\310\313\314\"\210\315\316\317\fB#\210\320 \321\211\203J @rq\210\322 \210)A\211\2045 *	\205\244 ?\205\244 \320 \321\211\203\224 @rq\210\204p \203\212 \323\321\"\210\323\321\"\210\321\321\203\212 \324 \210)A\211\204^ *\315\325\321#\210\326\311\312\"\210\326\313\314\")\207" [hi-lock-mode hi-lock-mode-prev arg menu-bar-edit-menu hi-lock-menu buffer prefix-numeric-value 0 add-hook find-file-hooks hi-lock-find-file-hook font-lock-mode-hook hi-lock-font-lock-hook define-key-after [hi-lock] "Regexp Highlighting" buffer-list nil hi-lock-find-patterns font-lock-remove-keywords hi-lock-refontify [hi-lock] remove-hook #1=#:--dolist-temp--97279 #2=#:--dolist-temp--97280 hi-lock-interactive-patterns hi-lock-file-patterns font-lock-mode] 5 (#$ . 5682) nil])
(defalias 'highlight-lines-matching-regexp 'hi-lock-line-face-buffer)
#@357 Set face of all lines containing a match of REGEXP to FACE.

Interactively, prompt for REGEXP then FACE.  Buffer-local history
list maintained for regexps, global history maintained for faces.
\<minibuffer-local-map>Use \[next-history-element] and \[previous-history-element] to retrieve next or previous history item.
(See info node `Minibuffer History')
(defalias 'hi-lock-line-face-buffer #[(regexp &optional face) "\204 \300 \210\303	!\204 \304\305\306\n\307Q\310\311	D\312ED!\207" [hi-lock-mode face regexp facep rwl-yellow hi-lock-set-pattern "^.*\\(?:" "\\).*$" 0 quote t] 5 (#$ . 8539) (list (hi-lock-regexp-okay (read-from-minibuffer "Regexp to highlight line: " (cons (or (car hi-lock-regexp-history) "") 1) nil nil 'hi-lock-regexp-history)) (hi-lock-read-face-name))])
(defalias 'highlight-regexp 'hi-lock-face-buffer)
#@339 Set face of each match of REGEXP to FACE.

Interactively, prompt for REGEXP then FACE.  Buffer-local history
list maintained for regexps, global history maintained for faces.
\<minibuffer-local-map>Use \[next-history-element] and \[previous-history-element] to retrieve next or previous history item.
(See info node `Minibuffer History')
(defalias 'hi-lock-face-buffer #[(regexp &optional face) "\303!\204 \304	\204 \301 \210\305\n\306\307D\310ED!\207" [face hi-lock-mode regexp facep rwl-yellow hi-lock-set-pattern 0 quote t] 5 (#$ . 9380) (list (hi-lock-regexp-okay (read-from-minibuffer "Regexp to highlight: " (cons (or (car hi-lock-regexp-history) "") 1) nil nil 'hi-lock-regexp-history)) (hi-lock-read-face-name))])
(defalias 'highlight-phrase 'hi-lock-face-phrase-buffer)
#@160 Set face of each match of phrase REGEXP to FACE.

Whitespace in REGEXP converted to arbitrary whitespace and initial
lower-case letters made case insensitive.
(defalias 'hi-lock-face-phrase-buffer #[(regexp &optional face) "\303!\204 \304	\204 \301 \210\305\n\306\307D\310ED!\207" [face hi-lock-mode regexp facep rwl-yellow hi-lock-set-pattern 0 quote t] 5 (#$ . 10171) (list (hi-lock-regexp-okay (hi-lock-process-phrase (read-from-minibuffer "Phrase to highlight: " (cons (or (car hi-lock-regexp-history) "") 1) nil nil 'hi-lock-regexp-history))) (hi-lock-read-face-name))])
(defalias 'unhighlight-regexp 'hi-lock-unface-buffer)
#@396 Remove highlighting of each match to REGEXP set by hi-lock.

Interactively, prompt for REGEXP.  Buffer-local history of inserted
regexp's maintained.  Will accept only regexps inserted by hi-lock
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'.)
(defalias 'hi-lock-unface-buffer #[(regexp) "\303	\"\211\205 \304\305\nC\"\210\306\n	\"\307 )\207" [regexp hi-lock-interactive-patterns keyword assoc font-lock-remove-keywords nil delq hi-lock-refontify] 4 (#$ . 10813) (byte-code "\302 \203 \303\304 !\203 \305\306\215\207\307\310\"\204 \311\312!\210\313\314\315\316@@\301\317B&)C\207" [hi-lock-interactive-patterns history-list display-popup-menus-p vectorp this-command-keys snafu (byte-code "\301\302\303\304\305\306\"BB\"\206 \307\310\311\"\207" [hi-lock-interactive-patterns x-popup-menu t keymap "Select Pattern to Unhighlight" mapcar #[(pattern) "@\301\302@\303A@A@A@!#\304\211B@F\207" [pattern format "%s (%s)" symbol-name nil] 6] throw snafu ("")] 7) mapcar #[(p) "@\207" [p] 1] error "No highlighting to remove" completing-read "Regexp to unhighlight: " nil t 1] 8)])
#@252 Write interactively added patterns, if any, into buffer at point.

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'.
(defalias 'hi-lock-write-interactive-patterns #[nil "\304\305\206 \306\307#`	G\\\nV\203 \310 \210\311\312!\210\313\314\")\207" [comment-start prefix hi-lock-file-patterns-range hi-lock-interactive-patterns format "%s %s:" "" "Hi-lock" beep message "Warning, inserted keywords not close enough to top of file." mapcar #[(pattern) "\303\304\305	!\n\206 \306$c\207" [prefix pattern comment-end format "%s (%s) %s\n" prin1-to-string ""] 5]] 4 (#$ . 12063) nil])
#@182 Convert regexp PHRASE to a regexp that matches phrases.

Blanks in PHRASE replaced by regexp that matches arbitrary whitespace
and initial lower-case letters made case insensitive.
(defalias 'hi-lock-process-phrase #[(phrase) "\302\303\304\305	#\303\306\307\302\310%\211)\207" [mod-phrase phrase nil replace-regexp-in-string "\\<[a-z]" #[(m) "\301\302\226#\207" [m format "[%s%s]"] 4] "\\s-+" "[ 	\n]+" t] 6 (#$ . 12786)])
#@148 Return REGEXP if it appears suitable for a font-lock pattern.

Otherwise signal an error.  A pattern that matches the null string is
not suitable.
(defalias 'hi-lock-regexp-okay #[(regexp) "\301\302\"\203 \303\304!\207\207" [regexp string-match "" error "Regexp cannot match an empty string"] 3 (#$ . 13222)])
#@61 Read face name from minibuffer with completion and history.
(defalias 'hi-lock-read-face-name #[nil "\303\304\305\306\307	@\310	@\311\312O\313\314	\"\"\211;\203% \n	@\232\204% \nG\202& \311)B\315&!\207" [obarray hi-lock-face-history prefix intern completing-read "Highlight using face: " facep t try-completion 0 1 mapcar #[(f) "\211B\207" [f] 2] (hi-lock-face-history . 0)] 13 (#$ . 13541)])
#@35 Add hi-lock patterns, if present.
(defalias 'hi-lock-find-file-hook #[nil "\300 \207" [hi-lock-find-patterns] 1 (#$ . 13944)])
#@82 Return line number of line at point.
Optional argument END is maximum excursion.
(defalias 'hi-lock-current-line #[(&optional end) "\212\301 \210\302\303\206 `\"T)\207" [end beginning-of-line count-lines 1] 3 (#$ . 14077) nil])
#@74 Add PATTERN to list of interactively highlighted patterns and refontify.
(defalias 'hi-lock-set-pattern #[(pattern) "\301C!\207" [pattern hi-lock-set-patterns] 2 (#$ . 14313)])
#@76 Add PATTERNS to list of interactively highlighted patterns and refontify..
(defalias 'hi-lock-set-patterns #[(patterns) "\304\211\203# \n@\211\235\204 \305\304	C\"\210\306\303	\"\210\nA\211\204 *\307 \207" [patterns pattern #1=#:--dolist-temp--97281 hi-lock-interactive-patterns nil font-lock-add-keywords add-to-list hi-lock-refontify] 4 (#$ . 14497)])
#@57 Replace file patterns list with PATTERNS and refontify.
(defalias 'hi-lock-set-file-patterns #[(patterns) "\204 	\205 \302\303\"\210	\304\303\"\210\305 \207" [hi-lock-file-patterns patterns font-lock-remove-keywords nil font-lock-add-keywords hi-lock-refontify] 3 (#$ . 14865)])
#@70 Unfontify then refontify buffer.  Used when hi-lock patterns change.
(defalias 'hi-lock-refontify #[nil "\204 \300\301!\210\302 \207" [font-lock-mode 1 font-lock-fontify-buffer] 2 (#$ . 15156) nil])
#@46 Find patterns in current buffer for hi-lock.
(defalias 'hi-lock-find-patterns #[nil "	>?\205Z \306\307\n\310Q\212\214~\210eb\210\311`\\\312#\210\313 \210\311`\314\\\312#\203D \315\316!\204D \306\317\320\217\211\203@ \321\f\")\202  *\203N \322\f!\210t\205Y \323\324\325\fG\"!*\207" [major-mode hi-lock-exclude-modes hi-lock-file-patterns-prefix target-regexp all-patterns hi-lock-file-patterns-range nil "\\<" ":" re-search-forward t beginning-of-line 100 looking-at "\\s-*end" (byte-code "\300p!\207" [read] 2) ((error (byte-code "\300\301\302\303 \"!\210\304\207" [message format "Could not read expression at %d" hi-lock-current-line nil] 4))) append hi-lock-set-file-patterns message format "Hi-lock added %d patterns." patterns hi-lock-mode] 5 (#$ . 15363) nil])
#@38 Add hi lock patterns to font-lock's.
(defalias 'hi-lock-font-lock-hook #[nil "\205 \303\304	\"\210\303\304\n\"\207" [hi-lock-mode hi-lock-file-patterns hi-lock-interactive-patterns font-lock-add-keywords nil] 3 (#$ . 16149)])
(provide 'hi-lock)
