[slime-cvs] CVS slime/contrib
CVS User nsiivola
nsiivola at common-lisp.net
Thu Dec 8 13:40:55 UTC 2011
Update of /project/slime/cvsroot/slime/contrib
In directory tiger.common-lisp.net:/tmp/cvs-serv16116/contrib
Modified Files:
ChangeLog slime-cl-indent.el
Log Message:
slime-indentation: wrap initialization into a function
--- /project/slime/cvsroot/slime/contrib/ChangeLog 2011/12/06 18:57:18 1.523
+++ /project/slime/cvsroot/slime/contrib/ChangeLog 2011/12/08 13:40:55 1.524
@@ -1,3 +1,8 @@
+2011-12-08 Nikodemus Siivola <nikodemus at random-state.net>
+
+ * slime-cl-indent.el (common-lisp-init-standard-indentation): New function,
+ wraps initialization of the common-lisp-indent-function properties.
+
2011-12-06 Didier Verna <didier at xemacs.org>
* slime-asdf.el (slime-asdf): New custom group.
--- /project/slime/cvsroot/slime/contrib/slime-cl-indent.el 2011/12/03 15:38:19 1.59
+++ /project/slime/cvsroot/slime/contrib/slime-cl-indent.el 2011/12/08 13:40:55 1.60
@@ -1506,103 +1506,105 @@
;;;; Indentation specs for standard symbols, and a few semistandard ones.
-(let ((l '((block 1)
- (case (4 &rest (&whole 2 &rest 1)))
- (ccase (as case))
- (ecase (as case))
- (typecase (as case))
- (etypecase (as case))
- (ctypecase (as case))
- (catch 1)
- (cond (&rest (&whole 2 &rest nil)))
- ;; for DEFSTRUCT
- (:constructor (4 &lambda))
- (defvar (4 2 2))
- (defclass (6 (&whole 4 &rest 1) (&whole 2 &rest 1) (&whole 2 &rest 1)))
- (defconstant (as defvar))
- (defcustom (4 2 2 2))
- (defparameter (as defvar))
- (defconst (as defcustom))
- (define-condition (as defclass))
- (define-modify-macro (4 &lambda &body))
- (defsetf lisp-indent-defsetf)
- (defun (4 &lambda &body))
- (defgeneric (4 &lambda &body))
- (define-setf-method (as defun))
- (define-setf-expander (as defun))
- (defmacro (as defun))
- (defsubst (as defun))
- (deftype (as defun))
- (defmethod lisp-indent-defmethod)
- (defpackage (4 2))
- (defstruct ((&whole 4 &rest (&whole 2 &rest 1))
- &rest (&whole 2 &rest 1)))
- (destructuring-bind (&lambda 4 &body))
- (do lisp-indent-do)
- (do* (as do))
- (dolist ((&whole 4 2 1) &body))
- (dotimes (as dolist))
- (eval-when 1)
- (flet ((&whole 4 &rest (&whole 1 &lambda &body)) &body))
- (labels (as flet))
- (macrolet (as flet))
- (generic-flet (as flet))
- (generic-labels (as flet))
- (handler-case (4 &rest (&whole 2 &lambda &body)))
- (restart-case (as handler-case))
- ;; single-else style (then and else equally indented)
- (if (&rest nil))
- (if* common-lisp-indent-if*)
- (lambda (&lambda &rest lisp-indent-function-lambda-hack))
- (let ((&whole 4 &rest (&whole 1 1 2)) &body))
- (let* (as let))
- (compiler-let (as let))
- (handler-bind (as let))
- (restart-bind (as let))
- (locally 1)
- (loop lisp-indent-loop)
- (:method lisp-indent-defmethod) ; in `defgeneric'
- (multiple-value-bind ((&whole 6 &rest 1) 4 &body))
- (multiple-value-call (4 &body))
- (multiple-value-prog1 1)
- (multiple-value-setq (4 2))
- (multiple-value-setf (as multiple-value-setq))
- (named-lambda (4 &lambda &rest lisp-indent-function-lambda-hack))
- (pprint-logical-block (4 2))
- (print-unreadable-object ((&whole 4 1 &rest 1) &body))
- ;; Combines the worst features of BLOCK, LET and TAGBODY
- (prog (&lambda &rest lisp-indent-tagbody))
- (prog* (as prog))
- (prog1 1)
- (prog2 2)
- (progn 0)
- (progv (4 4 &body))
- (return 0)
- (return-from (nil &body))
- (symbol-macrolet (as let))
- (tagbody lisp-indent-tagbody)
- (throw 1)
- (unless 1)
- (unwind-protect (5 &body))
- (when 1)
- (with-accessors (as multiple-value-bind))
- (with-compilation-unit ((&whole 4 &rest 1) &body))
- (with-condition-restarts (as multiple-value-bind))
- (with-output-to-string (4 2))
- (with-slots (as multiple-value-bind))
- (with-standard-io-syntax (2)))))
- (dolist (el l)
- (let* ((name (car el))
- (spec (cdr el))
- (indentation
- (if (symbolp spec)
- (error "Old style indirect indentation spec: %s" el)
- (when (cdr spec)
- (error "Malformed indentation specification: %s" el))
- (car spec))))
- (unless (symbolp name)
- (error "Cannot set Common Lisp indentation of a non-symbol: %s" name))
- (put name 'common-lisp-indent-function indentation))))
+(defun common-lisp-init-standard-indentation ()
+ (let ((l '((block 1)
+ (case (4 &rest (&whole 2 &rest 1)))
+ (ccase (as case))
+ (ecase (as case))
+ (typecase (as case))
+ (etypecase (as case))
+ (ctypecase (as case))
+ (catch 1)
+ (cond (&rest (&whole 2 &rest nil)))
+ ;; for DEFSTRUCT
+ (:constructor (4 &lambda))
+ (defvar (4 2 2))
+ (defclass (6 (&whole 4 &rest 1) (&whole 2 &rest 1) (&whole 2 &rest 1)))
+ (defconstant (as defvar))
+ (defcustom (4 2 2 2))
+ (defparameter (as defvar))
+ (defconst (as defcustom))
+ (define-condition (as defclass))
+ (define-modify-macro (4 &lambda &body))
+ (defsetf lisp-indent-defsetf)
+ (defun (4 &lambda &body))
+ (defgeneric (4 &lambda &body))
+ (define-setf-method (as defun))
+ (define-setf-expander (as defun))
+ (defmacro (as defun))
+ (defsubst (as defun))
+ (deftype (as defun))
+ (defmethod lisp-indent-defmethod)
+ (defpackage (4 2))
+ (defstruct ((&whole 4 &rest (&whole 2 &rest 1))
+ &rest (&whole 2 &rest 1)))
+ (destructuring-bind (&lambda 4 &body))
+ (do lisp-indent-do)
+ (do* (as do))
+ (dolist ((&whole 4 2 1) &body))
+ (dotimes (as dolist))
+ (eval-when 1)
+ (flet ((&whole 4 &rest (&whole 1 &lambda &body)) &body))
+ (labels (as flet))
+ (macrolet (as flet))
+ (generic-flet (as flet))
+ (generic-labels (as flet))
+ (handler-case (4 &rest (&whole 2 &lambda &body)))
+ (restart-case (as handler-case))
+ ;; single-else style (then and else equally indented)
+ (if (&rest nil))
+ (if* common-lisp-indent-if*)
+ (lambda (&lambda &rest lisp-indent-function-lambda-hack))
+ (let ((&whole 4 &rest (&whole 1 1 2)) &body))
+ (let* (as let))
+ (compiler-let (as let))
+ (handler-bind (as let))
+ (restart-bind (as let))
+ (locally 1)
+ (loop lisp-indent-loop)
+ (:method lisp-indent-defmethod) ; in `defgeneric'
+ (multiple-value-bind ((&whole 6 &rest 1) 4 &body))
+ (multiple-value-call (4 &body))
+ (multiple-value-prog1 1)
+ (multiple-value-setq (4 2))
+ (multiple-value-setf (as multiple-value-setq))
+ (named-lambda (4 &lambda &rest lisp-indent-function-lambda-hack))
+ (pprint-logical-block (4 2))
+ (print-unreadable-object ((&whole 4 1 &rest 1) &body))
+ ;; Combines the worst features of BLOCK, LET and TAGBODY
+ (prog (&lambda &rest lisp-indent-tagbody))
+ (prog* (as prog))
+ (prog1 1)
+ (prog2 2)
+ (progn 0)
+ (progv (4 4 &body))
+ (return 0)
+ (return-from (nil &body))
+ (symbol-macrolet (as let))
+ (tagbody lisp-indent-tagbody)
+ (throw 1)
+ (unless 1)
+ (unwind-protect (5 &body))
+ (when 1)
+ (with-accessors (as multiple-value-bind))
+ (with-compilation-unit ((&whole 4 &rest 1) &body))
+ (with-condition-restarts (as multiple-value-bind))
+ (with-output-to-string (4 2))
+ (with-slots (as multiple-value-bind))
+ (with-standard-io-syntax (2)))))
+ (dolist (el l)
+ (let* ((name (car el))
+ (spec (cdr el))
+ (indentation
+ (if (symbolp spec)
+ (error "Old style indirect indentation spec: %s" el)
+ (when (cdr spec)
+ (error "Malformed indentation specification: %s" el))
+ (car spec))))
+ (unless (symbolp name)
+ (error "Cannot set Common Lisp indentation of a non-symbol: %s" name))
+ (put name 'common-lisp-indent-function indentation)))))
+(common-lisp-init-standard-indentation)
(defun common-lisp-indent-test (name bindings test)
(with-temp-buffer
More information about the slime-cvs
mailing list