summaryrefslogtreecommitdiff
path: root/elisp/geiser.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-04 02:07:41 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-03-04 02:07:41 +0100
commit902b7685194e9adfcd19d518a45dae3c4b13a90b (patch)
tree5558ffadf7779ec3ff8238f9ea2a8b4bef5cbf1c /elisp/geiser.el
parenta4b7db53db0d05b8a39c263715a296d64b4f64f4 (diff)
downloadgeiser-chez-902b7685194e9adfcd19d518a45dae3c4b13a90b.tar.gz
geiser-chez-902b7685194e9adfcd19d518a45dae3c4b13a90b.tar.bz2
New geiser-reload command. New geiser command.
Diffstat (limited to 'elisp/geiser.el')
-rw-r--r--elisp/geiser.el64
1 files changed, 64 insertions, 0 deletions
diff --git a/elisp/geiser.el b/elisp/geiser.el
index 3bdc218..ea41779 100644
--- a/elisp/geiser.el
+++ b/elisp/geiser.el
@@ -45,6 +45,9 @@
;;; Autoloads:
+(autoload 'geiser "geiser-repl.el"
+ "Start a Geiser REPL, or switch to a running one." t)
+
(autoload 'run-guile "geiser-repl.el"
"Start a Geiser Guile REPL, or switch to a running one." t)
@@ -70,5 +73,66 @@
(geiser-setup-scheme-mode))
+;;; Reload:
+
+(defmacro geiser--features-list ()
+ (quote '(
+ geiser-mode
+ geiser-repl
+ geiser-doc
+ geiser-edit
+ geiser-completion
+ geiser-autodoc
+ geiser-compile
+ geiser-debug
+ geiser-eval
+ geiser-connection
+ geiser-syntax
+ geiser-log
+ geiser-custom
+ geiser-base
+ geiser-popup
+ )))
+
+(defun geiser-unload-function ()
+ (dolist (feature (geiser--features-list))
+ (when (featurep feature) (unload-feature feature t)))
+ t)
+
+(defun geiser-unload ()
+ (interactive)
+ (when (featurep 'geiser) (unload-feature 'geiser)))
+
+(defun geiser-reload (&optional arg)
+ "Reload Geiser.
+With prefix arg, prompts for the DIRECTORY in which Geiser should be
+loaded."
+ (interactive "P")
+ (let* ((dir (or (and arg (read-directory-name "New Geiser root dir: "
+ geiser-root-dir
+ geiser-root-dir
+ t
+ geiser-root-dir))
+ geiser-root-dir))
+ (geiser-main-file (expand-file-name "elisp/geiser.el" dir))
+ (repl (and (featurep 'geiser-repl) (geiser-repl--live-p)))
+ (buffers (and (featurep 'geiser-mode) (geiser-mode--buffers))))
+ (unless (file-exists-p geiser-main-file)
+ (error "%s does not contain Geiser!" dir))
+ (remove geiser-elisp-dir load-path)
+ (geiser-unload)
+ (load-file geiser-main-file)
+ (geiser-setup)
+ (when repl
+ (load-library "geiser-repl")
+ (geiser 'repl))
+ (when buffers
+ (load-library "geiser-mode")
+ (dolist (b buffers)
+ (set-buffer b)
+ (geiser-mode 1)))
+ (message "Geiser reloaded!")))
+
+
(provide 'geiser)
;;; geiser.el ends here