Skip to content

Commit 2b210b4

Browse files
committed
Remove risky call to (buffer-file-name) when default-directory is safer
The latter is always set, but the first returns nil in non-file-backed buffers, which would lead to an error from `file-name-directory`.
1 parent 43141a8 commit 2b210b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

psci.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
Beware, can return nil if no .psci file is found."
8484
(if (and (fboundp 'projectile-project-root) (projectile-project-p))
8585
(projectile-project-root)
86-
(file-name-directory (buffer-file-name))))
86+
default-directory))
8787

8888
(defun psci/--process-name (buffer-name)
8989
"Compute the buffer's process name based on BUFFER-NAME."

0 commit comments

Comments
 (0)