diff options
Diffstat (limited to 'lisp/km-files.el')
-rw-r--r-- | lisp/km-files.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/km-files.el b/lisp/km-files.el index 9e9edc3..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 @@ -125,7 +133,7 @@ Prompt with characters from `km/find-scratch-buffers' to determine the extension of the scratch file. With prefix argument PWD, find the scratch file in -`default-directory' instead of /tmp." +`default-directory' instead of `temporary-file-directory'." (interactive "P") (switch-to-buffer (km/scratch--find-file-no-select pwd))) @@ -142,7 +150,8 @@ With prefix argument PWD, find the scratch file in (let* ((choices (mapcar #'car km/find-scratch-buffers)) (ch (read-char-choice (concat "[" choices "]") choices)) (ext (cadr (assq ch km/find-scratch-buffers)))) - (concat (if pwd default-directory "/tmp/") "scratch" ext))) + (expand-file-name (concat "scratch" ext) + (if pwd default-directory temporary-file-directory)))) (provide 'km-files) ;;; km-files.el ends here |