# HG changeset patch # User Gerd Moellmann # Date 939309711 0 # Node ID 10d0bb886b1e781c311f1754946958ffdf60fdae # Parent 3a06267f733d5340a9b29023acf9d893f6f5f8da (file-cache-completion-ignore-case): New variable, defaulting to the value of completion-ignore-case. (file-cache-minibuffer-complete): Use it. (file-cache-files-matching, file-cache-files-matching-internal): New functions. diff -r 3a06267f733d -r 10d0bb886b1e lisp/filecache.el --- a/lisp/filecache.el Thu Oct 07 14:46:58 1999 +0000 +++ b/lisp/filecache.el Thu Oct 07 15:21:51 1999 +0000 @@ -187,6 +187,13 @@ :type 'string :group 'file-cache) +(defcustom file-cache-completion-ignore-case completion-ignore-case + "If non-nil, file-cache completion should ignore case. +Defaults to the value of `completion-ignore-case'." + :type 'sexp + :group 'file-cache + ) + (defvar file-cache-multiple-directory-message nil) ;; Internal variables @@ -468,7 +475,7 @@ (interactive "P") (let* ( - (completion-ignore-case nil) + (completion-ignore-case file-cache-completion-ignore-case) (case-fold-search nil) (string (file-name-nondirectory (buffer-string))) (completion-string (try-completion string file-cache-alist)) @@ -594,6 +601,44 @@ ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Show parts of the cache +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun file-cache-files-matching-internal (regexp) + "Output a list of files whose names (not including directories) +match REGEXP." + (let ((results)) + (mapcar + (function + (lambda(cache-element) + (and (string-match regexp + (elt cache-element 0)) + (if results + (nconc results (list (elt cache-element 0))) + (setq results (list (elt cache-element 0))))))) + file-cache-alist) + results)) + +(defun file-cache-files-matching (regexp) + "Output a list of files whose names (not including directories) +match REGEXP." + (interactive "sFind files matching regexp: ") + (let ((results + (file-cache-files-matching-internal regexp)) + buf) + (set-buffer + (setq buf (get-buffer-create + "*File Cache Files Matching*"))) + (erase-buffer) + (insert + (mapconcat + 'identity + results + "\n")) + (goto-char (point-min)) + (display-buffer buf))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Debugging functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;