diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-08-23 20:22:22 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2009-08-23 20:22:22 +0200 |
commit | bd998e8d6ed692a6d08d5f06f2d7dd55191e7a20 (patch) | |
tree | d4bd2c98424d9ebd05d10f5b865aafa89a6aad45 /elisp | |
parent | 1762b7b9b30ab42e878f9a3887a81f3133417062 (diff) | |
download | geiser-chez-bd998e8d6ed692a6d08d5f06f2d7dd55191e7a20.tar.gz geiser-chez-bd998e8d6ed692a6d08d5f06f2d7dd55191e7a20.tar.bz2 |
geiser-reload works again (was broken for installed geiser).
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/geiser-base.el | 3 | ||||
-rw-r--r-- | elisp/geiser-reload.el | 36 |
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) |