summaryrefslogtreecommitdiff
path: root/elisp/geiser-reload.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2009-08-23 20:22:22 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2009-08-23 20:22:22 +0200
commit533102a1bfe4891ab6adc82ac0492ef2db285b27 (patch)
tree02a1410d7fcf91fc4ff161fd8e57b237695fc91b /elisp/geiser-reload.el
parent350c3ae07c4fa7e99c8f4e638cc2a381265909f4 (diff)
downloadgeiser-533102a1bfe4891ab6adc82ac0492ef2db285b27.tar.gz
geiser-533102a1bfe4891ab6adc82ac0492ef2db285b27.tar.bz2
geiser-reload works again (was broken for installed geiser).
Diffstat (limited to 'elisp/geiser-reload.el')
-rw-r--r--elisp/geiser-reload.el36
1 files changed, 17 insertions, 19 deletions
diff --git a/elisp/geiser-reload.el b/elisp/geiser-reload.el
index f592164..97b398d 100644
--- a/elisp/geiser-reload.el
+++ b/elisp/geiser-reload.el
@@ -23,6 +23,8 @@
(require 'geiser-impl)
(require 'geiser-repl)
(require 'geiser-mode)
+(require 'geiser-base)
+(require 'geiser)
;;; Reload:
@@ -46,46 +48,42 @@
geiser-custom
geiser-base
geiser-popup
+ geiser-install
geiser
geiser-version
)))
-(defun geiser-reload-unload-function ()
- (dolist (feature (geiser--features-list))
- (when (featurep feature) (unload-feature feature t)))
- t)
-
(defun geiser-unload ()
+ "Unload all Geiser modules."
(interactive)
- (unload-feature 'geiser-reload))
+ (let ((fs (geiser--features-list)))
+ (unload-feature 'geiser-reload t)
+ (dolist (f fs)
+ (when (featurep f) (unload-feature f t)))))
(defun geiser-reload (&optional arg)
"Reload Geiser.
With prefix arg, prompts for the DIRECTORY from which Geiser should be
-loaded."
+loaded again."
(interactive "P")
(let* ((old-dir geiser-elisp-dir)
(dir (or (and arg (read-directory-name "New Geiser elisp dir: "
old-dir old-dir t old-dir))
- old-dir))
- (gf (expand-file-name "geiser.el" dir))
- (gfi (expand-file-name "geiser-install.el" dir)))
- (unless (or (file-exists-p gfi)
- (file-exists-p gf))
+ old-dir)))
+ (unless (or (file-exists-p (expand-file-name "geiser-reload.el" dir))
+ (file-exists-p (expand-file-name "geiser-reload.elc" dir)))
(error "%s does not contain Geiser!" dir))
- (let ((installed-impls geiser-impl-installed-implementations)
+ (let ((installed (featurep 'geiser-install))
+ (installed-impls geiser-impl-installed-implementations)
(impls geiser-impl--impls)
(repls (geiser-repl--repl-list))
(buffers (geiser-mode--buffers)))
- (setq load-path (remove geiser-elisp-dir load-path))
(geiser-unload)
+ (setq load-path (remove old-dir load-path))
(add-to-list 'load-path dir)
(setq geiser-impl-installed-implementations installed-impls)
- (if (file-exists-p gfi)
- (require 'geiser-install)
- (load-file gf))
- (dolist (feature (geiser--features-list))
- (load-library (format "%s" feature)))
+ (require 'geiser-reload)
+ (when installed (require 'geiser-install nil t))
(geiser-impl--reload-implementations impls)
(geiser-repl--restore repls)
(geiser-mode--restore buffers)