;ELC ;;; Compiled by pot@pot.cnuce.cnr.it on Tue Mar 18 15:41:24 2003 ;;; from file /home/pot/gnu/emacs-pretest.new/lisp/filecache.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 "`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$") '(#$ . -755) :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" '(#$ . -1201) :type 'string :group 'file-cache) #@68 *External program used by `file-cache-add-directory-using-locate'. (custom-declare-variable 'file-cache-locate-command '"locate" '(#$ . -1378) :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]" '(#$ . 1561) :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]" '(#$ . 1743) :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]" '(#$ . 1940) :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)) t completion-ignore-case) '(#$ . 2150) :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)) t case-fold-search) '(#$ . 2444) :type 'sexp :group 'file-cache) #@139 Function to use to check completions in the file cache. Defaults to `assoc-ignore-case' on DOS and Windows, and `assoc' on other systems. (custom-declare-variable 'file-cache-assoc-function '(if (memq system-type (list 'ms-dos 'windows-nt)) 'assoc-ignore-case 'assoc) '(#$ . 2720) :type 'sexp :group 'file-cache) (byte-code "\301B\302\301!\204\f\303\303\207" [current-load-list file-cache-multiple-directory-message boundp nil] 2) #@58 Buffer to display completions when using the file cache. (custom-declare-variable 'file-cache-completions-buffer '"*Completions*" '(#$ . 3161) :type 'string :group 'file-cache) #@41 Buffer to hold the cache of file names. (custom-declare-variable 'file-cache-buffer '"*File Cache*" '(#$ . 3344) :type 'string :group 'file-cache) #@47 Regexp to match files in `file-cache-buffer'. (custom-declare-variable 'file-cache-buffer-default-regexp '"^.+$" '(#$ . 3497) :type 'regexp :group 'file-cache) (byte-code "\301B\302\301!\204\f\303\303\207" [current-load-list file-cache-last-completion boundp nil] 2) #@54 Internal data structure to hold cache of file names. (defvar file-cache-alist nil (#$ . 3774)) #@43 Keymap for file cache completions buffer. (defvar file-cache-completions-keymap nil (#$ . 3875)) #@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) "\301\302\"\207" [file-cache-filter-regexps mapcar #[(regexp) "\303 \"\205 \304 \n\"\211\207" [regexp file dir-files string-match delq] 3]] 3] file-cache-add-file-list] 4 (#$ . 3979) "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 (#$ . 4628) "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 (#$ . 5130) "XFile List: "]) #@29 Add FILE to the file cache. (defalias 'file-cache-add-file #[(file) "\306!\204 \307\310\"\207\311!\312! \f\"\211\203B A;\203)\n A\230\2063 A<\2053\n A\235?\205J \313\nC A\"\241\202J \nCB\fB\211+\207" [file file-name dir-name file-cache-assoc-function file-cache-alist the-entry file-exists-p message "File %s does not exist" file-name-nondirectory file-name-directory append] 5 (#$ . 5331) "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) "\305!\306\n!q\210\307 \210\310 \311\312\n!\311 \313\f\314=\203\315\202 \316\317&\210\320 )\207" [directory dir file-cache-buffer file-cache-find-command system-type expand-file-name get-buffer-create erase-buffer call-process nil get-buffer "-name" windows-nt "'*'" "*" "-print" file-cache-add-from-file-cache-buffer] 9 (#$ . 5759) "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 (#$ . 6280) "sAdd files using locate string: "]) #@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 (#$ . 6718)]) #@23 Clear the file cache. (defalias 'file-cache-clear-cache #[nil "\301\211\207" [file-cache-alist nil] 2 (#$ . 7315) nil]) #@34 Delete FILE from the file cache. (defalias 'file-cache-delete-file #[(file) "\303 \n\"\n\"\211\207" [file-cache-assoc-function file file-cache-alist delq] 4 (#$ . 7442) (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 (#$ . 7690) "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 "Deleted %d files from file cache"] 3 (#$ . 7896) "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 "No entries containing %s found in cache" message "Deleted %d entries"] 3 (#$ . 8276) "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 (#$ . 8983) "XDirectory List: "]) (defalias 'file-cache-directory-name #[(file) " \n\"A\211G\306\306 <\204\307\310 \"\210\f\311=\203% \312\234\202a\f\312=\2033\307\313 \"\210\202a\314\315 !\211 \235\211\203Y \fGZT\211\234\206_ \312\211\234\202_ \312\211\234*\205m\316\317T\f# ,\207" [file-cache-assoc-function file file-cache-alist directory-list len directory nil error "Unknown type in file-cache-alist for key %s" 1 0 "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\311\311\204$\312=\203K\313\f!\211\307 \230\2037\314!\202\365\315 \210\316!\210\205\365\314!\202\365;\203\352\f\230\203\215\f \"\203\215=\203\201\230\203\201\315 \210\316\313!!\210\311\211\202\365\314 !\210\f\211\202\365\f\317\f \"\211G\211\320V\203\302db\210\316\fG\311O!\210\321\322\323C!\"!!\"\220\324!\221)\202\365\313!\211\307 \230\203\326\314!\202\365\315 \210\316!\210\205\365\314!\202\365\311=\205\365\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 insert-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-assoc-function 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 (#$ . 10086) "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 (#$ . 11767)]) (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 (#$ . 12385) 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 (#$ . 12674) "e"]) #@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 (#$ . 12971)]) #@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 (#$ . 13334) "sFind files matching regexp: "]) #@21 Debugging function. (defalias 'file-cache-debug-read-from-minibuffer #[(file) "\303\304 \n\"\"\207" [file-cache-assoc-function file file-cache-alist message "%s"] 5 (#$ . 13754) (list (completing-read "File Cache: " file-cache-alist))]) (provide 'filecache)