;ELC   
;;; Compiled by rms@psilocin.ai.mit.edu on Sun May 24 03:22:28 1998
;;; from file /gd/gnu/emacs/lisp/find-file.el
;;; in Emacs version 20.2.93.15
;;; with bytecomp version 2.45
;;; 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 "`find-file.el' was compiled for Emacs 19.29 or later"))

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


(custom-declare-group 'ff nil "Find a file corresponding to this one given a pattern." :prefix "ff-" :group 'find-file)
#@72 *List of functions to be called before the search for the file starts.
(custom-declare-variable 'ff-pre-find-hooks 'nil '(#$ . -727) :type 'hook :group 'ff)
#@66 *List of functions to be called before the other file is loaded.
(custom-declare-variable 'ff-pre-load-hooks 'nil '(#$ . -890) :type 'hook :group 'ff)
#@65 *List of functions to be called after the other file is loaded.
(custom-declare-variable 'ff-post-load-hooks 'nil '(#$ . -1047) :type 'hook :group 'ff)
#@71 *List of functions to be called if the other file could not be found.
(custom-declare-variable 'ff-not-found-hooks 'nil '(#$ . -1205) :type 'hook :group 'ff)
#@72 *List of functions to be called if the other file needs to be created.
(custom-declare-variable 'ff-file-created-hooks 'nil '(#$ . -1369) :type 'hook :group 'ff)
#@139 *Non-nil means ignore cases in matches (see `case-fold-search').
If you have extensions in different cases, you will want this to be nil.
(custom-declare-variable 'ff-case-fold-search 'nil '(#$ . -1538) :type 'boolean :group 'ff)
#@132 *If non-nil, find the corresponding file in another window by default.
To override this, give an argument to `ff-find-other-file'.
(custom-declare-variable 'ff-always-in-other-window 'nil '(#$ . -1775) :type 'boolean :group 'ff)
#@39 *If non-nil, ignore `#include' lines.
(custom-declare-variable 'ff-ignore-include 'nil '(#$ . -2010) :type 'boolean :group 'ff)
#@75 *If non-nil, always attempt to create the other file if it was not found.
(custom-declare-variable 'ff-always-try-to-create 't '(#$ . -2144) :type 'boolean :group 'ff)
#@58 *If non-nil, trace which directories are being searched.
(custom-declare-variable 'ff-quiet-mode 'nil '(#$ . -2318) :type 'boolean :group 'ff)
#@182 *A list of regular expressions specifying how to recognise special 
constructs such as include files etc, and an associated method for 
extracting the filename from that construct.
(defvar ff-special-constructs '(("^#\\s *\\(include\\|import\\)\\s +[<\"]\\(.*\\)[>\"]" lambda nil (setq fname (buffer-substring (match-beginning 2) (match-end 2)))) ("^with[ 	]+\\([a-zA-Z0-9_\\.]+\\)" lambda nil (setq fname (buffer-substring (match-beginning 1) (match-end 1))) (require 'ada-mode) (setq fname (concat (ada-make-filename-from-adaname fname) ada-spec-suffix)))) (#$ . -2468))
#@392 *Alist of extensions to find given the current file's extension.

This list should contain the most used extensions before the others,
since the search algorithm searches sequentially through each
directory specified in `ff-search-directories'.  If a file is not found,
a new one is created with the first matching extension (`.cc' yields `.hh').
This alist should be set by the major mode.
(custom-declare-variable 'ff-other-file-alist ''cc-other-file-alist '(#$ . -3048) :type '(choice (repeat (list regexp (choice (repeat string) function))) symbol) :group 'ff)
#@784 *List of directories to search for a specific file.

Set by default to `cc-search-directories', expanded at run-time.

This list is searched through with each extension specified in
`ff-other-file-alist' that matches this file's extension.  So the
longer the list, the longer it'll take to realise that a file
may not exist.

A typical format is 

    '("." "/usr/include" "$PROJECT/*/include")

Environment variables can be inserted between slashes (`/').
They will be replaced by their definition. If a variable does
not exist, it is replaced (silently) with an empty string.

The stars are *not* wildcards: they are searched for together with
the preceding slash.  The star represents all the subdirectories except
`..', and each of these subdirectories will be searched in turn.
(custom-declare-variable 'ff-search-directories ''cc-search-directories '(#$ . -3620) :type '(choice (repeat directory) symbol) :group 'ff)
#@63 *See the description of the `ff-search-directories' variable.
(custom-declare-variable 'cc-search-directories ''("." "/usr/include" "/usr/local/include/*") '(#$ . -4549) :type '(repeat directory) :group 'ff)
#@348 *Alist of extensions to find given the current file's extension.

This list should contain the most used extensions before the others,
since the search algorithm searches sequentially through each directory
specified in `ff-search-directories'.  If a file is not found, a new one
is created with the first matching extension (`.cc' yields `.hh').
(custom-declare-variable 'cc-other-file-alist ''(("\\.cc$" (".hh" ".h")) ("\\.hh$" (".cc" ".C")) ("\\.c$" (".h")) ("\\.h$" (".c" ".cc" ".C" ".CC" ".cxx" ".cpp")) ("\\.C$" (".H" ".hh" ".h")) ("\\.H$" (".C" ".CC")) ("\\.CC$" (".HH" ".H" ".hh" ".h")) ("\\.HH$" (".CC")) ("\\.cxx$" (".hh" ".h")) ("\\.cpp$" (".hh" ".h"))) '(#$ . -4764) :type '(repeat (list regexp (choice (repeat string) function))) :group 'ff)
#@64 *See the description for the `ff-search-directories' variable.
(custom-declare-variable 'modula2-other-file-alist ''(("\\.mi$" (".md")) ("\\.md$" (".mi"))) '(#$ . -5525) :type '(repeat (list regexp (choice (repeat string) function))) :group 'ff)
(byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\300\306!\210\300\307!\210\300\310!\210\300\311!\210\300\312!\210\300\313!\207" [make-variable-buffer-local ff-pre-find-hooks ff-pre-load-hooks ff-post-load-hooks ff-not-found-hooks ff-file-created-hooks ff-case-fold-search ff-always-in-other-window ff-ignore-include ff-quiet-mode ff-other-file-alist ff-search-directories] 2)
#@187 Find the header or source file corresponding to this file.
See also the documentation for `ff-find-other-file;.

If optional IN-OTHER-WINDOW is non-nil, find the file in another window.
(defalias 'ff-get-other-file #[(&optional in-other-window) "\303\304\n!\210	\211)\207" [ff-ignore-include ignore in-other-window t ff-find-the-other-file] 2 (#$ . 6183) "P"])
#@1777 Find the header or source file corresponding to this file.
Being on a `#include' line pulls in that file.

If optional IN-OTHER-WINDOW is non-nil, find the file in the other window.
If optional IGNORE-INCLUDE is non-nil, ignore being on `#include' lines.

Variables of interest include:

 - ff-case-fold-search
   Non-nil means ignore cases in matches (see case-fold-search).
   If you have extensions in different cases, you will want this to be nil.

 - ff-always-in-other-window 
   If non-nil, always open the other file in another window, unless an
   argument is given to ff-find-other-file.

 - ff-ignore-include 
   If non-nil, ignores #include lines.

 - ff-always-try-to-create 
   If non-nil, always attempt to create the other file if it was not found.

 - ff-quiet-mode 
   If non-nil, traces which directories are being searched.

 - ff-special-constructs 
   A list of regular expressions specifying how to recognise special 
   constructs such as include files etc, and an associated method for 
   extracting the filename from that construct.

 - ff-other-file-alist
   Alist of extensions to find given the current file's extension.

 - ff-search-directories 
   List of directories searched through with each extension specified in
   ff-other-file-alist that matches this file's extension.

 - ff-pre-find-hooks 
   List of functions to be called before the search for the file starts.

 - ff-pre-load-hooks 
   List of functions to be called before the other file is loaded.

 - ff-post-load-hooks
   List of functions to be called after the other file is loaded.

 - ff-not-found-hooks
   List of functions to be called if the other file could not be found.

 - ff-file-created-hooks
   List of functions to be called if the other file has been created.
(defalias 'ff-find-other-file #[(&optional in-other-window ignore-include) "\n\304!\210	\211)\207" [ff-ignore-include ignore ignore-include in-other-window ff-find-the-other-file] 2 (#$ . 6556) "P"])
#@242 Find the header or source file corresponding to the current file.
Being on a `#include' line pulls in that file, but see the help on
the `ff-ignore-include' variable.

If optional IN-OTHER-WINDOW is non-nil, find the file in another window.
(defalias 'ff-find-the-other-file #[(&optional in-other-window) "\306\211\211\211\211\211\211\211\211\211\211\211\211!\"#$%&'\203* \307\310!\210\311\312!\210(9\203< \313(J!\202@ \313(!\212\314y\210\315 $))\204c $\203c $\316	$\306*$\202=+9\203o +J\202q +!\317 \203} \317 \202~ \320\321\322\"\210\323\224\323\225O$\306!@'\324'@$\"#'\203\307 #\203\255 #\314Y\204\307 #\204\307 !A\211!@'\324'@$\"#\202\234 '\204\321 \325\202='A@&'A@%\306%:\204\326%!\203%\317 !&'@&CB'\306\"&@\2023#\314U\203\327\327\"\202*\330'@P\321$\"\210$\323\224\323\225O\"\"'A@@P\316	\"&*$\203H\311\327!\210\202\223\n\204\223\203U\307\331!\210,\203\215\306\211-\332\333\303\334\f\".\f\306$!-\335-!\203}\336-!\fP\202\201-\211\337*\325#\210*\202\223\311\340$\"\210\n.\207" [no-match dirs found format default-name pathname nil run-hooks ff-pre-find-hooks message "Working..." ff-list-replace-env-vars 0 ff-treat-as-special ff-get-file buffer-file-name "/none.none" string-match ".*/\\(.+\\)$" 1 ff-string-match t fboundp "" "\\(.+\\)" ff-not-found-hooks expand-file-name read-file-name "Find or create %s in: " file-directory-p file-name-as-directory ff-find-file "No file found for %s" alist stub pos fname action suffixes match ff-search-directories ff-ignore-include in-other-window ff-other-file-alist ff-always-try-to-create name default-directory] 14 (#$ . 8544)])
#@351 Find a file in the SEARCH-DIRS with the given FILENAME (or filename stub). 
If (optional) SUFFIXES is nil, search for fname, otherwise search for fname 
with each of the given suffixes. Gets the file or the buffer corresponding 
to the name of the first file found, or nil.

Arguments: (search-dirs fname-stub &optional suffix-list in-other-window)

(defalias 'ff-get-file #[(search-dirs fname-stub &optional suffix-list other-window) "\305	\n#\211\204 \306\2022 \307\310!!\203! \311\310!\f\"\210\2022 \312!\2031 \313\f\306#\210\2022 \306)\207" [search-dirs fname-stub suffix-list filename other-window ff-get-file-name nil bufferp get-file-buffer ff-switch-to-buffer file-exists-p ff-find-file] 5 (#$ . 10247)])
#@289 Find a file in the SEARCH-DIRS with the given FILENAME (or filename stub). 
If (optional) SUFFIXES is nil, search for fname, otherwise search for fname 
with each of the given suffixes. Returns the name of the first file found.

Arguments: (search-dirs fname-stub &optional suffix-list)

(defalias 'ff-get-file-name #[(search-dirs fname-stub &optional suffix-list) "\306\306\306\306\306\306\306\306\306\306 \211\203% @\202* \307\307C\203\224 \204\224 !\fP\"\204D \310\311\"\210\312\313!!\203U \314\313!!\315 \316@!\203\213 \204\213 \317\320P\"\203| \314@!A\316@!\202` A\211@\202* #\211@\204N\203N 	\203\361 \317\321	\"\204\361 \203\273 @\202\300 \307\307C\203E\204E!\fP	\322Q\"\204\337 \310\323\n\"\210\324\n!\203\350 \nA\211@\202\300 \325\224\203 	\325\224\325\225O\202\307	\326\224\326\225O\327	\330\"\306\211$%\211&@%&\2035\331$%PC\"$&A\211&@%\202$\203D\332$! #+A\211@\202\232 \203Y\310\333\"\210.\n\207" [dirs dir file rest this-suffix suffixes nil "" message "Finding buffer %s..." bufferp get-file-buffer buffer-file-name buffer-list buffer-name string-match "<[0-9]+>" "\\([^*]*\\)/\\*\\(/.*\\)*" "/" "Finding %s..." file-exists-p 2 1 ff-all-dirs-under ("..") append ff-get-file-name "%s found" filename blist buf found suffix-list fname-stub ff-quiet-mode search-dirs compl-dirs this-dir dirlist] 5 (#$ . 10976)])
#@111 Like `string-match', but set `case-fold-search' temporarily.
The value used comes from `ff-case-fold-search'.
(defalias 'ff-string-match #[(regexp string &optional start) "\n\205 \305\n\f#)\207" [ff-case-fold-search case-fold-search regexp string start string-match] 4 (#$ . 12439)])
#@71 Replace environment variables (of the form $VARIABLE) in SEARCH-LIST.
(defalias 'ff-list-replace-env-vars #[(search-list) "\303@\2033 \304\305	\"\203& 	\306\224\306\225O\307	\310\224\310\225O!	\311\224\311\225OQA	\nB@\202 \312\n!\211*\207" [search-list var list nil string-match "\\(.*\\)\\$[({]*\\([a-zA-Z0-9_]+\\)[)}]*\\(.*\\)" 1 getenv 2 3 reverse] 5 (#$ . 12733)])
#@136 Returns the file to look for if the construct was special, else nil.
The construct is defined in the variable `ff-special-constructs'.
(defalias 'ff-treat-as-special #[nil "\306	\211@\211@A\n\2031 \2041 \307\f!\203\" \203\"  \nA\211@\211@A\202 -\207" [fname ff-special-constructs list elem regexp match nil looking-at] 3 (#$ . 13121)])
#@34 Return the basename of PATHNAME.
(defalias 'ff-basename #[(string) "\301P\302\303\"\210\304\224\304\225O\211\207" [string "/" string-match ".*/\\([^/]+\\)$" 1] 3 (#$ . 13480)])
#@99 Get all the directory files under directory HERE.
Exclude all files in the optional EXCLUDE list.
(defalias 'ff-all-dirs-under #[(here &optional exclude) "\301!\205\n \302\303\304\217\207" [here file-directory-p nil (byte-code "\305\306\"\307\211\211\203) @\310	!\203\" \311	!\f\235\204\" 	\nBA\211\204 \312\n!\211+\207" [here file dirlist files exclude directory-files t nil file-directory-p ff-basename reverse] 4) ((error))] 3 (#$ . 13668)])
#@513 Call F1 or F2 on FILE, according to IN-OTHER-WINDOW.
In addition, this runs various hooks.

Either F1 or F2 receives FILE as the sole argument.
The decision of which one to call is based on IN-OTHER-WINDOW
and on the global variable `ff-always-in-other-window'.

F1 and F2 are typically `find-file' / `find-file-other-window'
or `switch-to-buffer' / `switch-to-buffer-other-window' function pairs.

If optional NEW-FILE is t, then a special hook (`ff-file-created-hooks') is 
called before `ff-post-load-hooks'.
(defalias 'ff-switch-file #[(f1 f2 file &optional in-other-window new-file) "\203 \306\300!\210	\203 \n\203 	\204 \n\203 \f!\210\202# \f!\210	\2031 \2031 \306\307!\210\2059 \306\310!\207" [ff-pre-load-hooks in-other-window ff-always-in-other-window f2 file f1 run-hooks ff-file-created-hooks ff-post-load-hooks new-file] 2 (#$ . 14132)])
#@60 Like `find-file', but may show the file in another window.
(defalias 'ff-find-file #[(file &optional in-other-window new-file) "\303\304\305	\n%\207" [file in-other-window new-file ff-switch-file find-file find-file-other-window] 6 (#$ . 15001)])
#@69 Like `switch-to-buffer', but may show the buffer in another window.
(defalias 'ff-switch-to-buffer #[(buffer-or-name &optional in-other-window) "\302\303\304	\305%\207" [buffer-or-name in-other-window ff-switch-file switch-to-buffer switch-to-buffer-other-window nil] 6 (#$ . 15255)])
(defalias 'ff-goto-click #[(event) "\302\3038:\203 \303\202 \3048)\211@)!q\210\3038:\203& \303\202' \3048)\211A@:\2039 	A@@\202< 	A@)b\207" [event position window-buffer 2 1] 4])
#@30 Visit the file you click on.
(defalias 'ff-mouse-find-other-file #[(event) "\212\301!\210\302\303!)\207" [event ff-goto-click ff-find-other-file nil] 2 (#$ . 15738) "e"])
#@30 Visit the file you click on.
(defalias 'ff-mouse-find-other-file-other-window #[(event) "\212\301!\210\302\303!)\207" [event ff-goto-click ff-find-other-file t] 2 (#$ . 15916) "e"])
(provide 'find-file)
#@100 Return t if this string is all uppercase.
Given START and/or END, checks between these characters.
(defalias 'ff-upcase-p #[(string &optional start end) "\305\211\n\204\n \306\204 \fG\nU\203 T\f\nO\307\310\"\205> \311 \211\205> 	@\306U\205> 	A@GU\205> \312*\207" [str match start end string nil 0 ff-string-match "[A-Z]+" match-data t] 3 (#$ . 16127)])
#@137 Discriminate file extensions.
Build up a new file list based possibly on part of the directory name
and the name of the file passed in.
(defalias 'ff-cc-hh-converter #[(arg) "\306\307\"\210\310\224\205 \310\224\310\225O\311\224\205 \311\224\311\225O\312\224\205& \312\224\312\225O\313\224\2051 \313\224\313\225O\314\n\315\230\203h \306\316\"\203h \311\224\311\225O\310\224\310\225O\226\317P\320P\317P\320PF)\202\272 \n\321\230\203\221 \322\f!\203\221 \203\221 \f\227P\211\323P\324P\323P\324PF)\202\272 \n\315\230\203\247 \211\317P\320PD)\202\272 \n\321\230\203\272 \211\323P\324PD)	-\207" [arg return-list extn file dire path ff-string-match "\\(.*\\)/\\([^/]+\\)/\\([^.]+\\).\\([^/]+\\)$" 1 2 3 4 nil "cc" "^\\([a-z]+\\)\\([A-Z].+\\)$" ".hh" ".h" "hh" ff-upcase-p ".cc" ".C" stub] 7 (#$ . 16502)])
#@33 Name of the function we are in.
(defvar ff-function-name nil (#$ . 17353))
#@122 Return the name of the function whose definition/declaration point is in.
Also remember that name in `ff-function-name'.
(defalias 'ff-which-function-are-we-in #[nil "\303\212\304	\303\305#\203 \306\224\306\225{\211\202$ \304\n\303\305#\205$ \306\224\306\225{\211)\207" [ff-function-name ada-procedure-start-regexp ada-package-start-regexp nil re-search-backward t 0] 4 (#$ . 17435)])
#@122 Find the function specified in `ff-function-name'.
That name was previously determined by `ff-which-function-are-we-in'.
(defalias 'ff-set-point-accordingly #[nil "\205\f eb\210\301\302\303#\207" [ff-function-name search-forward nil t] 4 (#$ . 17831)])
