]> code.delx.au - gnu-emacs/commitdiff
(dired-do-touch): New fun.
authorJuri Linkov <juri@jurta.org>
Wed, 31 Mar 2004 16:33:00 +0000 (16:33 +0000)
committerJuri Linkov <juri@jurta.org>
Wed, 31 Mar 2004 16:33:00 +0000 (16:33 +0000)
(dired-do-chxxx): Add argument -t for touch operation.

lisp/ChangeLog
lisp/dired-aux.el

index ab9461d726757b0a0d42950f9dca39b1ac635dd6..f87dc9269551c70111bb3589daa7118d48a77f38 100644 (file)
@@ -1,3 +1,20 @@
+2004-03-31  Juri Linkov  <juri@jurta.org>
+
+       * dired.el: Add autoload for `dired-do-touch'.
+       (dired-touch-program): New var.
+       (dired-mode-map): Bind `dired-do-touch' to T and add menu-item.
+       (dired-no-confirm): Add `touch' to docstring.
+
+       * dired-aux.el (dired-do-touch): New fun.
+       (dired-do-chxxx): Add argument -t for touch operation.
+
+       * dired-x.el (dired-mark-sexp): Replace hard-coded month names by
+       `dired-move-to-filename-regexp'.
+
+2004-03-31  H\e,Ae\e(Bkan Granath  <hakan.granath@kau.se>  (tiny change)
+
+       * dired.el (dired-move-to-filename-regexp): Add . to HH:MM.
+
 2004-03-30  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
        * progmodes/ebnf2ps.el (ebnf-eps-finish-and-write): Write a buffer if
index 1fc8e0e805aa6959c2e3e09990add45ea4300264..0709e0cfe1ce340953d746d0b0b0783ebf877905 100644 (file)
@@ -186,7 +186,7 @@ List has a form of (file-name full-file-name (attribute-list))"
    (directory-files dir)))
 \f
 (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 @@ List has a form of (file-name full-file-name (attribute-list))"
          (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 @@ This calls chmod, thus symbolic modes like `g+w' are allowed."
       (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,