summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorGerd Moellmann <gerd@gnu.org>2001-08-15 11:57:03 +0000
committerGerd Moellmann <gerd@gnu.org>2001-08-15 11:57:03 +0000
commitec69d5ec2bb5f7428545d81422a89d87326592b2 (patch)
tree1ee6920cfe79d842241f664c09cdd07aad34fa17 /lisp/emacs-lisp
parent3e6f08e6f06e9058fc0f802ec58d8849c8b266ca (diff)
downloademacs-ec69d5ec2bb5f7428545d81422a89d87326592b2.tar.gz
emacs-ec69d5ec2bb5f7428545d81422a89d87326592b2.tar.bz2
emacs-ec69d5ec2bb5f7428545d81422a89d87326592b2.zip
(lisp-indent-defmethod): New function.
(toplevel): Set it as `common-lisp-indent-function' for `defmethod'.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/cl-indent.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el
index c03beb2a40c..69620763414 100644
--- a/lisp/emacs-lisp/cl-indent.el
+++ b/lisp/emacs-lisp/cl-indent.el
@@ -355,6 +355,18 @@ by `lisp-body-indent'."
(&whole nil &rest 1))
path state indent-point sexp-column normal-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-+:"))
+ '(4 4 (&whole 4 &rest 4) &body)
+ (get 'defun 'common-lisp-indent-function))
+ path state indent-point sexp-column normal-indent))
+
+
(defun lisp-indent-function-lambda-hack (path state indent-point
sexp-column normal-indent)
;; indent (function (lambda () <newline> <body-forms>)) kludgily.
@@ -393,9 +405,7 @@ by `lisp-body-indent'."
(define-setf-method . defun)
(define-setf-expander . defun)
(defmacro . defun) (defsubst . defun) (deftype . defun)
- ;; The following indents the first line of the body of a
- ;; defmethod wrong.
- ;(defmethod (4 4 (&whole 4 &rest 1) &body))
+ (defmethod lisp-indent-defmethod)
(defpackage (4 2))
(defstruct ((&whole 4 &rest (&whole 2 &rest 1))
&rest (&whole 2 &rest 1)))