diff options
author | Juri Linkov <juri@jurta.org> | 2004-05-01 03:47:42 +0000 |
---|---|---|
committer | Juri Linkov <juri@jurta.org> | 2004-05-01 03:47:42 +0000 |
commit | 52f134eea75b45425febcb0f95d51f0a5e12ebb2 (patch) | |
tree | f413a3f904a239872b90d6e0f12daa9c661a1730 | |
parent | ca858c641956fc46532613a876ce2f7b70d85bde (diff) | |
download | emacs-52f134eea75b45425febcb0f95d51f0a5e12ebb2.tar.gz |
(dired-touch-initial): New fun.
(dired-do-chxxx): Call it for op-symbol `touch'.
-rw-r--r-- | lisp/dired-aux.el | 15 |
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))" (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 @@ List has a form of (file-name full-file-name (attribute-list))" (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 |