1 ;; geiser-reload.el -- unload/load geiser packages
3 ;; Copyright (C) 2009, 2010 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
14 (require 'geiser-repl
)
15 (require 'geiser-mode
)
16 (require 'geiser-custom
)
17 (require 'geiser-base
)
19 (require 'geiser-load nil t
)
20 (require 'geiser-install nil t
)
25 (defmacro geiser--features-list
()
51 (defun geiser-unload ()
52 "Unload all Geiser modules."
54 (let ((fs (geiser--features-list)))
55 (unload-feature 'geiser-reload t
)
57 (when (featurep f
) (unload-feature f t
)))))
59 (defun geiser-reload (&optional arg
)
61 With prefix arg, prompts for the DIRECTORY from which Geiser should be
64 (let* ((old-dir geiser-elisp-dir
)
65 (dir (or (and arg
(read-directory-name "New Geiser elisp dir: "
66 old-dir old-dir t old-dir
))
68 (unless (or (file-exists-p (expand-file-name "geiser-reload.el" dir
))
69 (file-exists-p (expand-file-name "geiser-reload.elc" dir
)))
70 (error "%s does not contain Geiser!" dir
))
71 (let ((memo (geiser-custom--memoized-state))
72 (repls (geiser-repl--repl-list))
73 (buffers (geiser-mode--buffers)))
75 (setq load-path
(remove old-dir load-path
))
76 (add-to-list 'load-path dir
)
77 (mapc (lambda (x) (set (car x
) (cdr x
))) memo
)
78 (require 'geiser-reload
)
79 (geiser-repl--restore repls
)
80 (geiser-mode--restore buffers
)
81 (message "Geiser reloaded!"))))
84 (provide 'geiser-reload
)
85 ;;; geiser-reload.el ends here