]> git.eshelyaron.com Git - emacs.git/commitdiff
(lisp-indent-defmethod): At first three elements, act like defun.
authorRichard M. Stallman <rms@gnu.org>
Mon, 19 Nov 2001 06:24:05 +0000 (06:24 +0000)
committerRichard M. Stallman <rms@gnu.org>
Mon, 19 Nov 2001 06:24:05 +0000 (06:24 +0000)
Advance to start of 3rd sexp by moving fwd and backing over it.

lisp/emacs-lisp/cl-indent.el

index fee555d3ed32479230dd0f7c70dc59e35d3d8dcb..5b22be7206d275966feae64e126888b98258a5e1 100644 (file)
@@ -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))