Function: dired-hide-all

dired-hide-all is an autoloaded, interactive and byte-compiled function defined in dired-aux.el.gz.

Signature

(dired-hide-all &optional IGNORED)

Documentation

Hide all subdirectories, leaving only their header lines.

If there is already something hidden, make everything visible again. Use M-x dired-hide-subdir (dired-hide-subdir) to (un)hide a particular subdirectory.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/dired-aux.el.gz
;;;###autoload
(defun dired-hide-all (&optional _ignored)
  "Hide all subdirectories, leaving only their header lines.
If there is already something hidden, make everything visible again.
Use \\[dired-hide-subdir] to (un)hide a particular subdirectory."
  (interactive "P" dired-mode)
  (with-silent-modifications
    (if (text-property-any (point-min) (point-max) 'invisible 'dired)
	(dired--unhide (point-min) (point-max))
      ;; hide
      (let ((pos (point-max)))		; pos of end of last directory
        (dolist (subdir dired-subdir-alist)
          (let ((start (cdr subdir)) ; pos of prev dir
		(end (save-excursion
		       (goto-char pos) ; current dir
		       ;; we're somewhere on current dir's line
		       (forward-line -1)
		       (point))))
            (dired--hide start end))
          (setq pos (cdr subdir))))))) ; prev dir gets current dir