;ELC   
;;; Compiled by rms@psilocin.ai.mit.edu on Sat Jun 13 00:42:09 1998
;;; from file /gd/gnu/emacs/lisp/generic.el
;;; in Emacs version 20.2.95.2
;;; with bytecomp version 2.46
;;; 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 "`generic.el' was compiled for Emacs 19.29 or later"))

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


(byte-code "\306\307\300!\204	 \310\300	B\311\300\312\313#\210\300!\210\306\307\302!\204 \314\302	B\311\302\312\315#\210\302!\210\306\307\303!\2045 \310\303	B\311\303\312\316#\210\303!\210\306\307\304!\204K \310\304	B\311\304\312\317#\210\304!\210\306\307\305!\204a \310\305	B\311\305\312\320#\210\305!\210\306\307\321!\204x \310\321	B\311\321\312\322#\210\321!\210\306\307\323!\204\217 \310\323	B\311\323\312\324#\210\323!\207" [generic-font-lock-defaults current-load-list generic-mode-name generic-comment-list generic-keywords-list generic-font-lock-expressions make-variable-buffer-local boundp nil put variable-documentation "Global defaults for font-lock in a generic mode." default-generic-mode "The name of the generic mode. \nThis is the car of one of the items in `generic-mode-alist'. \nThis variable is buffer-local." "List of comment characters for a generic mode." "List of keywords for a generic mode." "List of font-lock expressions for a generic mode." generic-mode-function-list "List of customization functions to call for a generic mode." generic-mode-syntax-table "Syntax table for use in a generic mode."] 5)
#@250 An association list for generic-mode. 
Each entry in the list looks like this: 

 NAME COMMENT-LIST KEYWORD-LIST FONT-LOCK-LIST AUTO-MODE-LIST FUNCTION-LIST.

Do not add entries to this list directly; use `define-generic-mode' 
instead (which see).
(defvar generic-mode-alist nil (#$ . 1752))
(custom-declare-group 'generic nil "Define simple major modes with comment and font-lock support." :prefix "generic-" :group 'extensions)
#@160 *If non-nil, add a hook to enter default-generic-mode automatically
if the first few lines of a file in fundamental mode start with a hash 
comment character.
(custom-declare-variable 'generic-use-find-file-hook 't '(#$ . -2190) :group 'generic :type 'boolean)
#@179 *Number of lines that `generic-mode-find-file-hook' looks at 
when deciding whether to enter generic-mode automatically. 
This variable should be set to a small positive number.
(custom-declare-variable 'generic-lines-to-scan '3 '(#$ . -2458) :group 'generic :type 'integer)
#@152 *Regular expression used by `generic-mode-find-file-hook'
to determine if files in fundamental mode should be put into
`default-generic-mode' instead.
(custom-declare-variable 'generic-find-file-regexp '"#.*\n\\(.*\n\\)?" '(#$ . -2740) :group 'generic :type 'regexp)
(defalias 'generic-read-type #[nil "\301\302\303\304\"\305\306$\207" [generic-mode-alist completing-read "Generic Type: " mapcar #[(elt) "\301@!C\207" [elt symbol-name] 2] nil t] 5])
(put 'generic-read-type 'byte-optimizer 'byte-compile-inline-expand)
(defalias 'generic-mode-sanity-check #[(name comment-list keyword-list font-lock-list auto-mode-list function-list &optional description) "9\204\f \306\307\310!\"\210\311\312	\n\f\257\"\210\f?\206  \f;?\205' \306\313!\207" [name comment-list keyword-list font-lock-list auto-mode-list function-list error "%s is not a symbol" princ mapcar #[(elt) "<?\205\f \301\302\303!\"\207" [elt error "%s is not a list" princ] 4] "Description must be a string or nil" description] 7])
(put 'generic-mode-sanity-check 'byte-optimizer 'byte-compile-inline-expand)
#@1248 Create a new generic mode with NAME.
NAME should be a symbol; its string representation is used as the function 
name. If DESCRIPTION is provided, it is used as the docstring for the new 
function.

COMMENT-LIST is a list, whose entries are either a single character, 
a one or two character string or a cons pair. If the entry is a character 
or a one-character string, it is added to the mode's syntax table with
comment-start syntax. If the entry is a cons pair, the elements of the
pair are considered to be comment-start and comment-end respectively. 
Note that Emacs has limitations regarding comment characters.

KEYWORD-LIST is a list of keywords to highlight with `font-lock-keyword-face'.
Each keyword should be a string.

FONT-LOCK-LIST is a list of additional expressions to highlight. Each entry
in the list should have the same form as an entry in `font-lock-defaults-alist'

AUTO-MODE-LIST is a list of regular expressions to add to auto-mode-alist.
These regexps are added to auto-mode-alist as soon as `define-generic-mode' 
is called; any old regexps with the same name are removed.

FUNCTION-LIST is a list of functions to call to do some additional setup.

See the file generic-x.el for some examples of `define-generic-mode'.
(defalias 'define-generic-mode #[(name comment-list keyword-list font-lock-list auto-mode-list function-list &optional description) "	\n\f\2119\204 \306\307\310!\"\210\311\312	\n\f\257\"\210\2036 ;\2046 \306\313!\210.\314\236\"\315	\n\f\257C\"\316\f\317#\210\320\"\207" [name comment-list keyword-list font-lock-list auto-mode-list function-list error "%s is not a symbol" princ mapcar #[(elt) "<?\205\f \301\302\303!\"\207" [elt error "%s is not a list" princ] 4] "Description must be a string or nil" delq append generic-add-to-auto-mode t generic-create-generic-function description generic-mode-alist] 8 (#$ . 3828)])
#@187 Add the entries for mode to `auto-mode-alist'. 
If remove-old is non-nil, removes old entries first. If prepend is
non-nil, prepends entries to auto-mode-alist; otherwise, appends them.
(defalias 'generic-add-to-auto-mode #[(mode auto-mode-list &optional remove-old prepend) "<\204\f \306\307\310!\"\210\311\312	!!\203* \313\314\n\"\211\203) \315\f\"\202 )\316\317\")\207" [auto-mode-list mode new-mode remove-old auto-mode-entry auto-mode-alist error "%s is not a list" princ intern symbol-name nil rassq delq mapcar #[(entry) "\303	\n#\207" [new-mode entry prepend generic-add-auto-mode-entry] 4]] 4 (#$ . 5748)])
#@111 Add a new entry to the end of auto-mode-alist.
If prepend is non-nil, add the entry to the front of the list.
(defalias 'generic-add-auto-mode-entry #[(name entry &optional prepend) "	BC\203 \305\n\f\"\202 \305\f\n\"\211)\207" [entry name new-entry prepend auto-mode-alist append] 3 (#$ . 6383)])
#@100 Create a generic mode function with NAME.
If DESCRIPTION is provided, it is used as the docstring.
(defalias 'generic-create-generic-function #[(name &optional description) "\303!\304	!\305\306\n\206 \307	P\310C\311\312DD\257M)\207" [name symname description symbol-name intern lambda nil "Generic mode for type " interactive generic-mode-with-type quote] 8 (#$ . 6693)])
#@32 Go into the generic-mode MODE.
(defalias 'generic-mode-with-type #[(&optional mode) "\206 	\306\n\"\211\204 \307\310\311	!\"\210\312 \210\n\fA@\313\f8\314\f8\315\f8\n\316\n!\317!\210\320\321\"\210\322\323!\210\324\320D\205W \325\326\"*\207" [mode generic-mode-name type generic-mode-alist generic-mode-list generic-comment-list assoc error "Can't find generic-mode information for type %s" princ kill-all-local-variables 2 3 5 symbol-name generic-mode-set-comments nil generic-mode-set-font-lock make-local-variable font-lock-defaults generic-font-lock-defaults mapcar funcall generic-keywords-list generic-font-lock-expressions generic-mode-function-list major-mode mode-name] 5 (#$ . 7076)])
#@284 A mode to do basic comment and font-lock functionality 
for files which are too small to warrant their own mode, but have
comment characters, keywords, and the like.

To define a generic-mode, use the function `define-generic-mode'.
Some generic modes are defined in `generic-x.el'.
(defalias 'generic-mode #[(type) "\301\302!!\207" [type generic-mode-with-type intern] 3 (#$ . 7808) (list (generic-read-type))])
#@48 Set up comment functionality for generic mode.
(defalias 'generic-mode-set-comments #[(comment-list) "\205 \302 \303\304!\210\303\305!\210\303\306!\210\307\310\"\210\311	!)\207" [comment-list generic-mode-syntax-table make-syntax-table make-local-variable comment-start comment-start-skip comment-end mapcar generic-mode-set-a-comment set-syntax-table] 3 (#$ . 8228)])
(defalias 'generic-mode-set-a-comment #[(comment) "\301!\2035 ;\2031 G\302=\203 \303\304!!\210\2025 G\305=\203) \306!\210\2025 \307\310\"\210\2025 \303!\210:\205= \311!\207" [comment char-or-string-p 1 generic-mode-set-comment-char string-to-char 2 generic-mode-set-comment-string error "Character string %s must be one or two characters long" generic-mode-set-comment-pair] 3])
#@66 Set the given character as a comment character for generic mode.
(defalias 'generic-mode-set-comment-char #[(comment-char) "\205 \305\306!\211\307P\310\311\f#\210\310\312\313\f#\207" [comment-char comment-end comment-start comment-start-skip generic-mode-syntax-table "" char-to-string "+ *" modify-syntax-entry "<" 10 ">"] 5 (#$ . 8997)])
#@60 Set the given string as a comment string for generic mode.
(defalias 'generic-mode-set-comment-string #[(comment-string) "\205> \306\211\307P\310\234\311\234\312\f\"\203) \313\314#\210\313\315\316#\210\313\317#\210\313\f\320#\210\313\315\321#*\207" [comment-string comment-end comment-start comment-start-skip second first "" " *" 0 1 char-equal modify-syntax-entry "<12b" 10 ">b" "<1" "<2" ">" generic-mode-syntax-table] 5 (#$ . 9350)])
#@73 Set the given comment pair as a comment start and end for generic mode.
(defalias 'generic-mode-set-comment-pair #[(comment-pair) "@A	\n\n\306P\n;\203 	;\204 \307\310!\210\nG\311\232\203* 	G\311\232\204. \307\312!\210\n\313\234\n\314\234	\313\234	\314\234\315\316#\210\315\317#\210\315\320\321\"\203c \322\202q \321\"\203p \323\202q \324P#\210\315\320\321\"\203\207 \325\202\225 \321\"\203\224 \326\202\225 \327P#.\207" [comment-pair generic-comment-end generic-comment-start comment-end comment-start comment-start-skip " *" error "Elements of cons pair must be strings" 2 "Start and end must be exactly two characters long" 0 1 modify-syntax-entry ". 1" ". 2" "." char-equal " 13" " 23" " 3" " 14" " 24" " 4" fourth third second first generic-mode-syntax-table] 6 (#$ . 9816)])
#@50 Set up font-lock functionality for generic mode.
(defalias 'generic-mode-set-font-lock #[(keywords font-lock-expressions) "\305	\203 \306\307	!\310\n\311Q\312\313E)C\"\203  \306\"\204( 	\205+ \211)\207" [generic-font-lock-expressions keywords regexp font-lock-expressions generic-font-lock-defaults nil append regexp-opt "\\<\\(" "\\)\\>" 1 font-lock-keyword-face] 4 (#$ . 10652)])
(defalias 'generic-bracket-support #[nil "\302\303\211\207" [imenu-generic-expression imenu-case-fold-search ((nil "^\\[\\(.*\\)\\]" 1)) t] 2])
(byte-code "\300\301\302C\303\211\211\211&\207" [define-generic-mode default-generic-mode 35 nil] 7)
#@308 Hook to enter default-generic-mode automatically 
if the first few lines of a file in fundamental-mode start with a hash 
comment character. This hook will be installed if the variable 
`generic-use-find-file-hook' is non-nil. The variable `generic-lines-to-scan'
determines the number of lines to look at.
(defalias 'generic-mode-find-file-hook #[nil "\305=\205: \306	V\204 \307	W\203 \310\311\312\"\210\313\314\n	W\203, \fP\nT\211\202 \212eb\210\315!\2059 \316\317!+\207" [major-mode generic-lines-to-scan count comment-regexp generic-find-file-regexp fundamental-mode 1 50 error "Variable `generic-lines-to-scan' should be set to a small" " positive number" "" 0 looking-at generic-mode-with-type default-generic-mode] 4 (#$ . 11301)])
#@166 Hook to enter default-generic-mode automatically 
if the first few lines of a file in fundamental-mode look like an INI file.
This hook is NOT installed by default.
(defalias 'generic-mode-ini-file-find-file-hook #[nil "\301=\205 \212eb\210\302\303!\205 \304\305!)\207" [major-mode fundamental-mode looking-at "^\\s-*\\[.*\\]" generic-mode-with-type ini-generic-mode] 2 (#$ . 12057)])
(byte-code "\203	 \301\302\303\"\210\301\207" [generic-use-find-file-hook add-hook find-file-hooks generic-mode-find-file-hook] 3)
#@99 Return a regular expression matching the specified keywords.
The regexp is highlighted with FACE.
(defalias 'generic-make-keywords-list #[(keywords-list face &optional prefix suffix) "<\204	 \304\305!\210	\206 \306\307\310\311\"\312\n\206 \306\260\313E\207" [keywords-list prefix suffix face error "Keywords argument must be a list of strings" "" "\\<\\(" regexp-opt t "\\)\\>" 1] 5 (#$ . 12583)])
(provide 'generic)
