[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dired-do-touch
From: |
Matthew Mundell |
Subject: |
dired-do-touch |
Date: |
20 Mar 2004 19:05:40 +0000 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
In Dired "T" could touch the current file with the touch shell
command.
2004-02-08 Matthew Mundell <address@hidden>
* dired-aux.el (dired-do-touch): New defun.
* dired.el: Bind dired-do-touch to T.
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/dired.el,v
retrieving revision 1.272
diff -u -r1.272 dired.el
--- lisp/dired.el 3 Feb 2004 16:55:30 -0000 1.272
+++ lisp/dired.el 20 Mar 2004 14:04:27 -0000
@@ -895,6 +895,7 @@
(define-key map "Q" 'dired-do-query-replace-regexp)
(define-key map "R" 'dired-do-rename)
(define-key map "S" 'dired-do-symlink)
+ (define-key map "T" 'dired-do-touch)
(define-key map "X" 'dired-do-shell-command)
(define-key map "Z" 'dired-do-compress)
(define-key map "!" 'dired-do-shell-command)
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/dired-aux.el,v
retrieving revision 1.114
diff -u -r1.114 dired-aux.el
--- lisp/dired-aux.el 8 Feb 2004 22:38:51 -0000 1.114
+++ lisp/dired-aux.el 20 Mar 2004 15:15:26 -0000
@@ -2135,6 +2135,17 @@
(backward-delete-char 1))
(message "%s" (buffer-string))))
+;;;###autoload
+(defun dired-do-touch (file)
+ "Touch the current file with the `touch' program."
+ (interactive (list (dired-get-filename t)))
+ (with-temp-buffer
+ (call-process "touch" nil t t "--" file)
+ (unless (bobp)
+ (when (bolp)
+ (backward-delete-char 1))
+ (message "%s" (buffer-string)))))
+
(provide 'dired-aux)
;;; arch-tag: 4b508de9-a153-423d-8d3f-a1bbd86f4f60
- dired-do-touch,
Matthew Mundell <=