summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-03-14 00:31:33 -0400
committerKyle Meyer <kyle@kyleam.com>2016-03-14 00:31:33 -0400
commit209965631c5e10c426d1b6319a69caa06fb48707 (patch)
treef9965a3e40fb55ed8b44abdc9603e274c2123dbb
parent170f8addf9986404ae3f852c15c83aa1cd3d80ca (diff)
downloademacs.d-209965631c5e10c426d1b6319a69caa06fb48707.tar.gz
dired: Add "touch -h" command
-rw-r--r--init.el1
-rw-r--r--lisp/km-dired.el9
2 files changed, 10 insertions, 0 deletions
diff --git a/init.el b/init.el
index 9c8cf9f..0c0b679 100644
--- a/init.el
+++ b/init.el
@@ -1281,6 +1281,7 @@
#'dired-copy-filename-as-kill)
(after 'dired
+ (define-key dired-mode-map "N" #'km/dired-touch-deref)
;; This overrides the default binding for `dired-copy-filename-as-kill'.
(define-key dired-mode-map "w" #'km/dired-copy-filename-map)
(bind-keys :map dired-mode-map
diff --git a/lisp/km-dired.el b/lisp/km-dired.el
index bbd38e6..148d376 100644
--- a/lisp/km-dired.el
+++ b/lisp/km-dired.el
@@ -20,6 +20,7 @@
;;; Code:
+(require 'dash)
(require 'dired)
(require 'org)
(require 'km-util)
@@ -75,6 +76,14 @@
flag))
(replace-match "" t nil nil 1)))
+;;;###autoload
+(defun km/dired-touch-deref (&optional arg)
+ "Run 'touch -h' on makred files (or next ARG)."
+ (interactive "p")
+ (setq arg (and current-prefix-arg arg))
+ (--when-let (dired-get-marked-files nil arg)
+ (apply #'call-process "touch" nil nil nil "-h" it)))
+
;;; Copying file names