This reverts parts of
b425966b07, and
7b50ed553f, i.e. it reverts the
obsoletion of dired-in-this-tree-p and switches some new callers of
file-in-directory-p back to using dired-in-this-tree-p.
It turned out that using file-in-directory-p can be a major
performance regression in case you have a dired buffer of a remote
directory which has become (almost) inaccessible.
Any attempt to open a new dired buffer is checking if a buffer for
that directory already exists (in terms of dired-buffers-for-dir)
which meant that file-in-directory-p was called with the directory of
any existing dired buffer including the inaccessible one where the
file-truename call in file-in-directory-p could block for seconds or
even minutes.
* lisp/dired.el (dired-in-this-tree-p): Undo obsoletion.
(dired-buffers-for-dir): Use dired-in-this-tree-p as before.
* lisp/dired-aux.el (dired-kill-tree,dired-tree-down): Une
dired-in-this-tree-p as before.
(setq dir (car (car s-alist))
s-alist (cdr s-alist))
(and (or kill-root (not (string-equal dir dirname)))
- (file-in-directory-p dir dirname)
+ (dired-in-this-tree-p dir dirname)
(dired-goto-subdir dir)
(setq m-alist (nconc (dired-kill-subdir remember-marks) m-alist))))
m-alist))
(while rest
(setq elt (car rest)
rest (cdr rest))
- (if (file-in-directory-p (directory-file-name (car elt)) dir)
+ (if (dired-in-this-tree-p (directory-file-name (car elt)) dir)
(setq rest nil
pos (dired-goto-subdir (car elt))))))
(if pos
((null (buffer-name buf))
;; Buffer is killed - clean up:
(setq dired-buffers (delq elt dired-buffers)))
- ((file-in-directory-p (car elt) dir)
+ ((dired-in-this-tree-p (car elt) dir)
(with-current-buffer buf
(when (and (or subdirs
(assoc dir dired-subdir-alist))
;;"Is FILE part of the directory tree starting at DIR?"
(let (case-fold-search)
(string-match-p (concat "^" (regexp-quote dir)) file)))
-(make-obsolete 'dired-in-this-tree-p 'file-in-directory-p "28.1")
+
(define-obsolete-function-alias 'dired-in-this-tree
'dired-in-this-tree-p "27.1")