commit f66912cf6669070141db8f2f58210628641e1080 parent 0203be4272452d5b2e8b1454431cefc43706957d Author: dwrz <dwrz@dwrz.net> Date: Sat, 8 Jul 2023 15:20:11 +0000 Refactor emacs shell-in-current-directory Diffstat:
M | emacs/init.el | | | 9 | +++++---- |
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el @@ -46,10 +46,11 @@ (defun shell-in-current-directory () "Start a unique shell in the current directory." (interactive) - (let ((default-directory (if (buffer-file-name) - (file-name-directory (buffer-file-name)) - default-directory)) - (shell-buffer-name "*shell*")) + (let* ((default-directory (if (buffer-file-name) + (file-name-directory (buffer-file-name)) + default-directory)) + (dir-path (expand-file-name default-directory)) + (shell-buffer-name (concat "*shell:" dir-path "*"))) (shell (generate-new-buffer-name shell-buffer-name)))) (defun dwrz-org-capture-at-point ()