[slime-cvs] CVS slime/contrib

heller heller at common-lisp.net
Thu Sep 20 14:55:54 UTC 2007


Update of /project/slime/cvsroot/slime/contrib
In directory clnet:/tmp/cvs-serv27001

Modified Files:
	ChangeLog slime-asdf.el slime-autodoc.el slime-banner.el 
	slime-c-p-c.el slime-editing-commands.el 
	slime-fancy-inspector.el slime-fancy.el slime-fuzzy.el 
	slime-highlight-edits.el slime-presentations.el 
	slime-references.el slime-scratch.el slime-typeout-frame.el 
	swank-fancy-inspector.lisp 
Log Message:
Separate loading from initialization for many contribs.



--- /project/slime/cvsroot/slime/contrib/ChangeLog	2007/09/19 11:55:46	1.54
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2007/09/20 14:55:53	1.55
@@ -1,3 +1,24 @@
+2007-09-20  Helmut Eller  <heller at common-lisp.net>
+
+	Separate loading from initialization for many contribs.
+
+	* slime-asdf.el
+	* slime-autodoc.el
+	* slime-banner.el
+	* slime-c-p-c.el
+	* slime-editing-commands.el
+	* slime-fancy-inspector.el
+	* slime-fuzzy.el
+	* slime-highlight-edits.el
+	* slime-presentations.el
+	* slime-references.el
+	* slime-scratch.el
+	* slime-typeout-frame.el
+	* swank-fancy-inspector.lisp
+
+	* slime-fancy.el: As an exception, call the respective init
+	function when loading.
+
 2007-09-19  Helmut Eller  <heller at common-lisp.net>
 
 	* slime-c-p-c.el (slime-complete-symbol*-fancy): Move defcustom
--- /project/slime/cvsroot/slime/contrib/slime-asdf.el	2007/09/04 10:32:07	1.1
+++ /project/slime/cvsroot/slime/contrib/slime-asdf.el	2007/09/20 14:55:53	1.2
@@ -104,6 +104,10 @@
 (defun slime-asdf-on-connect ()
   (slime-eval-async '(swank:swank-require :swank-asdf)))
 
-(add-hook 'slime-connected-hook 'slime-asdf-on-connect)
+(defun slime-adsf-init ()
+  (add-hook 'slime-connected-hook 'slime-asdf-on-connect))
+
+(defun slime-adsf-unload ()
+  (remove-hook 'slime-connected-hook 'slime-asdf-on-connect))
 
 (provide 'slime-asdf)
--- /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2007/09/15 15:15:27	1.3
+++ /project/slime/cvsroot/slime/contrib/slime-autodoc.el	2007/09/20 14:55:53	1.4
@@ -263,6 +263,10 @@
   (when slime-use-autodoc-mode 
     (slime-autodoc-mode 1)))
 
-(slime-autodoc-init)
+(defun slime-autodoc-unload ()
+  (setq slime-echo-arglist-function 'slime-show-arglist)
+  (remove-hook 'slime-connected-hook 'slime-autodoc-on-connect)
+  (dolist (h '(slime-mode-hook slime-repl-mode-hook sldb-mode-hook))
+    (remove-hook h 'slime-autodoc-maybe-enable)))
 
 (provide 'slime-autodoc)
--- /project/slime/cvsroot/slime/contrib/slime-banner.el	2007/09/08 22:23:46	1.3
+++ /project/slime/cvsroot/slime/contrib/slime-banner.el	2007/09/20 14:55:53	1.4
@@ -35,6 +35,10 @@
           (animate-string welcome 0 0) 
         (insert welcome)))))
 
-(setq slime-repl-banner-function 'slime-startup-message)
+(defun slime-banner-init ()
+  (setq slime-repl-banner-function 'slime-startup-message))
+
+(defun slime-banner-unload ()
+  (setq slime-repl-banner-function 'slime-repl-insert-banner))
 
 (provide 'slime-banner)
--- /project/slime/cvsroot/slime/contrib/slime-c-p-c.el	2007/09/19 11:55:46	1.7
+++ /project/slime/cvsroot/slime/contrib/slime-c-p-c.el	2007/09/20 14:55:53	1.8
@@ -18,6 +18,7 @@
 
 
 
+(require 'slime)
 (require 'slime-parse)
 (require 'slime-editing-commands)
 
@@ -173,16 +174,29 @@
 
 ;;; Initialization
 
+(defvar slime-c-p-c-init-undo-stack nil)
+
 (defun slime-c-p-c-init ()
+  ;; save current state for unload
+  (push 
+   `(progn
+      (setq slime-complete-symbol-function ',slime-complete-symbol-function)
+      (remove-hook 'slime-connected-hook 'slime-c-p-c-on-connect)
+      (define-key slime-mode-map "\C-c\C-s"
+	',(lookup-key slime-mode-map "\C-c\C-s"))
+      (define-key slime-repl-mode-map "\C-c\C-s"
+	',(lookup-key slime-repl-mode-map "\C-c\C-s")))
+   slime-c-p-c-init-undo-stack)
   (setq slime-complete-symbol-function 'slime-complete-symbol*)
   (add-hook 'slime-connected-hook 'slime-c-p-c-on-connect)
   (define-key slime-mode-map "\C-c\C-s" 'slime-complete-form)
-  (define-key slime-repl-mode-map "\C-c\C-s" 'slime-complete-form)
-  )
+  (define-key slime-repl-mode-map "\C-c\C-s" 'slime-complete-form))
 
 (defun slime-c-p-c-on-connect ()
   (slime-eval-async '(swank:swank-require :swank-arglists)))
 
-(slime-c-p-c-init)
+(defun slime-c-p-c-unload ()
+  (while slime-c-p-c-init-undo-stack
+    (eval (pop slime-c-p-c-init-undo-stack))))
 
 (provide 'slime-c-p-c)
--- /project/slime/cvsroot/slime/contrib/slime-editing-commands.el	2007/09/11 18:08:20	1.4
+++ /project/slime/cvsroot/slime/contrib/slime-editing-commands.el	2007/09/20 14:55:53	1.5
@@ -186,6 +186,4 @@
   (define-key slime-mode-map "\M-\C-e"  'slime-end-of-defun)
   (define-key slime-mode-map "\C-c\M-q" 'slime-reindent-defun))
 
-(slime-editing-commands-init)
-
 (provide 'slime-editing-commands)
--- /project/slime/cvsroot/slime/contrib/slime-fancy-inspector.el	2007/08/23 17:46:31	1.1
+++ /project/slime/cvsroot/slime/contrib/slime-fancy-inspector.el	2007/09/20 14:55:53	1.2
@@ -9,11 +9,20 @@
 ;;
 ;;   (add-to-list 'load-path "<directory-of-this-file>")
 ;;   (add-hook 'slime-load-hook (lambda () (require 'slime-fancy-inspector)))
-;;
-
-(add-hook 'slime-connected-hook 'slime-install-fancy-inspector)
+;;   (add-hook 'slime-connected-hook 'slime-install-fancy-inspector)
 
 (defun slime-install-fancy-inspector ()
-  (slime-eval-async '(swank:swank-require :swank-fancy-inspector)))
+  (slime-eval-async '(swank:swank-require :swank-fancy-inspector)
+		    (lambda (_) 
+		      (slime-eval-async '(swank:fancy-inspector-init)))))
+
+(defun slime-deinstall-fancy-inspector ()
+  (slime-eval-async '(swank:fancy-inspector-unload)))
+
+(defun slime-fancy-inspector-init ()
+  (add-hook 'slime-connected-hook 'slime-install-fancy-inspector))
+
+(defun slime-fancy-inspector-unload ()
+  (remove-hook 'slime-connected-hook 'slime-install-fancy-inspector))
 
 (provide 'slime-fancy-inspector)
\ No newline at end of file
--- /project/slime/cvsroot/slime/contrib/slime-fancy.el	2007/09/11 10:00:24	1.2
+++ /project/slime/cvsroot/slime/contrib/slime-fancy.el	2007/09/20 14:55:53	1.3
@@ -1,4 +1,4 @@
-;;; slime-fancy.el --- Load all stable fancy SLIME contribs
+;;; slime-fancy.el --- Load and init some fancy SLIME contribs
 ;;
 ;; Authors: Matthias Koeppe  <mkoeppe at mail.math.uni-magdeburg.de>
 ;; 
@@ -19,28 +19,35 @@
 
 ;; Better arglist display, can be turned off by customization.
 (require 'slime-autodoc)
+(slime-autodoc-init)
 
 ;; Adds new commands and installs compound-prefix-completion as
 ;; default completion command.  Behaves similar to standard Emacs
 ;; completion, unless dashes are present. --mkoeppe
 (require 'slime-c-p-c)
+(slime-c-p-c-init)
 
-;; Just adds commands.
+;; Just adds commands.  (Well, shadows commands in lisp-mode-map)
 (require 'slime-editing-commands)
+(slime-editing-commands-init)
 
 ;; Makes the inspector fancier.
 (require 'slime-fancy-inspector)
+(slime-fancy-inspector-init)
 
 ;; Just adds the command C-c M-i.  We do not make fuzzy completion the
 ;; default completion invoked by TAB. --mkoeppe
 (require 'slime-fuzzy)
+(slime-fuzzy-init)
 
 (require 'slime-highlight-edits)
+(slime-highlight-edits-init)
 
 ;; Load slime-presentations even though they seem to be a
 ;; controversial feature, as they can be easily turned off by
 ;; customizing swank:*record-repl-results*. --mkoeppe
 (require 'slime-presentations)
+(slime-presentations-init)
 
 ;;; Do not load slime-presentation-streams, as this is an experimental
 ;;; feature that installs patches into some Lisps. --mkoeppe
@@ -53,10 +60,11 @@
 ;;(require 'slime-typeout-frame)
 
 ;; Just adds commands.
-(require 'slime-xref-browser)
+(when (locate-library "tree-widget")
+  (require 'slime-xref-browser))
 
 ;; Puts clickable references to documentation into SBCL errors.
 (require 'slime-references)
+(slime-references-init)
 
 (provide 'slime-fancy)
-
--- /project/slime/cvsroot/slime/contrib/slime-fuzzy.el	2007/09/10 11:01:01	1.3
+++ /project/slime/cvsroot/slime/contrib/slime-fuzzy.el	2007/09/20 14:55:53	1.4
@@ -595,6 +595,4 @@
 (defun slime-fuzzy-on-connect ()
   (slime-eval-async '(swank:swank-require :swank-fuzzy)))
 
-(slime-fuzzy-init)
-
 (provide 'slime-fuzzy)
--- /project/slime/cvsroot/slime/contrib/slime-highlight-edits.el	2007/09/15 15:15:27	1.2
+++ /project/slime/cvsroot/slime/contrib/slime-highlight-edits.el	2007/09/20 14:55:53	1.3
@@ -90,6 +90,10 @@
 
 (defun slime-highlight-edits-mode-on () (slime-highlight-edits-mode 1))
 
-(add-hook 'slime-mode-hook 'slime-highlight-edits-mode-on)
+(defun slime-highlight-edits-init ()
+  (add-hook 'slime-mode-hook 'slime-highlight-edits-mode-on))
+
+(defun slime-highlight-edits-unload ()
+  (remove-hook 'slime-mode-hook 'slime-highlight-edits-mode-on))
 
 (provide 'slime-highlight-edits)
\ No newline at end of file
--- /project/slime/cvsroot/slime/contrib/slime-presentations.el	2007/09/06 21:22:26	1.7
+++ /project/slime/cvsroot/slime/contrib/slime-presentations.el	2007/09/20 14:55:53	1.8
@@ -626,7 +626,7 @@
 
 ;;; Initialization
 
-(defun slime-presentation-init ()
+(defun slime-presentations-init ()
   (add-hook 'slime-repl-mode-hook
 	    (lambda ()
 	      ;; Respect the syntax text properties of presentation.
@@ -638,13 +638,12 @@
   (add-hook 'slime-repl-return-hooks 'slime-presentation-on-return-pressed)
   (add-hook 'slime-repl-current-input-hooks 'slime-presentation-current-input)
   (add-hook 'slime-open-stream-hooks 'slime-presentation-on-stream-open)
-  (add-hook 'slime-repl-clear-buffer-hook 'slime-clear-presentations))
-
-(slime-presentation-init)
-
-(add-hook 'slime-connected-hook 'slime-install-presentations)
+  (add-hook 'slime-repl-clear-buffer-hook 'slime-clear-presentations)
+  (add-hook 'slime-connected-hook 'slime-install-presentations))
 
 (defun slime-install-presentations ()
   (slime-eval-async '(swank:swank-require :swank-presentations)))
 
+(slime-presentations-init)
+
 (provide 'slime-presentations)
--- /project/slime/cvsroot/slime/contrib/slime-references.el	2007/09/10 21:38:35	1.3
+++ /project/slime/cvsroot/slime/contrib/slime-references.el	2007/09/20 14:55:53	1.4
@@ -124,8 +124,12 @@
 
 ;;; Initialization
 
-(setq slime-tree-printer 'slime-tree-print-with-references)
-
-(add-hook 'sldb-extras-hooks 'sldb-maybe-insert-references)
+(defun slime-references-init ()
+  (setq slime-tree-printer 'slime-tree-print-with-references)
+  (add-hook 'sldb-extras-hooks 'sldb-maybe-insert-references))
 
+(defun slime-references-unload ()
+  (setq slime-tree-printer 'slime-tree-default-printer)
+  (remove-hook 'sldb-extras-hooks 'sldb-maybe-insert-references))
+  
 (provide 'slime-references)
--- /project/slime/cvsroot/slime/contrib/slime-scratch.el	2007/09/04 10:18:44	1.3
+++ /project/slime/cvsroot/slime/contrib/slime-scratch.el	2007/09/20 14:55:53	1.4
@@ -40,8 +40,9 @@
 (slime-define-keys slime-scratch-mode-map
   ("\C-j" 'slime-eval-print-last-expression))
 
-(def-slime-selector-method ?s
-  "*slime-scratch* buffer."
-  (slime-scratch-buffer))
+(defun slime-scratch-init ()
+  (def-slime-selector-method ?s
+    "*slime-scratch* buffer."
+    (slime-scratch-buffer)))
 
 (provide 'slime-scratch)
\ No newline at end of file
--- /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el	2007/09/01 05:37:19	1.2
+++ /project/slime/cvsroot/slime/contrib/slime-typeout-frame.el	2007/09/20 14:55:53	1.3
@@ -56,12 +56,25 @@
 
 ;;; Initialization
 
-(defun slime-install-typeout-frame ()
+(defvar slime-typeout-frame-unbind-stack ())
+
+(defun slime-typeout-frame-init ()
   (add-hook 'slime-connected-hook 'slime-ensure-typeout-frame)
-  (setq slime-message-function #'slime-typeout-message)
-  (setq slime-background-message-function #'slime-typeout-message)
-  (setq slime-autodoc-message-function #'slime-typeout-autodoc-message))
+  (loop for (var value) in 
+	'((slime-message-function #'slime-typeout-message)
+	  (slime-background-message-function #'slime-typeout-message)
+	  (slime-autodoc-message-function #'slime-typeout-autodoc-message))
+	do (slime-typeout-frame-init-var var value)))
 
-(slime-install-typeout-frame)
+(defun slime-typeout-frame-init-var (var value)
+  (push (list var (if (boundp var) (symbol-value var) 'slime-unbound))
+	slime-typeout-frame-unbind-stack)
+  (set var value))
 
+(defun slime-typeout-frame-unload ()
+  (remove-hook 'slime-connected-hook 'slime-ensure-typeout-frame)
+  (loop for (var value) in slime-typeout-frame-unbind-stack 
+	do (cond ((eq var 'slime-unbound) (makunbound var))
+		 (t (set var value)))))
+  
 (provide 'slime-typeout-frame)
--- /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp	2007/09/15 11:29:22	1.3
+++ /project/slime/cvsroot/slime/contrib/swank-fancy-inspector.lisp	2007/09/20 14:55:53	1.4
@@ -721,6 +721,17 @@
                    content))
           (values title content)))))
 
-(setq *default-inspector* (make-instance 'fancy-inspector))
+(defvar *fancy-inpector-undo-list* nil)
+
+(defslimefun fancy-inspector-init ()
+  (let ((i *default-inspector*))
+    (push (lambda () (setq *default-inspector* i))
+	  *fancy-inpector-undo-list*))
+  (setq *default-inspector* (make-instance 'fancy-inspector))
+  t)
+
+(defslimefun fancy-inspector-unload ()
+  (loop while *fancy-inpector-undo-list* do
+	(funcall (pop *fancy-inpector-undo-list*))))
 
 (provide :swank-fancy-inspector)
\ No newline at end of file




More information about the slime-cvs mailing list