failures)
(setq failures
(dired-bunch-files 10000
- (function dired-check-process)
+ #'dired-check-process
(append
(list operation program)
(unless (or (string-equal new-attribute "")
;; If the file has numeric backup versions,
;; put on dired-file-version-alist an element of the form
;; (FILENAME . VERSION-NUMBER-LIST)
- (dired-map-dired-file-lines (function dired-collect-file-versions))
+ (dired-map-dired-file-lines #'dired-collect-file-versions)
;; Sort each VERSION-NUMBER-LIST,
;; and remove the versions not to be deleted.
(let ((fval dired-file-version-alist))
(setq fval (cdr fval))))
;; Look at each file. If it is a numeric backup file,
;; find it in a VERSION-NUMBER-LIST and maybe flag it for deletion.
- (dired-map-dired-file-lines (function dired-trample-file-versions))
+ (dired-map-dired-file-lines #'dired-trample-file-versions)
(message "Cleaning numerical backups...done")))
;;; Subroutines of dired-clean-directory.
(if on-each
(dired-bunch-files
(- 10000 (length command))
- (function (lambda (&rest files)
- (dired-run-shell-command
- (dired-shell-stuff-it command files t arg))))
+ (lambda (&rest files)
+ (dired-run-shell-command
+ (dired-shell-stuff-it command files t arg)))
nil
file-list)
;; execute the shell command
(let ((files (dired-get-marked-files t arg nil t))
(string (if (eq op-symbol 'compress) "Compress or uncompress"
(capitalize (symbol-name op-symbol)))))
- (dired-mark-pop-up nil op-symbol files (function y-or-n-p)
+ (dired-mark-pop-up nil op-symbol files #'y-or-n-p
(concat string " "
(dired-mark-prompt arg files) "? ")))))
(defun dired-do-compress (&optional arg)
"Compress or uncompress marked (or next ARG) files."
(interactive "P")
- (dired-map-over-marks-check (function dired-compress) arg 'compress t))
+ (dired-map-over-marks-check #'dired-compress arg 'compress t))
;; Commands for Emacs Lisp files - load and byte compile
(defun dired-do-byte-compile (&optional arg)
"Byte compile marked (or next ARG) Emacs Lisp files."
(interactive "P")
- (dired-map-over-marks-check (function dired-byte-compile) arg 'byte-compile t))
+ (dired-map-over-marks-check #'dired-byte-compile arg 'byte-compile t))
(defun dired-load ()
;; Return nil for success, offending file name else.
(defun dired-do-load (&optional arg)
"Load the marked (or next ARG) Emacs Lisp files."
(interactive "P")
- (dired-map-over-marks-check (function dired-load) arg 'load t))
+ (dired-map-over-marks-check #'dired-load arg 'load t))
;;;###autoload
(defun dired-do-redisplay (&optional arg test-for-subdir)
(defun dired-add-file (filename &optional marker-char)
(dired-fun-in-all-buffers
(file-name-directory filename) (file-name-nondirectory filename)
- (function dired-add-entry) filename marker-char))
+ #'dired-add-entry filename marker-char))
(defvar dired-omit-mode)
(declare-function dired-omit-regexp "dired-x" ())
(defun dired-remove-file (file)
(dired-fun-in-all-buffers
(file-name-directory file) (file-name-nondirectory file)
- (function dired-remove-entry) file))
+ #'dired-remove-entry file))
(defun dired-remove-entry (file)
(save-excursion
"Create or update the line for FILE in all Dired buffers it would belong in."
(dired-fun-in-all-buffers (file-name-directory file)
(file-name-nondirectory file)
- (function dired-relist-entry) file))
+ #'dired-relist-entry file))
(defun dired-relist-entry (file)
;; Relist the line for FILE, or just add it if it did not exist.
(setq from-dir (file-name-as-directory from-dir)
to-dir (file-name-as-directory to-dir))
(dired-fun-in-all-buffers from-dir nil
- (function dired-rename-subdir-1) from-dir to-dir)
+ #'dired-rename-subdir-1 from-dir to-dir)
;; Update visited file name of all affected buffers
(let ((expanded-from-dir (expand-file-name from-dir))
(blist (buffer-list)))
For any other return value, TARGET is treated as a directory."
(or op1 (setq op1 operation))
(let* ((fn-list (dired-get-marked-files nil arg))
- (rfn-list (mapcar (function dired-make-relative) fn-list))
+ (rfn-list (mapcar #'dired-make-relative fn-list))
(dired-one-file ; fluid variable inside dired-create-files
(and (consp fn-list) (null (cdr fn-list)) (car fn-list)))
(target-dir (dired-dwim-target-directory))
&optional default)
(dired-mark-pop-up
nil op-symbol files
- (function read-file-name)
+ #'read-file-name
(format prompt (dired-mark-prompt arg files)) dir default))
(defun dired-dwim-target-directory ()
to the \"-d\" option for the \"cp\" shell command."
(interactive "P")
(let ((dired-recursive-copies dired-recursive-copies))
- (dired-do-create-files 'copy (function dired-copy-file)
+ (dired-do-create-files 'copy #'dired-copy-file
"Copy"
arg dired-keep-marker-copy
nil dired-copy-how-to-fn)))
For relative symlinks, use \\[dired-do-relsymlink]."
(interactive "P")
- (dired-do-create-files 'symlink (function make-symbolic-link)
+ (dired-do-create-files 'symlink #'make-symbolic-link
"Symlink" arg dired-keep-marker-symlink))
;;;###autoload
suggested for the target directory depends on the value of
`dired-dwim-target', which see."
(interactive "P")
- (dired-do-create-files 'hardlink (function dired-hardlink)
+ (dired-do-create-files 'hardlink #'dired-hardlink
"Hardlink" arg dired-keep-marker-hardlink))
(defun dired-hardlink (file newname &optional ok-if-already-exists)
The default suggested for the target directory depends on the value
of `dired-dwim-target', which see."
(interactive "P")
- (dired-do-create-files 'move (function dired-rename-file)
+ (dired-do-create-files 'move #'dired-rename-file
"Move" arg dired-keep-marker-rename "Rename"))
;;;###end dired-cp.el
\f
Normally, only the non-directory part of the file name is used and changed."
(interactive (dired-mark-read-regexp "Rename"))
(dired-do-create-files-regexp
- (function dired-rename-file)
+ #'dired-rename-file
"Rename" arg regexp newname whole-name dired-keep-marker-rename))
;;;###autoload
(interactive (dired-mark-read-regexp "Copy"))
(let ((dired-recursive-copies nil)) ; No recursive copies.
(dired-do-create-files-regexp
- (function dired-copy-file)
+ #'dired-copy-file
(if dired-copy-preserve-time "Copy [-p]" "Copy")
arg regexp newname whole-name dired-keep-marker-copy)))
See function `dired-do-rename-regexp' for more info."
(interactive (dired-mark-read-regexp "HardLink"))
(dired-do-create-files-regexp
- (function add-name-to-file)
+ #'add-name-to-file
"HardLink" arg regexp newname whole-name dired-keep-marker-hardlink))
;;;###autoload
See function `dired-do-rename-regexp' for more info."
(interactive (dired-mark-read-regexp "SymLink"))
(dired-do-create-files-regexp
- (function make-symbolic-link)
+ #'make-symbolic-link
"SymLink" arg regexp newname whole-name dired-keep-marker-symlink))
(defvar rename-non-directory-query)
(defun dired-rename-non-directory (basename-constructor operation arg)
(dired-create-files-non-directory
- (function dired-rename-file)
+ #'dired-rename-file
basename-constructor operation arg))
;;;###autoload
(defun dired-upcase (&optional arg)
"Rename all marked (or next ARG) files to upper case."
(interactive "P")
- (dired-rename-non-directory (function upcase) "Rename upcase" arg))
+ (dired-rename-non-directory #'upcase "Rename upcase" arg))
;;;###autoload
(defun dired-downcase (&optional arg)
"Rename all marked (or next ARG) files to lower case."
(interactive "P")
- (dired-rename-non-directory (function downcase) "Rename downcase" arg))
+ (dired-rename-non-directory #'downcase "Rename downcase" arg))
;;;###end dired-re.el
\f
;; Ignore dired-hide-details-* value of invisible text property by default.
(when (eq buffer-invisibility-spec t)
(setq buffer-invisibility-spec (list t)))
- (setq-local revert-buffer-function (function dired-revert))
- (setq-local buffer-stale-function (function dired-buffer-stale-p))
+ (setq-local revert-buffer-function #'dired-revert)
+ (setq-local buffer-stale-function #'dired-buffer-stale-p)
(setq-local page-delimiter "\n\n")
(setq-local dired-directory (or dirname default-directory))
;; list-buffers uses this to display the dir being edited in this buffer.
(interactive "P")
(let ((string
(or (dired-get-subdir)
- (mapconcat (function identity)
+ (mapconcat #'identity
(if arg
(cond ((zerop (prefix-numeric-value arg))
(dired-get-marked-files))
;; lines still to be changed, so the (point) values in L stay valid.
;; Also, for subdirs in natural order, a subdir's files are deleted
;; before the subdir itself - the other way around would not work.
- (let* ((files (mapcar (function car) l))
+ (let* ((files (mapcar #'car l))
(count (length l))
(succ 0)
(trashing (and trash delete-by-moving-to-trash)))
;; canonicalize file list for pop up
- (setq files (nreverse (mapcar (function dired-make-relative) files)))
+ (setq files (nreverse (mapcar #'dired-make-relative files)))
(if (dired-mark-pop-up
" *Deletions*" 'delete files dired-deletion-confirmer
(format "%s %s "
(progress-reporter-update progress-reporter succ)
(dired-fun-in-all-buffers
(file-name-directory fn) (file-name-nondirectory fn)
- (function dired-delete-entry) fn))
+ #'dired-delete-entry fn))
(error ;; catch errors from failed deletions
(dired-log "%s\n" err)
(setq failures (cons (car (car l)) failures)))))