summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2022-12-26 18:00:38 -0500
committerKyle Meyer <kyle@kyleam.com>2024-01-22 00:02:53 -0500
commitf7bb5a314ac235641f9a6548850c3592da4af7ed (patch)
treeffa4666738b71769f7345fd7e7a877ad83b63142 /lisp
parentb52891b2fc01c52a92698e84f6d12e6658444e5f (diff)
downloademacs.d-f7bb5a314ac235641f9a6548850c3592da4af7ed.tar.gz
km/scratch-find-file: Don't hard code temp directory
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-files.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/km-files.el b/lisp/km-files.el
index 9e9edc3..762afe5 100644
--- a/lisp/km-files.el
+++ b/lisp/km-files.el
@@ -125,7 +125,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 +142,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