1 ;;; geiser-reload.el -- unload/load geiser packages
3 ;; Copyright (C) 2009, 2010, 2012 Jose Antonio Ortega Ruiz
5 ;; This program is free software; you can redistribute it and/or
6 ;; modify it under the terms of the Modified BSD License. You should
7 ;; have received a copy of the license along with this program. If
8 ;; not, see <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>.
10 ;; Start date: Sat Aug 22, 2009 23:04
15 (require 'geiser-repl
)
16 (require 'geiser-mode
)
17 (require 'geiser-custom
)
18 (require 'geiser-base
)
20 (require 'geiser-load nil t
)
21 (require 'geiser-install nil t
)
26 (defmacro geiser--features-list
()
54 (defun geiser-unload ()
55 "Unload all Geiser modules."
57 (let ((fs (geiser--features-list)))
58 (unload-feature 'geiser-reload t
)
60 (when (featurep f
) (unload-feature f t
)))
61 (remove-hook 'scheme-mode-hook
'geiser-mode--maybe-activate
)))
63 (defun geiser-reload (&optional arg
)
65 With prefix arg, prompts for the DIRECTORY from which Geiser should be
68 (let* ((old-dir geiser-elisp-dir
)
69 (dir (or (and arg
(read-directory-name "New Geiser elisp dir: "
70 old-dir old-dir t old-dir
))
72 (unless (or (file-exists-p (expand-file-name "geiser-reload.el" dir
))
73 (file-exists-p (expand-file-name "geiser-reload.elc" dir
)))
74 (error "%s does not contain Geiser!" dir
))
75 (let ((memo (geiser-custom--memoized-state))
76 (repls (geiser-repl--repl-list))
77 (buffers (geiser-mode--buffers)))
79 (setq load-path
(remove old-dir load-path
))
80 (add-to-list 'load-path dir
)
81 (mapc (lambda (x) (set (car x
) (cdr x
))) memo
)
82 (require 'geiser-reload
)
83 (geiser-repl--restore repls
)
84 (geiser-mode--restore buffers
)
85 (message "Geiser reloaded!"))))
88 (provide 'geiser-reload
)