From: Richard M. Stallman Date: Mon, 19 Nov 2001 06:24:05 +0000 (+0000) Subject: (lisp-indent-defmethod): At first three elements, act like defun. X-Git-Tag: ttn-vms-21-2-B4~18389 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c2988498965503ba210043abca8928d96e6aabd8;p=emacs.git (lisp-indent-defmethod): At first three elements, act like defun. Advance to start of 3rd sexp by moving fwd and backing over it. --- diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index fee555d3ed3..5b22be7206d 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -358,10 +358,13 @@ by `lisp-body-indent'." (defun lisp-indent-defmethod (path state indent-point sexp-column normal-indent) "Indentation function defmethod." - (lisp-indent-259 (if (save-excursion (goto-char (elt state 1)) - (forward-char 1) - (forward-sexp 2) - (looking-at "\\s-+:")) + (lisp-indent-259 (if (and (>= (first path) 3) + (null (rest path)) + (save-excursion (goto-char (elt state 1)) + (forward-char 1) + (forward-sexp 3) + (backward-sexp) + (looking-at ":"))) '(4 4 (&whole 4 &rest 4) &body) (get 'defun 'common-lisp-indent-function)) path state indent-point sexp-column normal-indent))