diff options
author | Gerd Moellmann <gerd@gnu.org> | 1999-10-07 15:21:51 +0000 |
---|---|---|
committer | Gerd Moellmann <gerd@gnu.org> | 1999-10-07 15:21:51 +0000 |
commit | b047c9b767c105721da417a9735e6cf185783a05 (patch) | |
tree | a88b5388579a1b20578402cd20053d399cfa008b /lisp/filecache.el | |
parent | 00ce37149123aaf09333fc2b104bf1cdb7f5d742 (diff) | |
download | emacs-b047c9b767c105721da417a9735e6cf185783a05.tar.gz |
(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.
Diffstat (limited to 'lisp/filecache.el')
-rw-r--r-- | lisp/filecache.el | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/lisp/filecache.el b/lisp/filecache.el index a689e994ae1..d6aa35366b2 100644 --- a/lisp/filecache.el +++ b/lisp/filecache.el @@ -187,6 +187,13 @@ do not use this variable." :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 @@ the name is considered already unique; only the second substitution (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 @@ the name is considered already unique; only the second substitution ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; 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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |