diff options
author | Kyle Meyer <kyle@kyleam.com> | 2022-12-26 17:56:57 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2024-01-22 00:02:53 -0500 |
commit | aa87c87aef7803511ae550c4d17a9eeba64af790 (patch) | |
tree | 7ac0183ecdec31a1255bd2e4bf0505d9975e801f | |
parent | 7863bba29a298f6403f4434fb94037209be0bf9f (diff) | |
download | emacs.d-aa87c87aef7803511ae550c4d17a9eeba64af790.tar.gz |
Add command to open a file with Denote-style naming
-rw-r--r-- | init.el | 3 | ||||
-rw-r--r-- | lisp/km-files.el | 8 |
2 files changed, 10 insertions, 1 deletions
@@ -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 |