tools/eshell: fix +eshell/switch
This commit is contained in:
parent
3fb7b24544
commit
08976dafdd
1 changed files with 9 additions and 8 deletions
|
@ -201,12 +201,13 @@ delete."
|
|||
(defun +eshell/switch (buffer)
|
||||
"Interactively switch to another eshell buffer."
|
||||
(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")
|
||||
(list (completing-read
|
||||
"Eshell buffers"
|
||||
(mapc #'buffer-name (delete (current-buffer) (ring-elements +eshell-buffers)))
|
||||
(mapcar #'buffer-name buffers)
|
||||
#'get-buffer
|
||||
'require-match
|
||||
nil nil (buffer-name (current-buffer))))))
|
||||
nil nil (buffer-name (current-buffer)))))))
|
||||
(switch-to-buffer buffer))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue