[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
common-lisp-indent'ation of def*
From: |
Juanma Barranquero |
Subject: |
common-lisp-indent'ation of def* |
Date: |
Mon, 23 Oct 2006 13:24:02 +0200 |
Drew Adams sent me the following problem with the common-lisp-indent code:
;; evaluate this
(progn
(unless (assoc "cl-indent" load-history)
(load "cl-indent"))
(set (make-local-variable 'lisp-indent-function)
'common-lisp-indent-function)
(put 'if 'common-lisp-indent-function
'(nil nil &body)))
(if ()
(deffoo bar
()) ;; indent this
(foo bar))
=> Wrong type argument: number-or-marker-p, (8 241)
`lisp-indent-line' fails because `calculate-lisp-indent' is returning
a list with '((8 241) 241), which, according to its docstring, it
shouldn't. The docstring says that the return value is either an
integer, or (COLUMN CONTAINING-SEXP-START).
`common-lisp-indent-function-1' is determining that `deffoo' has no
*lisp-indent-function property, but as it starts with `def', treats it
as a tentative defun, so it sends it to
`common-lisp-indent-call-method', which in turns sends it to
`lisp-indent-259', which returns the weird value.
So, is this a bug in `lisp-indent-line' (and the docstring of
`calculate-lisp-indent'), and '((8 241) 241) should be treated as
valid? Or, OTOH, it is a bug in `common-lisp-indent-function' and
friends?
--
/L/e/k/t/u
- common-lisp-indent'ation of def*,
Juanma Barranquero <=
- Re: common-lisp-indent'ation of def*, Richard Stallman, 2006/10/25
- Re: common-lisp-indent'ation of def*, Chong Yidong, 2006/10/26
- Re: common-lisp-indent'ation of def*, Juanma Barranquero, 2006/10/26
- Re: common-lisp-indent'ation of def*, Chong Yidong, 2006/10/26
- Re: common-lisp-indent'ation of def*, Juanma Barranquero, 2006/10/27
- Re: common-lisp-indent'ation of def*, Stefan Monnier, 2006/10/27
- Re: common-lisp-indent'ation of def*, Juanma Barranquero, 2006/10/27
- Re: common-lisp-indent'ation of def*, Richard Stallman, 2006/10/28
- Re: common-lisp-indent'ation of def*, Juanma Barranquero, 2006/10/28
- Re: common-lisp-indent'ation of def*, David Kastrup, 2006/10/28