Fix nil value in call to buffer-file-name

This commit is contained in:
Daniel Borchmann 2026-04-02 18:59:54 +02:00
parent 71e4cee886
commit 09b4b4dbb9
No known key found for this signature in database
GPG Key ID: 50EA937BF472ADD1

View File

@ -44,7 +44,9 @@ Switch to an existing eshell buffer open in the current directory.
Create an eshell buffer otherwise."
(interactive)
(if (not (derived-mode-p 'eshell-mode))
(let* ((cwd (or (file-name-directory (buffer-file-name (current-buffer)))
(let* ((cwd (or (-some->> (current-buffer)
buffer-file-name
file-name-directory)
default-directory))
(eshell-buffer (--> (buffer-list)
(-filter #'(lambda (buf)