tools/eshell: fix +eshell/switch

This commit is contained in:
Henrik Lissner 2018-03-28 17:32:35 -04:00
parent 3fb7b24544
commit 08976dafdd
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -201,12 +201,13 @@ delete."
(defun +eshell/switch (buffer) (defun +eshell/switch (buffer)
"Interactively switch to another eshell buffer." "Interactively switch to another eshell buffer."
(interactive (interactive
(if (ring-empty-p +eshell-buffers) (let ((buffers (delete (current-buffer) (ring-elements +eshell-buffers))))
(user-error "No eshell buffers are available") (if buffers
(list (completing-read (user-error "No eshell buffers are available")
"Eshell buffers" (list (completing-read
(mapc #'buffer-name (delete (current-buffer) (ring-elements +eshell-buffers))) "Eshell buffers"
#'get-buffer (mapcar #'buffer-name buffers)
'require-match #'get-buffer
nil nil (buffer-name (current-buffer)))))) 'require-match
nil nil (buffer-name (current-buffer)))))))
(switch-to-buffer buffer)) (switch-to-buffer buffer))