Better REPL/popwin integration

This commit is contained in:
Henrik Lissner 2015-12-09 02:09:47 -05:00
parent dae889f6c9
commit 20ab1acb6c

View file

@ -31,8 +31,10 @@
("*Agenda Commands*" :position bottom :height 0.5)
(" *Org todo*" :position bottom :height 5)
("*Org Links*" :position bottom :height 2)
("*ruby*" :position bottom :height 0.3 :stick t)
("*ielm*" :position bottom :height 0.3 :stick t)
;; REPLs
((lambda (buffer) (with-current-buffer buffer (derived-mode-p 'comint-mode)))
:position bottom :height 0.2 :stick t)
))
(popwin-mode 1)
@ -147,8 +149,15 @@
(if buffer (eq buffer popwin:popup-buffer) t)))
(defun narf/popup-close ()
(when (popwin:popup-window-live-p)
(popwin:close-popup-window t)))
(let ((popup-p (popwin:popup-window-live-p))
(comint-p (derived-mode-p 'comint-mode)))
(when comint-p
(when (eq rtog/--last-buffer (current-buffer))
(setq rtog/--last-buffer nil
narf-repl-buffer nil))
(kill-this-buffer))
(when popup-p
(popwin:close-popup-window t))))
(defun narf/popup-open (buffer &optional height)
(popwin:popup-buffer buffer))