0

I'm trying to write a function which opens or closes an eshell window. So far I have:

    (defun bottom-window-eshell()
      (interactive)
      (let ((buf (eshell)))
        (switch-to-buffer (other-buffer buf))
        (switch-to-buffer-other-window buf)))
3

1 Answer 1

2

Not sure what you're asking, but maybe something like this helps?

(defun bottom-window-eshell()
  (interactive)
  (unless (eq major-mode 'eshell-mode)
    (switch-to-buffer-other-window (eshell))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.