summaryrefslogtreecommitdiff
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
parent350c3ae07c4fa7e99c8f4e638cc2a381265909f4 (diff)
downloadgeiser-533102a1bfe4891ab6adc82ac0492ef2db285b27.tar.gz
geiser-533102a1bfe4891ab6adc82ac0492ef2db285b27.tar.bz2
geiser-reload works again (was broken for installed geiser).
-rw-r--r--elisp/geiser-base.el3
-rw-r--r--elisp/geiser-reload.el36
2 files changed, 18 insertions, 21 deletions
diff --git a/elisp/geiser-base.el b/elisp/geiser-base.el
index ba0067a..fca955a 100644
--- a/elisp/geiser-base.el
+++ b/elisp/geiser-base.el
@@ -27,7 +27,7 @@
;;; Emacs compatibility:
-(eval-when-compile (require 'cl))
+(require 'cl)
(eval-after-load "ring"
'(when (not (fboundp 'ring-member))
@@ -39,7 +39,6 @@
(when (not (fboundp 'completion-table-dynamic))
(defun completion-table-dynamic (fun)
- (require 'cl)
(lexical-let ((fun fun))
(lambda (string pred action)
(with-current-buffer (let ((win (minibuffer-selected-window)))
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)