[slime-cvs] CVS update: slime/slime.el

Luke Gorrie lgorrie at common-lisp.net
Fri Jul 16 21:38:41 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv13946

Modified Files:
	slime.el 
Log Message:
(slime-conservative-indentation): New variable. When true (the
default) don't auto-learn indentation of def* and with-* macros. Set
to nil if you want to learn them.  (slime-handle-indentation-update):
Use it.

Date: Fri Jul 16 14:38:40 2004
Author: lgorrie

Index: slime/slime.el
diff -u slime/slime.el:1.368 slime/slime.el:1.369
--- slime/slime.el:1.368	Fri Jul 16 13:55:00 2004
+++ slime/slime.el	Fri Jul 16 14:38:40 2004
@@ -6679,6 +6679,9 @@
 
 ;;; Indentation
 
+(defcustom slime-conservative-indentation t
+  "If true then don't discover indentation of \"with-\" or \"def\" symbols.")
+
 (defun slime-update-indentation ()
   "Update indentation for all macros defined in the Lisp system."
   (interactive)
@@ -6691,14 +6694,16 @@
 settings for `common-lisp-indent-function'. The appropriate property
 is setup, unless the user already set one explicitly."
   (dolist (info alist)
-    (let* ((symbol-name (car info))
-           (symbol (intern symbol-name))
-           (indent (cdr info)))
-      ;; Does the symbol have an indentation value that we set?
-      (when (equal (get symbol 'common-lisp-indent-function)
-                   (get symbol 'slime-indent))
-        (put symbol 'slime-indent indent)
-        (put symbol 'common-lisp-indent-function indent)))))
+    (let ((symbol-name (car info)))
+      (unless (and slime-conservative-indentation
+                   (string-match "^\\(def\\|\\with-\\)" symbol-name))
+        (let ((symbol (intern symbol-name))
+              (indent (cdr info)))
+          ;; Does the symbol have an indentation value that we set?
+          (when (equal (get symbol 'common-lisp-indent-function)
+                       (get symbol 'slime-indent))
+            (put symbol 'slime-indent indent)
+            (put symbol 'common-lisp-indent-function indent)))))))
 
 (defun slime-reindent-defun (&optional force-text-fill)
   "Reindent the current defun, or refill the current paragraph.





More information about the slime-cvs mailing list