Fix +eshell/toggle with arguments
Fixes: - Wrong-type-argument error when failing to display eshell buffer with pop-to-buffer, because it was killed (when prefix arg is non-nil). - Passes non-existent variable `buf` to +eshell-run-command.
This commit is contained in:
parent
6e8443c195
commit
be907350e4
1 changed files with 4 additions and 2 deletions
|
@ -92,7 +92,9 @@ project (or if prefix ARG was present)."
|
||||||
(when-let (win (get-buffer-window eshell-buffer))
|
(when-let (win (get-buffer-window eshell-buffer))
|
||||||
(delete-window win))
|
(delete-window win))
|
||||||
(when (buffer-live-p eshell-buffer)
|
(when (buffer-live-p eshell-buffer)
|
||||||
(kill-buffer eshell-buffer)))
|
(with-current-buffer eshell-buffer
|
||||||
|
(fundamental-mode)
|
||||||
|
(erase-buffer))))
|
||||||
(if-let (win (get-buffer-window eshell-buffer))
|
(if-let (win (get-buffer-window eshell-buffer))
|
||||||
(if (eq (selected-window) win)
|
(if (eq (selected-window) win)
|
||||||
(let (confirm-kill-processes)
|
(let (confirm-kill-processes)
|
||||||
|
@ -117,7 +119,7 @@ project (or if prefix ARG was present)."
|
||||||
(delete-region (match-end 0) (point-max)))
|
(delete-region (match-end 0) (point-max)))
|
||||||
(eshell-send-input))))
|
(eshell-send-input))))
|
||||||
(when command
|
(when command
|
||||||
(+eshell-run-command command buf))))))
|
(+eshell-run-command command eshell-buffer))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +eshell/here (arg &optional command)
|
(defun +eshell/here (arg &optional command)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue