aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-12-29 19:12:17 +0000
committerRichard M. Stallman2003-12-29 19:12:17 +0000
commit3750be31d39fd4f0d9efaf43c0586ef44186108f (patch)
tree2f0fae2b6686468aa278c5086e682575546c9ea1
parent55e9b10d6959a34f537caab0e76079f1c6badd32 (diff)
downloademacs-3750be31d39fd4f0d9efaf43c0586ef44186108f.tar.gz
emacs-3750be31d39fd4f0d9efaf43c0586ef44186108f.zip
(file-cache-ignore-case): New variable.
(file-cache-assoc-function): Var deleted. Use assoc-string instead.
-rw-r--r--lisp/filecache.el29
1 files changed, 15 insertions, 14 deletions
diff --git a/lisp/filecache.el b/lisp/filecache.el
index d315a3b1c8b..71b67af355f 100644
--- a/lisp/filecache.el
+++ b/lisp/filecache.el
@@ -212,13 +212,10 @@ Defaults to the value of `case-fold-search'."
212 :group 'file-cache 212 :group 'file-cache
213 ) 213 )
214 214
215(defcustom file-cache-assoc-function 215(defcustom file-cache-ignore-case
216 (if (memq system-type (list 'ms-dos 'windows-nt 'cygwin)) 216 (memq system-type (list 'ms-dos 'windows-nt 'cygwin))
217 'assoc-ignore-case 217 "Non-nil means ignore case when checking completions in the file cache.
218 'assoc) 218Defaults to nil on DOS and Windows, and t on other systems."
219 "Function to use to check completions in the file cache.
220Defaults to `assoc-ignore-case' on DOS and Windows, and `assoc' on
221other systems."
222 :type 'sexp 219 :type 'sexp
223 :group 'file-cache 220 :group 'file-cache
224 ) 221 )
@@ -301,8 +298,9 @@ in each directory, not to the directory list itself."
301 (message "File %s does not exist" file) 298 (message "File %s does not exist" file)
302 (let* ((file-name (file-name-nondirectory file)) 299 (let* ((file-name (file-name-nondirectory file))
303 (dir-name (file-name-directory file)) 300 (dir-name (file-name-directory file))
304 (the-entry (funcall file-cache-assoc-function 301 (the-entry (assoc-string
305 file-name file-cache-alist)) 302 file-name file-cache-alist
303 file-cache-ignore-case))
306 ) 304 )
307 ;; Does the entry exist already? 305 ;; Does the entry exist already?
308 (if the-entry 306 (if the-entry
@@ -402,7 +400,7 @@ or the optional REGEXP argument."
402 (interactive 400 (interactive
403 (list (completing-read "Delete file from cache: " file-cache-alist))) 401 (list (completing-read "Delete file from cache: " file-cache-alist)))
404 (setq file-cache-alist 402 (setq file-cache-alist
405 (delq (funcall file-cache-assoc-function file file-cache-alist) 403 (delq (assoc-string file file-cache-alist file-cache-ignore-case)
406 file-cache-alist))) 404 file-cache-alist)))
407 405
408(defun file-cache-delete-file-list (file-list) 406(defun file-cache-delete-file-list (file-list)
@@ -458,8 +456,9 @@ or the optional REGEXP argument."
458 456
459;; Returns the name of a directory for a file in the cache 457;; Returns the name of a directory for a file in the cache
460(defun file-cache-directory-name (file) 458(defun file-cache-directory-name (file)
461 (let* ((directory-list (cdr (funcall file-cache-assoc-function 459 (let* ((directory-list (cdr (assoc-string
462 file file-cache-alist))) 460 file file-cache-alist
461 file-cache-ignore-case)))
463 (len (length directory-list)) 462 (len (length directory-list))
464 (directory) 463 (directory)
465 (num) 464 (num)
@@ -556,7 +555,8 @@ the name is considered already unique; only the second substitution
556 ;; If we've already inserted a unique string, see if the user 555 ;; If we've already inserted a unique string, see if the user
557 ;; wants to use that one 556 ;; wants to use that one
558 (if (and (string= string completion-string) 557 (if (and (string= string completion-string)
559 (funcall file-cache-assoc-function string file-cache-alist)) 558 (assoc-string string file-cache-alist
559 file-cache-ignore-case))
560 (if (and (eq last-command this-command) 560 (if (and (eq last-command this-command)
561 (string= file-cache-last-completion completion-string)) 561 (string= file-cache-last-completion completion-string))
562 (progn 562 (progn
@@ -725,7 +725,8 @@ match REGEXP."
725 "Debugging function." 725 "Debugging function."
726 (interactive 726 (interactive
727 (list (completing-read "File Cache: " file-cache-alist))) 727 (list (completing-read "File Cache: " file-cache-alist)))
728 (message "%s" (funcall file-cache-assoc-function file file-cache-alist)) 728 (message "%s" (assoc-string file file-cache-alist
729 file-cache-ignore-case))
729 ) 730 )
730 731
731(defun file-cache-display () 732(defun file-cache-display ()