Function: fast-lock-cache-directory
fast-lock-cache-directory is a byte-compiled function defined in
fast-lock.el.gz.
Signature
(fast-lock-cache-directory DIRECTORY CREATE)
Documentation
Return usable directory based on DIRECTORY.
Returns nil if the directory does not exist, or, if CREATE non-nil, cannot be
created. DIRECTORY may be a string or a cons pair of the form (REGEXP . DIR).
See fast-lock-cache-directories.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/fast-lock.el.gz
(defun fast-lock-cache-directory (directory create)
"Return usable directory based on DIRECTORY.
Returns nil if the directory does not exist, or, if CREATE non-nil, cannot be
created. DIRECTORY may be a string or a cons pair of the form (REGEXP . DIR).
See `fast-lock-cache-directories'."
(let ((dir
(cond ((not buffer-file-name)
;; Should never be nil, but `crypt++' screws it up.
nil)
((stringp directory)
;; Just a directory.
directory)
(t
;; A directory if the file name matches the regexp.
(let ((bufile (expand-file-name buffer-file-truename))
(case-fold-search nil))
(when (save-match-data (string-match (car directory) bufile))
(cdr directory)))))))
(cond ((not dir)
nil)
((file-accessible-directory-p dir)
dir)
(create
(condition-case nil
(progn (make-directory dir t) dir)
(error nil))))))