Peter Seibel writes:
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
SLIME does by default nothing special for macros starting with "with-" of "def" because doing so messes up the indentation of defmethod in some implementations. You can change the default by setting slime-conservative-indentation.
So that variable is set to t and lisp-indent-function's value is common-lisp-indent-function yet I'm still getting "special" indentation of lines following a "def" form. Which is particularly ignoring in cases like this (indented with indent-sexp):
(defclass column () ((name :accessor name :initarg :name) (default-value-fn :accessor default-value-fn ;;; <<---- note extra indentation :initarg :default-value-fn)))
What am I doing wrong?
You're not using the right lisp-indent-function! The one coming with emacs (and I guess the other one coming with slime) lack a (looking-at ":") disjonction.
diff -c /tmp/b /tmp/a *** /tmp/b 2004-10-07 01:06:07.000000000 +0200 --- /tmp/a 2004-10-07 01:05:46.000000000 +0200 *************** *** 3,9 **** (goto-char (1+ (elt state 1))) (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) (if (and (elt state 2) ! (or (looking-at ":") (not (looking-at "\sw\|\s_")))) ;; car of form doesn't seem to be a symbol (progn (if (not (> (save-excursion (forward-line 1) (point)) --- 3,9 ---- (goto-char (1+ (elt state 1))) (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) (if (and (elt state 2) ! (not (looking-at "\sw\|\s_"))) ;; car of form doesn't seem to be a symbol (progn (if (not (> (save-excursion (forward-line 1) (point))
;; extracted from ~pascal/.emacs:
(require 'lisp-mode)
(defun lisp-indent-function (indent-point state) (let ((normal-indent (current-column))) (goto-char (1+ (elt state 1))) (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t) (if (and (elt state 2) (or (looking-at ":") (not (looking-at "\sw\|\s_")))) ;; car of form doesn't seem to be a symbol (progn (if (not (> (save-excursion (forward-line 1) (point)) calculate-lisp-indent-last-sexp)) (progn (goto-char calculate-lisp-indent-last-sexp) (beginning-of-line) (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t))) ;; Indent under the list or under the first sexp on the same ;; line as calculate-lisp-indent-last-sexp. Note that first ;; thing on that line has to be complete sexp since we are ;; inside the innermost containing sexp. (backward-prefix-chars) (current-column)) (let ((function (buffer-substring (point) (progn (forward-sexp 1) (point)))) method) (setq method (or (get (intern-soft function) 'lisp-indent-function) (get (intern-soft function) 'lisp-indent-hook))) (cond ((or (eq method 'defun) (and (null method) (> (length function) 3) (string-match "\`def" function))) (lisp-indent-defform state indent-point)) ((integerp method) (lisp-indent-specform method state indent-point normal-indent)) (method (funcall method state indent-point)))))));;lisp-indent-function