summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el3
-rw-r--r--lisp/km-files.el8
2 files changed, 10 insertions, 1 deletions
diff --git a/init.el b/init.el
index 800dbd9..cd9bb3e 100644
--- a/init.el
+++ b/init.el
@@ -1717,7 +1717,8 @@
(use-package denote
:bind (("C-c d d" . denote)
- ("C-c d t" . denote-type))
+ ("C-c d t" . denote-type)
+ ("C-c d f" . km/find-file-with-denote-naming))
:config
(setq denote-directory
(expand-file-name (file-name-as-directory
diff --git a/lisp/km-files.el b/lisp/km-files.el
index 762afe5..5ec4a06 100644
--- a/lisp/km-files.el
+++ b/lisp/km-files.el
@@ -99,6 +99,14 @@ Use the current file name as initial input of prompt."
(defun km/read-recent-file ()
(completing-read "Choose recent file: " recentf-list nil t))
+;;;###autoload
+(defun km/find-file-with-denote-naming (file)
+ (interactive "F")
+ (find-file
+ (concat (file-name-directory file)
+ (format-time-string "%Y%m%dT%H%M%S--")
+ (file-name-nondirectory file))))
+
;;; Scratch files