]> git.eshelyaron.com Git - emacs.git/commitdiff
End predicate `dired-in-this-tree' with '-p'
authorTino Calancha <tino.calancha@gmail.com>
Sat, 13 Jul 2019 02:03:50 +0000 (04:03 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 13 Jul 2019 02:03:50 +0000 (04:03 +0200)
* lisp/dired.el(dired-in-this-tree-p): Rename from `dired-in-this-tree'.
Add docstring.

(dired-in-this-tree): Define an alias to `dired-in-this-tree-p'.

(dired-buffers-for-dir)
* lisp/dired-aux.el (dired-tree-down, dired-kill-tree)
(dired-insert-subdir, dired-rename-subdir): Update all callers (bug#32892).

lisp/dired-aux.el
lisp/dired.el

index d83e57d58dc74a22d99433e78a8303316a1ddc8b..6a1ebcced913b9d1b19a3cb269c23713da9ffbaf 100644 (file)
@@ -1646,7 +1646,7 @@ If `ask', ask for user confirmation."
     (while blist
       (with-current-buffer (car blist)
        (if (and buffer-file-name
-                (dired-in-this-tree buffer-file-name expanded-from-dir))
+                (dired-in-this-tree-p buffer-file-name expanded-from-dir))
            (let ((modflag (buffer-modified-p))
                  (to-file (dired-replace-in-string
                            (concat "^" (regexp-quote from-dir))
@@ -1665,7 +1665,7 @@ If `ask', ask for user confirmation."
     (while alist
       (setq elt (car alist)
            alist (cdr alist))
-      (if (dired-in-this-tree (car elt) expanded-dir)
+      (if (dired-in-this-tree-p (car elt) expanded-dir)
          ;; ELT's subdir is affected by the rename
          (dired-rename-subdir-2 elt dir to)))
     (if (equal dir default-directory)
@@ -2420,7 +2420,7 @@ This function takes some pains to conform to `ls -lR' output."
       (setq switches (dired-replace-in-string "R" "" switches))
       (dolist (cur-ass dired-subdir-alist)
        (let ((cur-dir (car cur-ass)))
-         (and (dired-in-this-tree cur-dir dirname)
+         (and (dired-in-this-tree-p cur-dir dirname)
               (let ((cur-cons (assoc-string cur-dir dired-switches-alist)))
                 (if cur-cons
                     (setcdr cur-cons switches)
@@ -2432,7 +2432,7 @@ This function takes some pains to conform to `ls -lR' output."
 (defun dired-insert-subdir-validate (dirname &optional switches)
   ;; Check that it is valid to insert DIRNAME with SWITCHES.
   ;; Signal an error if invalid (e.g. user typed `i' on `..').
-  (or (dired-in-this-tree dirname (expand-file-name default-directory))
+  (or (dired-in-this-tree-p dirname (expand-file-name default-directory))
       (error  "%s: not in this directory tree" dirname))
   (let ((real-switches (or switches dired-subdir-switches)))
     (when real-switches
@@ -2473,7 +2473,7 @@ of marked files.  If KILL-ROOT is non-nil, kill DIRNAME as well."
       (setq dir (car (car s-alist))
            s-alist (cdr s-alist))
       (and (or kill-root (not (string-equal dir dirname)))
-          (dired-in-this-tree 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))
@@ -2711,7 +2711,7 @@ Lower levels are unaffected."
       (while rest
        (setq elt (car rest)
              rest (cdr rest))
-       (if (dired-in-this-tree (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
index 38ba3734a6135cc967ebe00ca997894b52649d84..c455a5cde46c48ae89a27c470316f8fd5218c892 100644 (file)
@@ -2697,7 +2697,7 @@ You can then feed the file name(s) to other commands with \\[yank]."
        ((null (buffer-name buf))
        ;; Buffer is killed - clean up:
        (setq dired-buffers (delq elt dired-buffers)))
-       ((dired-in-this-tree dir (car elt))
+       ((dired-in-this-tree-p dir (car elt))
        (with-current-buffer buf
          (and (assoc dir dired-subdir-alist)
               (or (null file)
@@ -2770,10 +2770,12 @@ You can then feed the file name(s) to other commands with \\[yank]."
 
 ;;; utility functions
 
-(defun dired-in-this-tree (file dir)
+(defun dired-in-this-tree-p (file dir)
   ;;"Is FILE part of the directory tree starting at DIR?"
   (let (case-fold-search)
     (string-match-p (concat "^" (regexp-quote dir)) file)))
+(define-obsolete-function-alias 'dired-in-this-tree
+  'dired-in-this-tree-p "27.1")
 
 (defun dired-normalize-subdir (dir)
   ;; Prepend default-directory to DIR if relative file name.