[slime-cvs] CVS slime

CVS User trittweiler trittweiler at common-lisp.net
Thu May 13 15:31:06 UTC 2010


Update of /project/slime/cvsroot/slime
In directory cl-net:/tmp/cvs-serv26251

Modified Files:
	ChangeLog slime.el 
Log Message:
	* slime.el (define-slime-contrib): New macro.

	* slime-autodoc.el, slime-c-p-c.el, slime-compiler-notes-tree.el,
	slime-enclosing-context.el, slime-fancy.el, slime-fuzzy.el,
	slime-hyperdoc.el, slime-mdot-fu.el, slime-mrepl.el,
	slime-parse.el, slime-presentations.el, slime-repl.el,
	slime-snapshot.el, slime-tramp.el, slime-xref-browser.el:

	Use newly added `define-slime-contrib' macro to specify
	slime and swank dependencies, and to specify what should happen on
	contrib load/unload.


--- /project/slime/cvsroot/slime/ChangeLog	2010/05/13 04:59:11	1.2091
+++ /project/slime/cvsroot/slime/ChangeLog	2010/05/13 15:31:06	1.2092
@@ -1,5 +1,9 @@
 2010-05-13  Tobias C. Rittweiler <tcr at freebits.de>
 
+	* slime.el (define-slime-contrib): New macro.
+
+2010-05-13  Tobias C. Rittweiler <tcr at freebits.de>
+
 	* swank.lisp (*after-init-hook*, simple-break)
 	(coerce-to-condition, use-threads-p, current-thread-id): Moved
 	around in swank.lisp.
--- /project/slime/cvsroot/slime/slime.el	2010/05/11 13:11:13	1.1316
+++ /project/slime/cvsroot/slime/slime.el	2010/05/13 15:31:06	1.1317
@@ -7074,7 +7074,6 @@
 (defvar slime-required-modules '())
 
 (defun slime-require (module)
-  (assert (keywordp module))
   (pushnew module slime-required-modules)
   (when (slime-connected-p)
     (slime-load-contribs)))
@@ -7091,6 +7090,38 @@
       (setf (slime-lisp-modules) 
             (slime-eval `(swank:swank-require ',needed))))))
 
+(defmacro define-slime-contrib (name docstring &rest clauses)
+  (let ((slime-deps   '())
+        (swank-deps   '())
+        (load-forms   '())
+        (unload-forms '())
+        (gnu-only-p nil))
+    (dolist (clause clauses)
+      (destructure-case clause
+        ((:slime-dependencies . deps) (setq slime-deps deps))
+        ((:swank-dependencies . deps) (setq swank-deps deps))
+        ((:on-load   . forms)         (setq load-forms forms))
+        ((:on-unload . forms)         (setq unload-forms forms))
+        ((:gnu-emacs-only flag)       (setq gnu-only-p flag))
+        ((:authors . authors))
+        ((:license license))))
+    `(progn
+       ,(when gnu-only-p
+         `(eval-and-compile
+            (assert (not (featurep 'xemacs)) ()
+                    ,(concat (symbol-name name)
+                             " does not work with XEmacs."))))
+       ,@(mapcar #'(lambda (d) `(require ',d)) slime-deps)
+       (defun ,(intern (concat (symbol-name name) "-init")) ()
+         ,@(mapcar #'(lambda (d) `(slime-require ',d)) swank-deps)
+         , at load-forms)
+       (defun ,(intern (concat (symbol-name name) "-unload")) ()
+         , at unload-forms)
+       (provide ',name))))
+
+(put 'define-slime-contrib 'lisp-indent-function 1)
+(put 'slime-indulge-pretty-colors 'define-slime-contrib t)
+
 
 ;;;;; Pull-down menu
 





More information about the slime-cvs mailing list