[slime-cvs] CVS slime/contrib

CVS User trittweiler trittweiler at common-lisp.net
Tue Apr 21 13:03:41 UTC 2009


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

Modified Files:
	slime-indentation-fu.el ChangeLog 
Log Message:
	* slime-indentantion-fu.el (slime-update-local-indentation): Save
	original global indentation spec in another symbol because we
	cannot reuse 'slime-indent. Make sure that later redefinition of
	global macros (which may affect the indentation spec) is taken
	into consideration.


--- /project/slime/cvsroot/slime/contrib/slime-indentation-fu.el	2009/03/27 20:32:55	1.2
+++ /project/slime/cvsroot/slime/contrib/slime-indentation-fu.el	2009/04/21 13:03:41	1.3
@@ -44,7 +44,8 @@
     (let* ((local-arglist (slime-enclosing-macro-arglist form-operator))
            (indent-spec   (if local-arglist
                               (slime-indentation-spec local-arglist)
-                              (get (intern-soft form-operator) 'slime-indent))))
+                              (get (intern-soft form-operator)
+                                   'slime-global-indent))))
       ;; If no &BODY appeared in the arglist, indent like a casual
       ;; function invocation.
       (unless indent-spec
@@ -53,9 +54,19 @@
        indent-spec path containing-form-start sexp-column normal-indent))))
 
 (defun slime-update-local-indentation (ops arg-indices points)
-  (loop for name in (car (slime-find-bound-macros ops arg-indices points)) do 
-        (put (intern name) 'slime-local-indent t) ; unused at the moment, for debugging.
-        (put (intern name) 'common-lisp-indent-function 'slime-indent-fu)))
+  (loop for name in (car (slime-find-bound-macros ops arg-indices points)) do
+        (let ((s (intern name)))
+          ;; N.B. cases to take into considerations: local macro is
+          ;; named like an already existing global macro; such a
+          ;; global macro is redefined with a different lambda-list;
+          ;; initially there's no global macro, but it's added later.
+          ;;
+          (put s 'slime-local-indent t)          ; unused at the moment, for debugging.
+          (unless (eq (get s 'common-lisp-indent-function) 'slime-indent-fu) 
+            (put s 'slime-global-indent (get s 'common-lisp-indent-function)))
+          (put s 'common-lisp-indent-function 'slime-indent-fu)
+          (put s 'slime-indent 'slime-indent-fu) ; for redefinition to be taken up
+          )))
 
 (defun slime-indentation-fu-init ()
   (add-hook 'slime-autodoc-hook 'slime-update-local-indentation))
--- /project/slime/cvsroot/slime/contrib/ChangeLog	2009/04/03 20:43:48	1.199
+++ /project/slime/cvsroot/slime/contrib/ChangeLog	2009/04/21 13:03:41	1.200
@@ -1,3 +1,11 @@
+2009-04-21  Tobias C. Rittweiler  <tcr at freebits.de>
+
+	* slime-indentantion-fu.el (slime-update-local-indentation): Save
+	original global indentation spec in another symbol because we
+	cannot reuse 'slime-indent. Make sure that later redefinition of
+	global macros (which may affect the indentation spec) is taken
+	into consideration.
+
 2009-04-03  Tobias C. Rittweiler  <tcr at freebits.de>
 
 	* slime-repl.el (slime-inspector-mode-map): Add binding for M-RET.





More information about the slime-cvs mailing list