summaryrefslogtreecommitdiff
path: root/lisp/dired-aux.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-08-02 22:05:38 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2011-08-02 22:05:38 -0700
commit9a70f03d70e44db2ec9c6d2952cb8a1deae15000 (patch)
treec0efd5c0a208640c0a883f4566df1b40caa3aaad /lisp/dired-aux.el
parent29c8a348c5c9f326af54a3d30f69cde98fe300bb (diff)
downloademacs-9a70f03d70e44db2ec9c6d2952cb8a1deae15000.tar.gz
emacs-9a70f03d70e44db2ec9c6d2952cb8a1deae15000.tar.bz2
emacs-9a70f03d70e44db2ec9c6d2952cb8a1deae15000.zip
Merge from trunk.
Diffstat (limited to 'lisp/dired-aux.el')
-rw-r--r--lisp/dired-aux.el32
1 files changed, 13 insertions, 19 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 3103fbd5a7f..ec157fc4939 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -226,34 +226,28 @@ List has a form of (file-name full-file-name (attribute-list))."
(file-attributes full-file-name))))
(directory-files dir)))
-
-(defun dired-touch-initial (files)
- "Create initial input value for `touch' command."
- ;; Nobody can explain what this version is supposed to do. (Bug#6887)
- ;; Also, the manual says it uses "the present time".
- ;;; (let (initial)
- ;;; (while files
- ;;; (let ((current (nth 5 (file-attributes (car files)))))
- ;;; (if (and initial (not (equal initial current)))
- ;;; (setq initial (current-time) files nil)
- ;;; (setq initial current))
- ;;; (setq files (cdr files))))
- ;;; (format-time-string "%Y%m%d%H%M.%S" initial)))
- (format-time-string "%Y%m%d%H%M.%S" (current-time)))
+;;; Change file attributes
(defun dired-do-chxxx (attribute-name program op-symbol arg)
- ;; Change file attributes (mode, group, owner, timestamp) of marked files and
+ ;; Change file attributes (group, owner, timestamp) of marked files and
;; refresh their file lines.
;; ATTRIBUTE-NAME is a string describing the attribute to the user.
;; PROGRAM is the program used to change the attribute.
- ;; OP-SYMBOL is the type of operation (for use in dired-mark-pop-up).
- ;; ARG describes which files to use, as in dired-get-marked-files.
+ ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up').
+ ;; ARG describes which files to use, as in `dired-get-marked-files'.
(let* ((files (dired-get-marked-files t arg))
+ (initial
+ (if (eq op-symbol 'touch)
+ (format-time-string "%Y%m%d%H%M.%S")))
+ (default
+ (if (eq op-symbol 'touch)
+ (and (stringp (car files))
+ (format-time-string "%Y%m%d%H%M.%S"
+ (nth 5 (file-attributes (car files)))))))
(new-attribute
(dired-mark-read-string
(concat "Change " attribute-name " of %s to: ")
- (if (eq op-symbol 'touch) (dired-touch-initial files))
- op-symbol arg files))
+ initial op-symbol arg files default))
(operation (concat program " " new-attribute))
failures)
(setq failures