diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-30 14:12:04 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-09-30 14:12:04 -0700 |
commit | e7a2937b11bffc9ac24936e9f46201ce2abf38cc (patch) | |
tree | 93dcf60d3f9136ef291a68e76d793a5feb50f3d6 /lisp/files.el | |
parent | b9ab1b1f1c8f85fb624b9f170f4adf7f764d248b (diff) | |
download | emacs-e7a2937b11bffc9ac24936e9f46201ce2abf38cc.tar.gz |
file-attributes has a new optional arg FOLLOW-SYMLINKS.
* doc/lispref/files.texi (File Attributes): Describe it.
(Magic File Names): Use it.
* etc/NEWS: Document the change.
* lisp/files.el (remote-file-name-inhibit-cache):
* lisp/time.el (display-time-file-nonempty-p): Use it.
* lisp/files.el (after-find-file): Don't chase links before calling
file-exists-p, as file-exists-p already does the right thing.
* src/dired.c (directory_files_internal, Ffile_attributes):
New arg follow_symlinks. All uses changed.
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index 76a13f6cefd..8bc02d08f6f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -1014,7 +1014,7 @@ consecutive checks. For example: (defun display-time-file-nonempty-p (file) (let ((remote-file-name-inhibit-cache (- display-time-interval 5))) (and (file-exists-p file) - (< 0 (nth 7 (file-attributes (file-chase-links file)))))))" + (< 0 (nth 7 (file-attributes file nil t))))))" :group 'files :version "24.1" :type `(choice @@ -2082,8 +2082,7 @@ unless NOMODES is non-nil." ((and error (file-attributes buffer-file-name)) (setq buffer-read-only t) (if (and (file-symlink-p buffer-file-name) - (not (file-exists-p - (file-chase-links buffer-file-name)))) + (not (file-exists-p buffer-file-name))) "Symbolic link that points to nonexistent file" "File exists, but cannot be read")) ((not buffer-read-only) |