:group 'dired-x)
(define-minor-mode dired-omit-mode
- "Toggle Dired-Omit mode.
-With numeric ARG, enable Dired-Omit mode if ARG is positive, disable
-otherwise. Enabling and disabling is buffer-local.
-If enabled, \"uninteresting\" files are not listed.
-Uninteresting files are those whose filenames match regexp `dired-omit-files',
-plus those ending with extensions in `dired-omit-extensions'.
+ "Toggle omission of uninteresting files in Dired (Dired-Omit mode).
+With a prefix argument ARG, enable Dired-Omit mode if ARG is
+positive, and disable it otherwise. If called from Lisp, enable
+the mode if ARG is omitted or nil.
-To enable omitting in every Dired buffer, you can put in your ~/.emacs
+Dired-Omit mode is a buffer-local minor mode. When enabled in a
+Dired buffer, Dired does not list files whose filenames match
+regexp `dired-omit-files', nor files ending with extensions in
+`dired-omit-extensions'.
- (add-hook 'dired-mode-hook (lambda () (dired-omit-mode 1)))
+To enable omitting in every Dired buffer, you can put this in
+your init file:
+
+ (add-hook 'dired-mode-hook (lambda () (dired-omit-mode)))
See Info node `(dired-x) Omitting Variables' for more information."
:group 'dired-x
;; Returns t if any work was done, nil otherwise.
(defun dired-mark-unmarked-files (regexp msg &optional unflag-p localp)
"Mark unmarked files matching REGEXP, displaying MSG.
-REGEXP is matched against the entire file name.
-Does not re-mark files which already have a mark.
+REGEXP is matched against the entire file name. When called
+interactively, prompt for REGEXP.
With prefix argument, unflag all those files.
Optional fourth argument LOCALP is as in `dired-get-filename'."
- (interactive "P")
+ (interactive
+ (list (dired-read-regexp
+ "Mark unmarked files matching regexp (default all): ")
+ nil current-prefix-arg nil))
(let ((dired-marker-char (if unflag-p ?\s dired-marker-char)))
(dired-mark-if
(and
`.foo' and `.bar' files, write
\(setq dired-guess-shell-alist-user
- (list (list \"\\\\.foo\\\\'\" \"FOO-COMMAND\");; fixed rule
- ;; possibly more rules ...
- (list \"\\\\.bar\\\\'\";; rule with condition test
- '(if condition
- \"BAR-COMMAND-1\"
- \"BAR-COMMAND-2\")))\)"
+ '((\"\\\\.foo\\\\'\" \"FOO-COMMAND\")
+ (\"\\\\.bar\\\\'\"
+ (if condition
+ \"BAR-COMMAND-1\"
+ \"BAR-COMMAND-2\"))))"
:group 'dired-x
:type '(alist :key-type regexp :value-type (repeat sexp)))
:type 'boolean)
(defun dired-guess-default (files)
- "Guess a shell commands for FILES. Return command or list of commands.
+ "Return a shell command, or a list of commands, appropriate for FILES.
See `dired-guess-shell-alist-user'."
(let* ((case-fold-search dired-guess-shell-case-fold-search)
;; Return commands or nil if flist is still non-nil.
;; Evaluate the commands in order that any logical testing will be done.
(if (cdr cmds)
- (mapcar #'eval cmds)
- (eval (car cmds))))) ; single command
+ (delete-dups (mapcar #'eval cmds))
+ (eval (car cmds))))) ; single command
(defun dired-guess-shell-command (prompt files)
"Ask user with PROMPT for a shell command, guessing a default from FILES."
displayed this way is restricted by the height of the current window and
`window-min-height'.
-To keep dired buffer displayed, type \\[split-window-vertically] first.
+To keep dired buffer displayed, type \\[split-window-below] first.
To display just marked files, type \\[delete-other-windows] first."
(interactive "P")
(dired-simultaneous-find-file (dired-get-marked-files) noselect))
(defun dired-mark-sexp (predicate &optional unflag-p)
"Mark files for which PREDICATE returns non-nil.
-With a prefix arg, unflag those files instead.
+With a prefix arg, unmark or unflag those files instead.
PREDICATE is a lisp expression that can refer to the following symbols: