aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/dired-aux.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index 0709e0cfe1c..dbc3d763040 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -185,6 +185,18 @@ List has a form of (file-name full-file-name (attribute-list))"
185 (file-attributes full-file-name)))) 185 (file-attributes full-file-name))))
186 (directory-files dir))) 186 (directory-files dir)))
187 187
188
189(defun dired-touch-initial (files)
190 "Create initial input value for `touch' command."
191 (let (initial)
192 (while files
193 (let ((current (nth 5 (file-attributes (car files)))))
194 (if (and initial (not (equal initial current)))
195 (setq initial (current-time) files nil)
196 (setq initial current))
197 (setq files (cdr files))))
198 (format-time-string "%Y%m%d%H%M.%S" initial)))
199
188(defun dired-do-chxxx (attribute-name program op-symbol arg) 200(defun dired-do-chxxx (attribute-name program op-symbol arg)
189 ;; Change file attributes (mode, group, owner, timestamp) of marked files and 201 ;; Change file attributes (mode, group, owner, timestamp) of marked files and
190 ;; refresh their file lines. 202 ;; refresh their file lines.
@@ -196,7 +208,8 @@ List has a form of (file-name full-file-name (attribute-list))"
196 (new-attribute 208 (new-attribute
197 (dired-mark-read-string 209 (dired-mark-read-string
198 (concat "Change " attribute-name " of %s to: ") 210 (concat "Change " attribute-name " of %s to: ")
199 nil op-symbol arg files)) 211 (if (eq op-symbol 'touch) (dired-touch-initial files))
212 op-symbol arg files))
200 (operation (concat program " " new-attribute)) 213 (operation (concat program " " new-attribute))
201 failures) 214 failures)
202 (setq failures 215 (setq failures