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)
|
(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))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue