diff options
author | Richard M. Stallman <rms@gnu.org> | 1992-09-13 20:40:20 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1992-09-13 20:40:20 +0000 |
commit | 715984d3a4be50954a28e9a6fd270986d319826d (patch) | |
tree | 3d2162af685db890d5f6ce84332427cb5cd5dc05 /lisp/dired.el | |
parent | ab94e6e7958295725884bcbe9097cb0eee9721b7 (diff) | |
download | emacs-715984d3a4be50954a28e9a6fd270986d319826d.tar.gz |
*** empty log message ***
Diffstat (limited to 'lisp/dired.el')
-rw-r--r-- | lisp/dired.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index d4788e7cac6..02a4d53d681 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -495,6 +495,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." (setq mark-alist;; only after dired-remember-hidden since this unhides: (dired-remember-marks (point-min) (point-max))) ;; treat top level dir extra (it may contain wildcards) + (dired-uncache dired-directory) (dired-readin dired-directory (current-buffer)) (let ((dired-after-readin-hook nil)) ;; don't run that hook for each subdir... @@ -571,8 +572,23 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." old-subdir-alist (cdr old-subdir-alist) dir (car elt)) (condition-case () - (dired-insert-subdir dir) + (progn + (dired-uncache dir) + (dired-insert-subdir dir)) (error nil)))))) + +;; Remove directory DIR from any directory cache. +(defun dired-uncache (dir) + (let (handler (handlers file-name-handler-alist)) + (save-match-data + (while (and (consp handlers) (null handler)) + (if (and (consp (car handlers)) + (stringp (car (car handlers))) + (string-match (car (car handlers)) dir)) + (setq handler (cdr (car handlers)))) + (setq handlers (cdr handlers)))) + (if handler + (funcall handler 'dired-uncache dir)))) ;; dired mode key bindings and initialization @@ -854,7 +870,7 @@ otherwise, display it in another buffer." (if (file-directory-p (dired-get-filename)) (or (and dired-subdir-alist (dired-goto-subdir (dired-get-filename))) (dired (dired-get-filename))) - (view-file (file-name-sans-versions (dired-get-filename) t)))) + (view-file (dired-get-filename)))) (defun dired-find-file-other-window () "In dired, visit this file or directory in another window." |