From ecb95568a82da5dbe97be0aba3b45b56efd0b75f Mon Sep 17 00:00:00 2001 From: Kyle Meyer Date: Sun, 20 Mar 2016 22:27:07 -0400 Subject: Add dired-copy-last-mtime-as-kill command --- lisp/km-dired.el | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lisp/km-dired.el') diff --git a/lisp/km-dired.el b/lisp/km-dired.el index 148d376..69787d0 100644 --- a/lisp/km-dired.el +++ b/lisp/km-dired.el @@ -84,6 +84,16 @@ (--when-let (dired-get-marked-files nil arg) (apply #'call-process "touch" nil nil nil "-h" it))) +;;;###autoload +(defun km/dired-copy-last-mtime-as-kill () + "Copy last modification time for file at point." + (interactive) + (setq arg (and current-prefix-arg arg)) + (--when-let (dired-get-filename nil 'noerror) + (kill-new (message "%s" (format-time-string + "%Y%m%d%H%M.%S" + (nth 5 (file-attributes it))))))) + ;;; Copying file names -- cgit v1.2.3