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))))
(if buffers
(user-error "No eshell buffers are available") (user-error "No eshell buffers are available")
(list (completing-read (list (completing-read
"Eshell buffers" "Eshell buffers"
(mapc #'buffer-name (delete (current-buffer) (ring-elements +eshell-buffers))) (mapcar #'buffer-name buffers)
#'get-buffer #'get-buffer
'require-match 'require-match
nil nil (buffer-name (current-buffer)))))) nil nil (buffer-name (current-buffer)))))))
(switch-to-buffer buffer)) (switch-to-buffer buffer))