;ELC ;;; Compiled by cyd@localhost on Mon Apr 23 22:20:46 2007 ;;; from file /home/cyd/emacs/lisp/filecache.el ;;; in Emacs version 22.0.99 ;;; 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 "`filecache.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (custom-declare-group 'file-cache nil "Find files using a pre-loaded cache." :group 'files :group 'convenience :prefix "file-cache-") #@241 *List of regular expressions used as filters by the file cache. File names which match these expressions will not be added to the cache. Note that the functions `file-cache-add-file' and `file-cache-add-file-list' do not use this variable. (custom-declare-variable 'file-cache-filter-regexps '(list "~$" "\\.o$" "\\.exe$" "\\.a$" "\\.elc$" ",v$" "\\.output$" "\\.$" "#$" "\\.class$") '(#$ . -700) :type '(repeat regexp) :group 'file-cache) #@66 *External program used by `file-cache-add-directory-using-find'. (custom-declare-variable 'file-cache-find-command '"find" '(#$ . -1146) :type 'string :group 'file-cache) #@317 *Set to t, if `file-cache-find-command' handles wildcards POSIX style. This variable is automatically set to nil or non-nil if it has the initial value `not-defined' whenever you first call the `file-cache-add-directory-using-find'. Under Windows operating system where Cygwin is available, this value should be t. (custom-declare-variable 'file-cache-find-command-posix-flag ''not-defined '(#$ . -1324) :type '(choice (const :tag "Yes" t) (const :tag "No" nil) (const :tag "Unknown" not-defined)) :group 'file-cache) #@68 *External program used by `file-cache-add-directory-using-locate'. (custom-declare-variable 'file-cache-locate-command '"locate" '(#$ . -1849) :type 'string :group 'file-cache) #@49 Message to display when there is no completion. (custom-declare-variable 'file-cache-no-match-message '" [File Cache: No match]" '(#$ . 2032) :type 'string :group 'file-cache) #@55 Message to display when there is only one completion. (custom-declare-variable 'file-cache-sole-match-message '" [File Cache: sole completion]" '(#$ . 2214) :type 'string :group 'file-cache) #@59 Message to display when there is a non-unique completion. (custom-declare-variable 'file-cache-non-unique-message '" [File Cache: complete but not unique]" '(#$ . 2411) :type 'string :group 'file-cache) #@106 If non-nil, file-cache completion should ignore case. Defaults to the value of `completion-ignore-case'. (custom-declare-variable 'file-cache-completion-ignore-case '(if (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) t completion-ignore-case) '(#$ . 2621) :type 'sexp :group 'file-cache) #@100 If non-nil, file-cache completion should ignore case. Defaults to the value of `case-fold-search'. (custom-declare-variable 'file-cache-case-fold-search '(if (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) t case-fold-search) '(#$ . 2923) :type 'sexp :group 'file-cache) #@132 Non-nil means ignore case when checking completions in the file cache. Defaults to nil on DOS and Windows, and t on other systems. (custom-declare-variable 'file-cache-ignore-case '(memq system-type (list 'ms-dos 'windows-nt 'cygwin)) '(#$ . 3207) :type 'sexp :group 'file-cache) (byte-code "\301B\302\301!\204\303\301\304\"\210\304\207" [current-load-list file-cache-multiple-directory-message default-boundp set-default nil] 3) #@58 Buffer to display completions when using the file cache. (custom-declare-variable 'file-cache-completions-buffer '"*Completions*" '(#$ . 3647) :type 'string :group 'file-cache) #@41 Buffer to hold the cache of file names. (custom-declare-variable 'file-cache-buffer '"*File Cache*" '(#$ . 3830) :type 'string :group 'file-cache) #@47 Regexp to match files in `file-cache-buffer'. (custom-declare-variable 'file-cache-buffer-default-regexp '"^.+$" '(#$ . 3983) :type 'regexp :group 'file-cache) (byte-code "\301B\302\301!\204\303\301\304\"\210\304\207" [current-load-list file-cache-last-completion default-boundp set-default nil] 3) #@54 Internal data structure to hold cache of file names. (defvar file-cache-alist nil (#$ . 4292)) #@43 Keymap for file cache completions buffer. (defvar file-cache-completions-keymap nil (#$ . 4393)) #@132 Add DIRECTORY to the file cache. If the optional REGEXP argument is non-nil, only files which match it will be added to the cache. (defalias 'file-cache-add-directory #[(directory &optional regexp) "\304!\204 \305\306\"\207\307!\310 \311\n#\312\313 \"\210\314 !*\207" [directory dir regexp dir-files file-accessible-directory-p message "Directory %s does not exist" expand-file-name directory-files t mapcar #[(file) "\303!\203 \304 \"\211\207\305\306\n\"\207" [file dir-files file-cache-filter-regexps file-directory-p delq mapcar #[(regexp) "\303 \"\205 \304 \n\"\211\207" [regexp file dir-files string-match delq] 3]] 3] file-cache-add-file-list] 4 (#$ . 4497) "DAdd files from directory: "]) #@263 Add DIRECTORY-LIST (a list of directory names) to the file cache. If the optional REGEXP argument is non-nil, only files which match it will be added to the cache. Note that the REGEXP is applied to the files in each directory, not to the directory list itself. (defalias 'file-cache-add-directory-list #[(directory-list &optional regexp) "\301\302\"\207" [directory-list mapcar #[(dir) "\302 \"\207" [dir regexp file-cache-add-directory] 3]] 3 (#$ . 5213) "XAdd files from directory list: "]) #@58 Add FILE-LIST (a list of files names) to the file cache. (defalias 'file-cache-add-file-list #[(file-list) "\301\302\"\207" [file-list mapcar file-cache-add-file] 3 (#$ . 5715) "XFile List: "]) #@29 Add FILE to the file cache. (defalias 'file-cache-add-file #[(file) "\306!\204 \307\310\"\207\311!\312!\313 \f#\211\203C A;\203*\n A\230\2064 A<\2054\n A\235?\205K \314\nC A\"\241\202K \nCB B\211+\207" [file file-name dir-name file-cache-alist file-cache-ignore-case the-entry file-exists-p message "Filecache: file %s does not exist" file-name-nondirectory file-name-directory assoc-string append] 5 (#$ . 5916) "fAdd File: "]) #@82 Use the `find' command to add files to the file cache. Find is run in DIRECTORY. (defalias 'file-cache-add-directory-using-find #[(directory) "\306!\n\307>\203 \310=\203\311\f!\312 !q\210\313 \210\314\f\315\316 !\315 \317\n\320>\2037 \2033\321\2028\322\2028\323\324&\210\325 )\207" [directory dir system-type file-cache-find-command-posix-flag file-cache-find-command file-cache-buffer expand-file-name (windows-nt cygwin) not-defined executable-command-find-posix-p get-buffer-create erase-buffer call-process nil get-buffer "-name" (windows-nt cygwin) "\\*" "'*'" "*" "-print" file-cache-add-from-file-cache-buffer] 9 (#$ . 6367) "DAdd files under directory: "]) #@113 Use the `locate' command to add files to the file cache. STRING is passed as an argument to the locate command. (defalias 'file-cache-add-directory-using-locate #[(string) "\303!q\210\304 \210\305 \306\307!\306\n%\210\310 \207" [file-cache-buffer file-cache-locate-command string get-buffer-create erase-buffer call-process nil get-buffer file-cache-add-from-file-cache-buffer] 6 (#$ . 7051) "sAdd files using locate string: "]) #@297 Adds DIR and any subdirectories to the file-cache. This function does not use any external programs If the optional REGEXP argument is non-nil, only files which match it will be added to the cache. Note that the REGEXP is applied to the files in each directory, not to the directory list itself. (defalias 'file-cache-add-directory-recursively #[(dir &optional regexp) "\302\303!\210\304\305\306 \203 \202\307\"\"\207" [dir regexp require find-lisp mapcar #[(file) "\303!\206\304\305\306\n\"\210 )\206\307!\207" [file filtered file-cache-filter-regexps file-directory-p nil mapcar #[(regexp) "\303 \"\205\n\304\211\207" [regexp file filtered string-match t] 3] file-cache-add-file] 3] find-lisp-find-files "^"] 5 (#$ . 7489) "DAdd directory: "]) #@159 Add any entries found in the file cache buffer. Each entry matches the regular expression `file-cache-buffer-default-regexp' or the optional REGEXP argument. (defalias 'file-cache-add-from-file-cache-buffer #[(&optional regexp) "q\210\305\306 \"\210eb\210\307\310 \206\fd\311#\205'\312\313\224\313\225\"\314\n!\210\202 )\207" [file-cache-buffer file-cache-filter-regexps full-filename regexp file-cache-buffer-default-regexp mapcar #[(elt) "eb\210\301!\207" [elt delete-matching-lines] 2] nil re-search-forward t buffer-substring-no-properties 0 file-cache-add-file] 4 (#$ . 8257)]) #@23 Clear the file cache. (defalias 'file-cache-clear-cache #[nil "\301\211\207" [file-cache-alist nil] 2 (#$ . 8854) nil]) #@34 Delete FILE from the file cache. (defalias 'file-cache-delete-file #[(file) "\303\304 \n# \"\211\207" [file file-cache-alist file-cache-ignore-case delq assoc-string] 5 (#$ . 8981) (list (completing-read "Delete file from cache: " file-cache-alist))]) #@57 Delete FILE-LIST (a list of files) from the file cache. (defalias 'file-cache-delete-file-list #[(file-list) "\301\302\"\207" [file-list mapcar file-cache-delete-file] 3 (#$ . 9241) "XFile List: "]) #@51 Delete files matching REGEXP from the file cache. (defalias 'file-cache-delete-file-regexp #[(regexp) "\302\303\304 \"\210\305!\210\306\307G\")\207" [delete-list file-cache-alist nil mapcar #[(elt) "\303 @\"\205 @\nB\211\207" [regexp elt delete-list string-match] 3] file-cache-delete-file-list message "Filecache: deleted %d files from file cache"] 3 (#$ . 9447) "sRegexp: "]) #@39 Delete DIRECTORY from the file cache. (defalias 'file-cache-delete-directory #[(directory) "\304!\305\306\307 \"\210\310 !\203\311\312\"\202\313\314 \"*\207" [directory result dir file-cache-alist expand-file-name 0 mapcar #[(entry) "\303 \"\205 \nT\211\207" [dir entry result file-cache-do-delete-directory] 3] zerop error "Filecache: no entries containing %s found in cache" message "Filecache: deleted %d entries"] 3 (#$ . 9838) "DDelete directory from file cache: "]) (defalias 'file-cache-do-delete-directory #[(dir entry) "A\305 !\n \235\205# G\306\232\203\307\f\"\211\202#\310\n \"\241*\207" [entry dir directory directory-list file-cache-alist file-cache-canonical-directory 1 delq delete] 4]) #@68 Delete DIRECTORY-LIST (a list of directories) from the file cache. (defalias 'file-cache-delete-directory-list #[(directory-list) "\301\302\"\207" [directory-list mapcar file-cache-delete-directory] 3 (#$ . 10567) "XDirectory List: "]) (defalias 'file-cache-directory-name #[(file) "\306 \n#A\211G\307\211 <\204\310\311\"\210\f\312=\203& \313\234\202b\f\313=\2034\310\314\"\210\202b\315\316 !\211 \235\211\203Z \fGZT\211\234\206` \313\211\234\202` \313\211\234*\205n\317\320T\f# ,\207" [file file-cache-alist file-cache-ignore-case directory-list len directory assoc-string nil error "Filecache: unknown type in file-cache-alist for key %s" 1 0 "Filecache: no directory found for key %s" file-name-directory minibuffer-contents format " [%d of %d]" num minibuffer-dir dir-list file-cache-multiple-directory-message] 5]) (defalias 'file-cache-file-name #[(file) "\302!\211P)\207" [file directory file-cache-directory-name] 3]) (defalias 'file-cache-canonical-directory #[(dir) "\302\303\304 \305\306O!\"\204 \307P\202 )\207" [dir directory char-equal 47 string-to-char -1 nil "/"] 6]) #@361 Complete a filename in the minibuffer using a preloaded cache. Filecache does two kinds of substitution: it completes on names in the cache, and, once it has found a unique name, it cycles through the directories that the name is available in. With a prefix argument, the name is considered already unique; only the second substitution (directories) is done. (defalias 'file-cache-minibuffer-complete #[(arg) "\n\306\307 !\310\f \"\311\211\311\204$\312=\203J\313\f!\211\307 \230\2037\314!\202\363\315 \210c\210\205\363\314!\202\363;\203\350\f\230\203\214\316\f #\203\214=\203\200\230\203\200\315 \210\313!c\210\311\211\202\363\314 !\210\f\211\202\363\f\317\f \"\211G\211\320V\203\301db\210\fG\311Oc\210\321\322\323C!\"!!\"\220\324\f\"\221)\202\363\313!\211\307 \230\203\325\314!\202\363\315 \210c\210\205\363\314!\202\363\311=\205\363\314#!.\207" [file-cache-completion-ignore-case completion-ignore-case file-cache-case-fold-search case-fold-search string file-cache-alist file-name-nondirectory minibuffer-contents try-completion nil t file-cache-file-name file-cache-temp-minibuffer-message delete-minibuffer-contents assoc-string all-completions 1 reverse append file-cache-completion-setup-function display-completion-list completion-string completion-list len file-cache-string arg file-cache-sole-match-message file-cache-multiple-directory-message file-cache-ignore-case last-command this-command file-cache-last-completion file-cache-non-unique-message completion-setup-hook file-cache-completions-buffer file-cache-no-match-message] 5 (#$ . 11706) "P"]) #@61 A Lisp version of `temp_minibuffer_message' from minibuf.c. (defalias 'file-cache-temp-minibuffer-message #[(msg) "d\212db\210 c\210)\305\306\307!\210d|\210 \205\310\311C\211*\207" [savemax msg inhibit-quit quit-flag unread-command-events t sit-for 2 nil 7] 2 (#$ . 13373)]) (defalias 'file-cache-completion-setup-function #[nil "q\210 \204\303\n!\304 \305\306#\210\304 \307\310#\210\311 !\207" [file-cache-completions-buffer file-cache-completions-keymap completion-list-mode-map copy-keymap define-key [mouse-2] file-cache-mouse-choose-completion " " file-cache-choose-completion use-local-map] 4]) #@52 Choose a completion in the `*Completions*' buffer. (defalias 'file-cache-choose-completion #[nil "\301\302 \210\303\304 !\210\305\306!)\207" [completion-no-auto-exit t choose-completion select-window active-minibuffer-window file-cache-minibuffer-complete nil] 2 (#$ . 13991) nil]) #@37 Choose a completion with the mouse. (defalias 'file-cache-mouse-choose-completion #[(event) "\302\303 !\210\304\305 !\210\306\307!)\207" [completion-no-auto-exit event t mouse-choose-completion select-window active-minibuffer-window file-cache-minibuffer-complete nil] 2 (#$ . 14280) "e"]) #@50 Complete the word at point, using the filecache. (defalias 'file-cache-complete #[nil "\305\211\211\211\212\306\307!\210`)\310 `\"\311\n\f\"\312\n\f\305# \313=\206J \2044\314\315\n\"\210\316 \202J\n \230\204C `|\210 c\202J\317\220\320\n\"\221,\207" [all completion pattern start file-cache-alist nil skip-syntax-backward "^\"" buffer-substring-no-properties try-completion all-completions t message "Can't find completion for \"%s\"" ding "*Completions*" display-completion-list] 4 (#$ . 14577) nil]) #@78 Output a list of files whose names (not including directories) match REGEXP. (defalias 'file-cache-files-matching-internal #[(regexp) "\302\303\304 \"\210)\207" [results file-cache-alist nil mapcar #[(cache-element) "\303 \304\234\"\205\n\203\n \304\234C\244\207 \304\234C\211\207" [regexp cache-element results string-match 0] 4]] 3 (#$ . 15098)]) #@78 Output a list of files whose names (not including directories) match REGEXP. (defalias 'file-cache-files-matching #[(regexp) "\303!\304\305\306!\211q\210\307 \210\310\311\n\312#c\210eb\210\313 !*\207" [regexp buf results file-cache-files-matching-internal nil get-buffer-create "*File Cache Files Matching*" erase-buffer mapconcat identity "\n" display-buffer] 4 (#$ . 15461) "sFind files matching regexp: "]) #@21 Debugging function. (defalias 'file-cache-debug-read-from-minibuffer #[(file) "\303\304\305 \n#\"\207" [file file-cache-alist file-cache-ignore-case message "%s" assoc-string] 6 (#$ . 15881) (list (completing-read "File Cache: " file-cache-alist))]) #@25 Display the file cache. (defalias 'file-cache-display #[nil "\302r\303!q\210\304 \210\305\306 \"\210\307!*\207" [buf file-cache-alist "*File Cache Contents*" get-buffer-create erase-buffer mapcar #[(item) "A@@\301\261\207" [item "\n"] 3] pop-to-buffer] 3 (#$ . 16138) nil]) (provide 'filecache)