Function: fast-lock-cache-name
fast-lock-cache-name is a byte-compiled function defined in
fast-lock.el.gz.
Signature
(fast-lock-cache-name DIRECTORY)
Documentation
Return full cache file name using caching DIRECTORY.
If DIRECTORY is ., the file name is the buffer file name appended with .flc.
Otherwise, the file name is constructed from DIRECTORY and the buffer's true
abbreviated file name, with all / characters in the name replaced with #
characters, and appended with .flc.
If the same file has different cache file names when edited on different
machines, e.g., on one machine the cache file name has the prefix #home,
perhaps due to automount, try putting in your ~/.emacs something like:
(setq directory-abbrev-alist (cons '("^/home/" . "/") directory-abbrev-alist))
Emacs automagically removes the common /tmp_mnt automount prefix by default.
See fast-lock-cache-directory.
Source Code
;; Defined in /usr/src/emacs/lisp/obsolete/fast-lock.el.gz
;; If you are wondering why we only hash if the directory is not ".", rather
;; than if `file-name-absolute-p', it is because if we just appended ".flc" for
;; relative cache directories (that are not ".") then it is possible that more
;; than one file would have the same cache name in that directory, if the luser
;; made a link from one relative cache directory to another. (Phew!)
(defun fast-lock-cache-name (directory)
"Return full cache file name using caching DIRECTORY.
If DIRECTORY is `.', the file name is the buffer file name appended with `.flc'.
Otherwise, the file name is constructed from DIRECTORY and the buffer's true
abbreviated file name, with all `/' characters in the name replaced with `#'
characters, and appended with `.flc'.
If the same file has different cache file names when edited on different
machines, e.g., on one machine the cache file name has the prefix `#home',
perhaps due to automount, try putting in your `~/.emacs' something like:
(setq directory-abbrev-alist (cons \\='(\"^/home/\" . \"/\") directory-abbrev-alist))
Emacs automagically removes the common `/tmp_mnt' automount prefix by default.
See `fast-lock-cache-directory'."
(if (string-equal directory ".")
(concat buffer-file-name ".flc")
(let* ((bufile (expand-file-name buffer-file-truename))
(chars-alist
(if (memq system-type '(windows-nt cygwin))
'((?/ . (?#)) (?# . (?# ?#)) (?: . (?\;)) (?\; . (?\; ?\;)))
'((?/ . (?#)) (?# . (?# ?#)))))
(mapchars
(function (lambda (c) (or (cdr (assq c chars-alist)) (list c))))))
(concat
(file-name-as-directory (expand-file-name directory))
(mapconcat #'char-to-string (apply #'append (mapcar mapchars bufile)) "")
".flc"))))