diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2011-04-19 15:44:55 +0200 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2011-04-19 15:44:55 +0200 |
commit | 06b605171f1c9d8b42bd3326a243b8b03d2e4e58 (patch) | |
tree | e96c135042999136bf0e75d113aae306e51983e3 /lisp/dired-aux.el | |
parent | 04c569546ad52f6270d8fc6d4aa0750950a0ac05 (diff) | |
download | emacs-06b605171f1c9d8b42bd3326a243b8b03d2e4e58.tar.gz |
lisp/*.el: Lexical-binding cleanup.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r-- | lisp/dired-aux.el | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 6ff7ff7d77d..059a635cded 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -459,6 +459,8 @@ with a prefix argument." (funcall fun file)))) (forward-line 1))))) +(defvar backup-extract-version-start) ; used in backup-extract-version + (defun dired-collect-file-versions (fn) (let ((fn (file-name-sans-versions fn))) ;; Only do work if this file is not already in the alist. @@ -628,7 +630,7 @@ can be produced by `dired-get-marked-files', for example." (defvar dired-mark-separator " " "Separates marked files in dired shell commands.") -(defun dired-shell-stuff-it (command file-list on-each &optional raw-arg) +(defun dired-shell-stuff-it (command file-list on-each &optional _raw-arg) ;; "Make up a shell command line from COMMAND and FILE-LIST. ;; If ON-EACH is t, COMMAND should be applied to each file, else ;; simply concat all files and apply COMMAND to this. @@ -1078,7 +1080,6 @@ files matching `dired-omit-regexp'." ;; Entry is always for files, even if they happen to also be directories (let* ((opoint (point)) (cur-dir (dired-current-directory)) - (orig-file-name filename) (directory (if relative cur-dir (file-name-directory filename))) reason) (setq filename @@ -1251,21 +1252,20 @@ Special value `always' suppresses confirmation." (defun dired-copy-file-recursive (from to ok-flag &optional preserve-time top recursive) - (let ((attrs (file-attributes from)) - dirfailed) + (let ((attrs (file-attributes from))) (if (and recursive (eq t (car attrs)) (or (eq recursive 'always) (yes-or-no-p (format "Recursive copies of %s? " from)))) ;; This is a directory. - (copy-directory from to dired-copy-preserve-time) + (copy-directory from to preserve-time) ;; Not a directory. (or top (dired-handle-overwrite to)) (condition-case err (if (stringp (car attrs)) ;; It is a symlink (make-symbolic-link (car attrs) to ok-flag) - (copy-file from to ok-flag dired-copy-preserve-time)) + (copy-file from to ok-flag preserve-time)) (file-date-error (push (dired-make-relative from) dired-create-files-failures) @@ -1360,6 +1360,10 @@ Special value `always' suppresses confirmation." (setcar elt cur-dir) (when cons (setcar cons cur-dir)))))) +;; Bound in dired-create-files +(defvar overwrite-query) +(defvar overwrite-backup-query) + ;; The basic function for half a dozen variations on cp/mv/ln/ln -s. (defun dired-create-files (file-creator operation fn-list name-constructor &optional marker-char) @@ -1546,7 +1550,7 @@ Optional arg HOW-TO determiness how to treat the target. (function (lambda (from) (expand-file-name (file-name-nondirectory from) target))) - (function (lambda (from) target))) + (function (lambda (_from) target))) marker-char)))) ;; Read arguments for a marked-files command that wants a file name, @@ -1740,6 +1744,8 @@ of `dired-dwim-target', which see." ;;; 5K ;;;###begin dired-re.el +(defvar rename-regexp-query) + (defun dired-do-create-files-regexp (file-creator operation arg regexp newname &optional whole-name marker-char) ;; Create a new file for each marked file using regexps. @@ -1751,7 +1757,6 @@ of `dired-dwim-target', which see." ;; instead of only the non-directory part of the file. ;; Optional arg MARKER-CHAR as in dired-create-files. (let* ((fn-list (dired-get-marked-files nil arg)) - (fn-count (length fn-list)) (operation-prompt (concat operation " `%s' to `%s'?")) (rename-regexp-help-form (format "\ Type SPC or `y' to %s one match, DEL or `n' to skip to next, @@ -1860,6 +1865,8 @@ See function `dired-do-rename-regexp' for more info." (function make-symbolic-link) "SymLink" arg regexp newname whole-name dired-keep-marker-symlink)) +(defvar rename-non-directory-query) + (defun dired-create-files-non-directory (file-creator basename-constructor operation arg) ;; Perform FILE-CREATOR on the non-directory part of marked files @@ -2056,8 +2063,7 @@ of marked files. If KILL-ROOT is non-nil, kill DIRNAME as well." (while alist (setq elt (car alist) alist (cdr alist) - dir (car elt) - pos (dired-get-subdir-min elt)) + dir (car elt)) (if (dired-tree-lessp dir new-dir) ;; Insert NEW-DIR after DIR (setq new-pos (dired-get-subdir-max elt) |