Mercurial > emacs
changeset 93235:4525730eae72
(dired-create-files): Use dolist.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Wed, 26 Mar 2008 03:34:07 +0000 |
parents | 3f711cd30ffa |
children | e550714b0fde |
files | lisp/ChangeLog lisp/dired-aux.el |
diffstat | 2 files changed, 40 insertions(+), 41 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Wed Mar 26 03:32:46 2008 +0000 +++ b/lisp/ChangeLog Wed Mar 26 03:34:07 2008 +0000 @@ -1,5 +1,7 @@ 2008-03-26 Stefan Monnier <monnier@iro.umontreal.ca> + * dired-aux.el (dired-create-files): Use dolist. + * bindings.el (mode-line-change-eol): Use with-selected-window. * apropos.el (apropos-command): Include macros.
--- a/lisp/dired-aux.el Wed Mar 26 03:32:46 2008 +0000 +++ b/lisp/dired-aux.el Wed Mar 26 03:34:07 2008 +0000 @@ -1389,51 +1389,48 @@ skipped (success-count 0) (total (length fn-list))) (let (to overwrite-query overwrite-backup-query) ; for dired-handle-overwrite - (mapc - (function - (lambda (from) - (setq to (funcall name-constructor from)) - (if (equal to from) - (progn - (setq to nil) - (dired-log "Cannot %s to same file: %s\n" - (downcase operation) from))) - (if (not to) - (setq skipped (cons (dired-make-relative from) skipped)) - (let* ((overwrite (file-exists-p to)) - (dired-overwrite-confirmed ; for dired-handle-overwrite - (and overwrite - (let ((help-form '(format "\ + (dolist (from fn-list) + (setq to (funcall name-constructor from)) + (if (equal to from) + (progn + (setq to nil) + (dired-log "Cannot %s to same file: %s\n" + (downcase operation) from))) + (if (not to) + (setq skipped (cons (dired-make-relative from) skipped)) + (let* ((overwrite (file-exists-p to)) + (dired-overwrite-confirmed ; for dired-handle-overwrite + (and overwrite + (let ((help-form '(format "\ Type SPC or `y' to overwrite file `%s', DEL or `n' to skip to next, ESC or `q' to not overwrite any of the remaining files, `!' to overwrite all remaining files with no more questions." to))) - (dired-query 'overwrite-query - "Overwrite `%s'?" to)))) - ;; must determine if FROM is marked before file-creator - ;; gets a chance to delete it (in case of a move). - (actual-marker-char - (cond ((integerp marker-char) marker-char) - (marker-char (dired-file-marker from)) ; slow - (t nil)))) - (condition-case err - (progn - (funcall file-creator from to dired-overwrite-confirmed) - (if overwrite - ;; If we get here, file-creator hasn't been aborted - ;; and the old entry (if any) has to be deleted - ;; before adding the new entry. - (dired-remove-file to)) - (setq success-count (1+ success-count)) - (message "%s: %d of %d" operation success-count total) - (dired-add-file to actual-marker-char)) - (file-error ; FILE-CREATOR aborted - (progn - (push (dired-make-relative from) - failures) - (dired-log "%s `%s' to `%s' failed:\n%s\n" - operation from to err)))))))) - fn-list)) + (dired-query 'overwrite-query + "Overwrite `%s'?" to)))) + ;; must determine if FROM is marked before file-creator + ;; gets a chance to delete it (in case of a move). + (actual-marker-char + (cond ((integerp marker-char) marker-char) + (marker-char (dired-file-marker from)) ; slow + (t nil)))) + (condition-case err + (progn + (funcall file-creator from to dired-overwrite-confirmed) + (if overwrite + ;; If we get here, file-creator hasn't been aborted + ;; and the old entry (if any) has to be deleted + ;; before adding the new entry. + (dired-remove-file to)) + (setq success-count (1+ success-count)) + (message "%s: %d of %d" operation success-count total) + (dired-add-file to actual-marker-char)) + (file-error ; FILE-CREATOR aborted + (progn + (push (dired-make-relative from) + failures) + (dired-log "%s `%s' to `%s' failed:\n%s\n" + operation from to err)))))))) (cond (dired-create-files-failures (setq failures (nconc failures dired-create-files-failures))