;;; dired.el --- directory-browsing commands -*- lexical-binding: t -*-
-;; Copyright (C) 1985-1986, 1992-1997, 2000-2014
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1992-1997, 2000-2015 Free Software
+;; Foundation, Inc.
;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
;; Maintainer: emacs-devel@gnu.org
support this option. Alternatively, you might want to use Emacs's
own emulation of \"ls\", by using:
(setq ls-lisp-use-insert-directory-program nil)
- (require 'ls-lisp)
+ (require \\='ls-lisp)
This is used by default on MS Windows, which does not have an \"ls\" program.
Note that `ls-lisp' does not support as many options as GNU ls, though.
For more details, see Info node `(emacs)ls in Lisp'."
"\"Edit\" directory DIRNAME--delete, rename, print, etc. some files in it.
Optional second argument SWITCHES specifies the `ls' options used.
\(Interactively, use a prefix argument to be able to specify SWITCHES.)
-Dired displays a list of files in DIRNAME (which may also have
-shell wildcards appended to select certain files). If DIRNAME is a cons,
-its first element is taken as the directory name and the rest as an explicit
-list of files to make directory entries for.
+
+If DIRNAME is a string, Dired displays a list of files in DIRNAME (which
+may also have shell wildcards appended to select certain files).
+
+If DIRNAME is a cons, its first element is taken as the directory name
+and the rest as an explicit list of files to make directory entries for.
+In this case, SWITCHES are applied to each of the files separately, and
+therefore switches that control the order of the files in the produced
+listing have no effect.
+
\\<dired-mode-map>\
You can flag files for deletion with \\[dired-flag-file-deletion] and then
delete them by typing \\[dired-do-flagged-delete].
(define-key map "T" 'dired-do-touch)
(define-key map "X" 'dired-do-shell-command)
(define-key map "Z" 'dired-do-compress)
+ (define-key map "c" 'dired-do-compress-to)
(define-key map "!" 'dired-do-shell-command)
(define-key map "&" 'dired-do-async-shell-command)
;; Comparison commands
(defun dired-next-line (arg)
"Move down lines then position at filename.
Optional prefix ARG says how many lines to move; default is one line."
- (interactive "p")
+ (interactive "^p")
(let ((line-move-visual)
(goal-column))
(line-move arg t))
(defun dired-previous-line (arg)
"Move up lines then position at filename.
Optional prefix ARG says how many lines to move; default is one line."
- (interactive "p")
+ (interactive "^p")
(dired-next-line (- (or arg 1))))
(defun dired-next-dirline (arg &optional opoint)
;; to e.g. recursive-delete-file and put it somewhere else.
(defun dired-delete-file (file &optional recursive trash) "\
Delete FILE or directory (possibly recursively if optional RECURSIVE is true.)
-RECURSIVE determines what to do with a non-empty directory. If RECURSIVE is:
-nil, do not delete.
-`always', delete recursively without asking.
-`top', ask for each directory at top level.
-Anything else, ask for each sub-directory."
+RECURSIVE determines what to do with a non-empty directory. The effect of
+its possible values is:
+
+ nil -- do not delete.
+ `always' -- delete recursively without asking.
+ `top' -- ask for each directory at top level.
+ Anything else -- ask for each sub-directory.
+
+TRASH non-nil means to trash the file instead of deleting, provided
+`delete-by-moving-to-trash' (which see) is non-nil."
;; This test is equivalent to
;; (and (file-directory-p fn) (not (file-symlink-p fn)))
;; but more efficient
(interactive)
(dired-unmark-all-files ?\r))
+;; Bound in dired-unmark-all-files
+(defvar dired-unmark-all-files-query)
+
(defun dired-unmark-all-files (mark &optional arg)
"Remove a specific mark (or any mark) from every file.
After this command, type the mark character to remove,
(save-excursion
(let* ((count 0)
(inhibit-read-only t) case-fold-search
+ dired-unmark-all-files-query
(string (format "\n%c" mark))
(help-form "\
Type SPC or `y' to unmark one file, DEL or `n' to skip to next,
(if (or (not arg)
(let ((file (dired-get-filename t t)))
(and file
- (dired-query 'query "Unmark file `%s'? "
+ (dired-query 'dired-unmark-all-files-query
+ "Unmark file `%s'? "
file))))
(progn (subst-char-in-region (1- (point)) (point)
(preceding-char) ?\s)
(let ((inhibit-read-only t))
(cond ((stringp log)
(insert (if args
- (apply (function format) log args)
+ (apply #'format-message log args)
log)))
((bufferp log)
(insert-buffer-substring log))
(unless (bolp)
(insert "\n"))
(insert (current-time-string)
- "\tBuffer `" (buffer-name obuf) "'\n")
+ (format-message "\tBuffer `%s'\n" (buffer-name obuf)))
(goto-char (point-max))
(insert "\f\n")))))))
((memq action '(copy private move link))
(let ((overwrite (and (file-exists-p to)
(y-or-n-p
- (format "Overwrite existing file `%s'? " to))))
+ (format-message
+ "Overwrite existing file `%s'? " to))))
;; Binding dired-overwrite-confirmed to nil makes
;; dired-handle-overwrite a no-op. We instead use
;; y-or-n-p, which pops a graphical menu.
(car (find-backup-file-name to)))
(or (eq dired-backup-overwrite 'always)
(y-or-n-p
- (format
+ (format-message
"Make backup for existing file `%s'? " to))))
(rename-file to backup-file 0)
(dired-relist-entry backup-file))
\f
;;; Start of automatically extracted autoloads.
\f
-;;;### (autoloads nil "dired-aux" "dired-aux.el" "73269f48e7fe2fd0ac580fd69252b33a")
+;;;### (autoloads nil "dired-aux" "dired-aux.el" "29842a53d6651f8f535ec8e02d20d7cc")
;;; Generated autoloads from dired-aux.el
(autoload 'dired-diff "dired-aux" "\
\(fn &optional ARG FMT)" t nil)
-(autoload 'dired-compress-file "dired-aux" "\
+(autoload 'dired-do-compress-to "dired-aux" "\
+Compress selected files and directories to an archive.
+You are prompted for the archive name.
+The archiving command is chosen based on the archive name extension and
+`dired-compress-files-alist'.
+\(fn)" t nil)
+
+(autoload 'dired-compress-file "dired-aux" "\
+Compress or uncompress FILE.
+Return the name of the compressed or uncompressed file.
+Return nil if no change in files.
\(fn FILE)" nil nil)
;;;***
\f
-;;;### (autoloads nil "dired-x" "dired-x.el" "994b5d9fc38059ab641ec271c728e56f")
+;;;### (autoloads nil "dired-x" "dired-x.el" "06f532e2e812fa1cb10ade31249e9700")
;;; Generated autoloads from dired-x.el
(autoload 'dired-jump "dired-x" "\