# HG changeset patch # User Juri Linkov # Date 1080750633 0 # Node ID 2f1445ac33562759a39d57b5a5d5ca34bbcd2445 # Parent 9b0161392fe1ded371f9906a3f18d8333c714208 (dired-do-touch): New fun. (dired-do-chxxx): Add argument -t for touch operation. diff -r 9b0161392fe1 -r 2f1445ac3356 lisp/dired-aux.el --- a/lisp/dired-aux.el Wed Mar 31 16:29:46 2004 +0000 +++ b/lisp/dired-aux.el Wed Mar 31 16:30:33 2004 +0000 @@ -186,7 +186,7 @@ (directory-files dir))) (defun dired-do-chxxx (attribute-name program op-symbol arg) - ;; Change file attributes (mode, group, owner) of marked files and + ;; Change file attributes (mode, 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. @@ -203,7 +203,10 @@ (dired-bunch-files 10000 (function dired-check-process) (append - (list operation program new-attribute) + (list operation program) + (if (eq op-symbol 'touch) + '("-t") nil) + (list new-attribute) (if (string-match "gnu" system-configuration) '("--") nil)) files)) @@ -236,6 +239,12 @@ (error "chown not supported on this system")) (dired-do-chxxx "Owner" dired-chown-program 'chown arg)) +(defun dired-do-touch (&optional arg) + "Change the timestamp of the marked (or next ARG) files. +This calls touch." + (interactive "P") + (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg)) + ;; Process all the files in FILES in batches of a convenient size, ;; by means of (FUNCALL FUNCTION ARGS... SOME-FILES...). ;; Batches are chosen to need less than MAX chars for the file names,