Function: dired-insert-subdir-validate

dired-insert-subdir-validate is a byte-compiled function defined in dired-aux.el.gz.

Signature

(dired-insert-subdir-validate DIRNAME &optional SWITCHES)

Source Code

;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
(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-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
      (let (case-fold-search)
	(mapcar
	 (lambda (x)
	   (or (eq (null (string-match-p x real-switches))
		   (null (string-match-p x dired-actual-switches)))
	       (error
		"Can't have dirs with and without -%s switches together" x)))
	 ;; all switches that make a difference to dired-get-filename:
	 '("F" "b"))))))