# HG changeset patch # User Juri Linkov # Date 1083383262 0 # Node ID 33be1cf542ec755c3e82f5b7180b91ff59445d2b # Parent 8362eef794e3dfd96f71f3d0c48c51d52017c980 (dired-touch-initial): New fun. (dired-do-chxxx): Call it for op-symbol `touch'. diff -r 8362eef794e3 -r 33be1cf542ec lisp/dired-aux.el --- a/lisp/dired-aux.el Sat May 01 03:44:30 2004 +0000 +++ b/lisp/dired-aux.el Sat May 01 03:47:42 2004 +0000 @@ -185,6 +185,18 @@ (file-attributes full-file-name)))) (directory-files dir))) + +(defun dired-touch-initial (files) + "Create initial input value for `touch' command." + (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))) + (defun dired-do-chxxx (attribute-name program op-symbol arg) ;; Change file attributes (mode, group, owner, timestamp) of marked files and ;; refresh their file lines. @@ -196,7 +208,8 @@ (new-attribute (dired-mark-read-string (concat "Change " attribute-name " of %s to: ") - nil op-symbol arg files)) + (if (eq op-symbol 'touch) (dired-touch-initial files)) + op-symbol arg files)) (operation (concat program " " new-attribute)) failures) (setq failures