summaryrefslogtreecommitdiff
path: root/elisp/geiser-popup.el
diff options
context:
space:
mode:
Diffstat (limited to 'elisp/geiser-popup.el')
-rw-r--r--elisp/geiser-popup.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/elisp/geiser-popup.el b/elisp/geiser-popup.el
index d412029..486d1d8 100644
--- a/elisp/geiser-popup.el
+++ b/elisp/geiser-popup.el
@@ -58,12 +58,18 @@
'(("q" . geiser-popup--quit))
(setq buffer-read-only t))
+
+;;; Support for defining popup buffers and accessors:
+
+(defvar geiser-popup--registry nil)
+
(defmacro geiser-popup--define (base name mode)
(let ((get-buff (intern (format "geiser-%s--buffer" base)))
(pop-buff (intern (format "geiser-%s--pop-to-buffer" base)))
(with-macro (intern (format "geiser-%s--with-buffer" base)))
(method (make-symbol "method")))
`(progn
+ (add-to-list 'geiser-popup--registry ,name)
(defun ,get-buff ()
(or (get-buffer ,name)
(with-current-buffer (get-buffer-create ,name)
@@ -84,5 +90,13 @@
(put 'geiser-popup--define 'lisp-indent-function 1)
+;;; Reload support:
+
+(defun geiser-popup-unload-function ()
+ (dolist (name geiser-popup--registry)
+ (when (buffer-live-p (get-buffer name))
+ (kill-buffer name))))
+
+
(provide 'geiser-popup)
;;; geiser-popup.el ends here