;;; compiled by eric@geech.gnu.ai.mit.edu on Mon Mar 22 13:36:48 1993
;;; from file /gd/gnu/emacs/19.0/lisp/hideif.el
;;; emacs version 19.0.506.
;;; bytecomp version FSF 2.08
;;; optimization is on.

(defvar hide-ifdef-mode-map nil "\
Keymap used with Hide-Ifdef mode")
(defconst hide-ifdef-mode-prefix-key "" "\
Prefix key for all Hide-Ifdef mode commands.")
(defvar hide-ifdef-mode-map-before nil "\
Buffer-local variable to store a copy of the local keymap
before `hide-ifdef-mode' modifies it.")
(fset (quote define-hide-ifdef-mode-map) #[nil "l  ###############$#M" [hide-ifdef-mode-map make-sparse-keymap define-key "d" hide-ifdef-define "u" hide-ifdef-undef "D" hide-ifdef-set-define-alist "U" hide-ifdef-use-define-alist "h" hide-ifdefs "s" show-ifdefs "" hide-ifdef-block "" show-ifdef-block "" forward-ifdef "" backward-ifdef "" down-ifdef "" up-ifdef "" next-ifdef "" previous-ifdef "" hide-ifdef-toggle-read-only where-is-internal toggle-read-only nil t hide-ifdef-toggle-outside-read-only] 7])
(fset 'hif-update-mode-line #[nil " !" [set-buffer-modified-p buffer-modified-p] 2 "\
Update mode-line by setting buffer-modified to itself."])
(defvar hide-ifdef-mode nil "\
non-nil when hide-ifdef-mode is activated.")
(defvar hide-ifdef-hiding nil "\
non-nil when text may be hidden.")
(byte-code "\n\" \nB\n\" \nB" [assq hide-ifdef-hiding minor-mode-alist (hide-ifdef-hiding " Hiding") hide-ifdef-mode (hide-ifdef-mode " Ifdef")] 3)
(fset 'hide-ifdef-mode #[(arg) "!\n 	? \n!V 	v \"\"\"!!!!!!  !!!\" !o  r  !~  !!" [make-local-variable hide-ifdef-mode arg prefix-numeric-value 0 hif-update-mode-line modify-syntax-entry 95 "w" 38 "." 124 hide-ifdef-env default-value hide-ifdef-hiding hif-outside-read-only buffer-read-only hide-ifdef-mode-map-before current-local-map use-local-map copy-keymap local-unset-key hide-ifdef-mode-prefix-key local-set-key hide-ifdef-mode-map define-hide-ifdef-mode-map run-hooks hide-ifdef-mode-hook hide-ifdef-initially hide-ifdefs show-ifdefs message "Enter hide-ifdef-mode." "Exit hide-ifdef-mode."] 3 "\
Toggle Hide-Ifdef mode.  This is a minor mode, albeit a large one.
With ARG, turn Hide-Ifdef mode on iff arg is positive.
In Hide-Ifdef mode, code within #ifdef constructs that the C preprocessor
would eliminate may be hidden from view.  Several variables affect
how the hiding is done:

hide-ifdef-env
	An association list of defined and undefined symbols for the
	current buffer.  Initially, the global value of `hide-ifdef-env'
	is used.

hide-ifdef-define-alist
	An association list of defined symbol lists.  
        Use `hide-ifdef-set-define-alist' to save the current `hide-ifdef-env'
        and `hide-ifdef-use-define-alist' to set the current `hide-ifdef-env'
        from one of the lists in `hide-ifdef-define-alist'.

hide-ifdef-lines
	Set to non-nil to not show #if, #ifdef, #ifndef, #else, and
	#endif lines when hiding.

hide-ifdef-initially
	Indicates whether `hide-ifdefs' should be called when Hide-Ifdef mode
	is activated.

hide-ifdef-read-only
	Set to non-nil if you want to make buffers read only while hiding.
	After `show-ifdefs', read-only status is restored to previous value.

\\{hide-ifdef-mode-map}" "P"])
(fset 'hif-outline-flag-region #[(from to flag) " U Ȃ %*" [buffer-modified-p modp ((set-buffer-modified-p modp)) subst-char-in-region from to flag 10 13 t] 6 "\
Hides or shows lines from FROM to TO, according to FLAG.  If FLAG
is \\n (newline character) then text is shown, while if FLAG is \\^M
(control-M) the text is hidden."])
(fset 'hif-show-all #[nil "ed#" [hif-outline-flag-region 10] 4 "\
Show all of the text in the current buffer." nil])
(fset 'hide-ifdef-region #[(start end) "	\n#" [hif-outline-flag-region start end 13] 4 "\
START is the start of a #if or #else form.  END is the ending part.
Everything including these lines is made invisible."])
(fset 'hif-show-ifdef-region #[(start end) "	\n#" [hif-outline-flag-region start end 10] 4 "\
Everything between START and END is made visible."])
(defvar hide-ifdef-evaluator (quote eval) "\
The evaluator is given a canonical form and returns T if text under
that form should be displayed.")
(defvar hif-undefined-symbol nil "\
...is by default considered to be false.")
(defvar hide-ifdef-env nil "\
An alist of defined symbols and their values.")
(fset 'hif-set-var #[(var value) "	B\nB" [var value hide-ifdef-env] 2 "\
Prepend (var value) pair to hide-ifdef-env."])
(byte-code "MMPP	PP	%" [hif-lookup #[(var) "	\n\" A )" [assoc var hide-ifdef-env val hif-undefined-symbol] 4] hif-defined #[(var) "	!" [hif-lookup var] 2] "\\(^\\|\\)[ 	]*#[ 	]*" hif-cpp-prefix "ifndef" hif-ifndef-regexp "if\\(n?def\\)?[ 	]+" hif-ifx-regexp "else" hif-else-regexp "endif" hif-endif-regexp concat "\\|" hif-ifx-else-endif-regexp] 6)
(fset 'hif-infix-to-prefix #[(token-list) "GU @DD!" [token-list 1 hif-lookup quote hif-parse-if-exp] 3 "\
Convert list of tokens in infix into prefix list"])
(byte-code "ć" ["^\\(!\\|&&\\|||\\|[()]\\|\\w+\\)" hif-token-regexp "\\*/" hif-end-of-comment nil] 1)
(fset 'hif-tokenize #[(expr-string) "\nGW \n#\" !\nSI \n#P !\nSI\n#C \n#!\nSI \n# \n!O!\nSI\"w т \" ӂ \" Ղ \" ׂ \" ق \" ۂ !B) \n\" !+" [nil 0 expr-string expr-length expr-start token-list string-match "^[ 	]+" match-end 10 "^/\\*" hif-end-of-comment "$" hif-token-regexp token string-equal "||" or "&&" and "!" not "defined" hif-defined "(" lparen ")" rparen intern error "Bad #if expression: %s" nreverse] 4 "\
Separate string into a list of tokens"])
(fset 'hif-parse-if-exp #[(token-list) "  \n \n\"" [hif-nexttoken hif-expr token error "Error: unexpected token: %s"] 4 "\
Parse the TOKEN-LIST.  Return translated list in prefix form."])
(fset 'hif-nexttoken #[nil "@A	" [token-list token] 1 "\
Pop the next token from token-list into the let variable \"token\"."])
(fset 'hif-expr #[nil " \n=  	 E 	)" [hif-term result token or hif-nexttoken] 3 "\
Parse and expression of the form
       expr : term | expr '||' term."])
(fset 'hif-term #[nil " \n=  	 E 	)" [hif-factor result token and hif-nexttoken] 3 "\
Parse a term of the form
       term : factor | term '&&' factor."])
(fset 'hif-factor #[nil "=   D=/   =( \"-  )=k  =B ! >S \" =` ! )DD>x ! )DD" [token not hif-nexttoken hif-factor lparen hif-expr result rparen error "Bad token in parenthesized expression: %s" hif-defined "Error: expected \"(\" after \"defined\"" ident (or and not hif-defined lparen rparen) "Error: unexpected token: %s" "Error: expected \")\" after identifier" quote (or and) "Error: missing identifier" hif-lookup] 4 "\
Parse a factor of the form
       factor : '!' factor | '(' expr ')' | 'defined(' id ')' | id."])
(fset 'hif-canonicalize #[nil "	!!`!`\"!!\n& D( ," [looking-at hif-ifndef-regexp negate re-search-forward hif-ifx-regexp buffer-substring skip-chars-forward "^\n" expr-string hif-infix-to-prefix hif-tokenize expr not] 4 "\
When at beginning of #ifX, returns a canonical (evaluatable)
       form for the expression."])
(fset 'hif-find-any-ifX #[nil "	d#!" [re-search-forward hif-ifx-regexp t forward-line 0] 4 "\
Position at beginning of next #if, #ifdef, or #ifndef, including one on
this line."])
(fset 'hif-find-next-relevant #[nil " \nd# !Ƈ" [end-of-line re-search-forward hif-ifx-else-endif-regexp t forward-line 0 nil] 4 "\
Position at beginning of next #ifdef, #ifndef, #else, #endif,
NOT including one on this line."])
(fset 'hif-find-previous-relevant #[nil "!e# !Ň" [forward-line 0 re-search-backward hif-ifx-else-endif-regexp t nil] 4 "\
Position at beginning of previous #ifdef, #ifndef, #else, #endif,
NOT including one on this line."])
(byte-code "MMM" [hif-looking-at-ifX #[nil "	!" [looking-at hif-ifx-regexp] 2] hif-looking-at-endif #[nil "	!" [looking-at hif-endif-regexp] 2] hif-looking-at-else #[nil "	!" [looking-at hif-else-regexp] 2]] 2)
(fset 'hif-ifdef-to-endif #[nil "          Ň!" [hif-find-next-relevant hif-looking-at-ifX hif-ifdef-to-endif hif-looking-at-else hif-looking-at-endif done error "Missmatched #ifdef #endif pair"] 2 "\
If positioned at #ifX or #else form, skip to corresponding #endif."])
(fset 'hif-endif-to-ifdef #[nil "` `U !)     #   * ȇɇ" [start hif-find-previous-relevant error "Missmatched #ifdef #endif pair" hif-looking-at-endif hif-endif-to-ifdef hif-looking-at-else hif-looking-at-ifX done t] 2 "\
If positioned at #endif form, skip backward to corresponding #ifX."])
(fset 'forward-ifdef #[(&optional arg) " W [!W: [` $   /  6 b!) " [arg 1 0 backward-ifdef start hif-looking-at-ifX hif-find-next-relevant hif-ifdef-to-endif error "No following #ifdef"] 2 "\
Move point to beginning of line of the next ifdef-endif.
With argument, do this that many times." "p"])
(fset 'backward-ifdef #[(&optional arg) " W [!W> S!` (   3  : b!) " [arg 1 0 forward-ifdef forward-line start hif-looking-at-endif hif-find-previous-relevant hif-endif-to-ifdef error "No previous #ifdef"] 2 "\
Move point to beginning of the previous ifdef-endif.
With argument, do this that many times." "p"])
(fset 'down-ifdef #[nil "`    ? b!)" [start hif-find-next-relevant hif-looking-at-ifX hif-looking-at-else error "No following #ifdef"] 2 "\
Move point to beginning of nested ifdef or else-part." nil])
(fset 'up-ifdef #[nil "!`      \n`U !)" [forward-line 0 start hif-looking-at-endif hif-find-previous-relevant hif-endif-to-ifdef error "No previous #ifdef"] 2 "\
Move point to beginning of enclosing ifdef or else-part." nil])
(fset 'next-ifdef #[(&optional arg) " W [!W, S l !! " [arg 1 0 previous-ifdef hif-find-next-relevant forward-line error "No following #ifdefs, #elses, or #endifs"] 2 "\
Move to the beginning of the next #ifX, #else, or #endif.
With argument, do this that many times." "p"])
(fset 'previous-ifdef #[(&optional arg) " W [!W- S` `U) !) " [arg 1 0 next-ifdef start hif-find-previous-relevant error "No previous #ifdefs, #elses, or #endifs"] 2 "\
Move to the beginning of the previous #ifX, #else, or #endif.
With argument, do this that many times." "p"])
(byte-code "MMMMM" [hif-make-range #[(else-p start end &optional else) "	\nF" [else-p start else end] 4] hif-range-else-p #[(range) "	\"" [elt range 0] 3] hif-range-start #[(range) "	\"" [elt range 1] 3] hif-range-else #[(range) "	\"" [elt range 2] 3] hif-range-end #[(range) "	\"" [elt range 3] 3]] 2)
(fset 'hif-find-range #[nil "!`       + `- `M   B   4  K !`$-" [forward-line 0 nil end else else-p start hif-find-next-relevant hif-looking-at-ifX hif-ifdef-to-endif hif-looking-at-else t error "Found two elses in a row?  Broken!" hif-make-range] 5 "\
Returns a Range structure describing the current #if region.
Point is left unchanged."])
(fset 'hif-hide-line #[(point) " 	b Ď!`U? `S`\"+" [hide-ifdef-lines point buffer-modified-p modp ((set-buffer-modified-p modp)) forward-line 0 1 hide-ifdef-region] 3 "\
Hide the line containing point.  Does nothing if `hide-ifdef-lines' is nil."])
(fset 'hif-recurse-on #[(start end) "b `\" *" [start end-of-line narrow-to-region end hide-ifdef-guts] 3 "\
Call `hide-ifdef-guts' after narrowing to end of START line and END line."])
(fset 'hif-possibly-hide #[nil "  \n!!!A \n!5 \n!!\n!\n!S\"\n!\n!\"k \n!\n!\"k \n!c \n!!\n!\n!S\"\n!\n!\"k `\n!S\"\n!!\n!b *" [hif-canonicalize hif-find-range range test hif-hide-line hif-range-end hide-ifdef-evaluator hif-range-else-p hif-range-else hide-ifdef-region hif-recurse-on hif-range-start end-of-line] 4 "\
Called at #ifX expression, this hides those parts that should be
hidden, according to judgement of `hide-ifdef-evaluator'."])
(fset 'hide-ifdef-guts #[nil "eb    )" [hif-find-any-ifX hif-possibly-hide] 1 "\
Does the work of `hide-ifdefs', except for the work that's pointless
to redo on a recursive entry."])
(defvar hide-ifdef-initially nil "\
*Non-nil if `hide-ifdefs' should be called when Hide-Ifdef mode
is first activated.")
(defvar hide-ifdef-hiding nil "\
Non-nil if text might be hidden.")
(defvar hide-ifdef-read-only nil "\
*Set to non-nil if you want buffer to be read-only while hiding text.")
(defvar hif-outside-read-only nil "\
Internal variable.  Saves the value of `buffer-read-only' while hiding.")
(defvar hide-ifdef-lines nil "\
*Set to t if you don't want to see the #ifX, #else, and #endif lines.")
(fset 'hide-ifdef-toggle-read-only #[nil "? Â \"   " [hide-ifdef-read-only message "Hide-Read-Only %s" "ON" "OFF" hide-ifdef-hiding hif-outside-read-only buffer-read-only hif-update-mode-line] 3 "\
Toggle hide-ifdef-read-only." nil])
(fset 'hide-ifdef-toggle-outside-read-only #[nil "? Â \"   " [hif-outside-read-only message "Read only %s" "ON" "OFF" hide-ifdef-hiding hide-ifdef-read-only buffer-read-only hif-update-mode-line] 3 "\
Replacement for `toggle-read-only' within Hide Ifdef mode." nil])
(fset 'hide-ifdef-define #[(var) "	\"  " [hif-set-var var t hide-ifdef-hiding hide-ifdefs] 3 "\
Define a VAR so that #ifdef VAR would be included." "SDefine what? "])
(fset 'hide-ifdef-undef #[(var) "	\"  " [hif-set-var var nil hide-ifdef-hiding hide-ifdefs] 3 "\
Undefine a VAR so that #ifdef VAR would not be included." "SUndefine what? "])
(fset 'hide-ifdefs #[nil "!\n !    	 - 0  !" [message "Hiding..." hide-ifdef-mode 1 hide-ifdef-hiding show-ifdefs buffer-read-only toggle-read-only t selective-display hide-ifdef-guts hide-ifdef-read-only hif-outside-read-only "Hiding done"] 2 "\
Hide the contents of some #ifdefs.  
Assume that defined symbols have been added to `hide-ifdef-env'.  
The text hidden is the text that would not be included by the C
preprocessor if it were given the file with those symbols defined.

Turn off hiding by calling `show-ifdef'." nil])
(fset 'show-ifdefs #[nil "     " [buffer-read-only toggle-read-only nil selective-display hif-show-all hif-outside-read-only hide-ifdef-hiding] 2 "\
Cancel the effects of `hide-ifdef'.  The contents of all #ifdefs is shown." nil])
(fset 'hif-find-ifdef-block #[nil "!     ` `S)! +   9   + 	`S^*" [nil max-bottom forward-line 0 hif-looking-at-else hif-looking-at-ifX up-ifdef top hif-ifdef-to-endif hif-looking-at-endif hif-find-next-relevant bottom] 2 "\
Utilitiy for hide and show `ifdef-block'.
Set top and bottom of ifdef block."])
(fset 'hide-ifdef-block #[nil " !\n  Ɖ \"1 !T!*? A  " [hide-ifdef-mode 1 buffer-read-only toggle-read-only t selective-display nil bottom top hif-find-ifdef-block hide-ifdef-region hide-ifdef-lines hif-hide-line hide-ifdef-hiding hide-ifdef-read-only hif-outside-read-only] 3 "\
Hide the ifdef block (true or false part) enclosing or before the cursor." nil])
(fset 'show-ifdef-block #[nil "	   !`S `\")1 ȉ	\n \nS	\"*	7  )" [buffer-read-only old-read-only toggle-read-only hide-ifdef-lines forward-line 0 hif-show-ifdef-region end-of-line nil bottom top hif-find-ifdef-block] 4 "\
Show the ifdef block (true or false part) enclosing or before the cursor." nil])
(defvar hide-ifdef-define-alist nil "\
A global assoc list of pre-defined symbol lists")
(fset 'hif-compress-define-list #[(env) "\n\" @ @BA *" [mapcar #[(arg) "	@!	 	@" [hif-lookup arg] 2] env nil new-defs defs] 4 "\
Compress the define list ENV into a list of defined symbols only."])
(fset 'hide-ifdef-set-define-alist #[(name) "\n!BB" [name hif-compress-define-list hide-ifdef-env hide-ifdef-define-alist] 3 "\
Set the association for NAME to `hide-ifdef-env'." "SSet define list: "])
(fset 'hide-ifdef-use-define-alist #[(name) "	\n\" A\" 	\"	  )" [assoc name hide-ifdef-define-alist define-list mapcar #[(arg) "B" [arg t] 2] hide-ifdef-env error "No define list for %s" hide-ifdef-hiding hide-ifdefs] 4 "\
Set `hide-ifdef-env' to the define list specified by NAME." "SUse define list: "])
