all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* common-lisp-indent'ation of def*
@ 2006-10-23 11:24 Juanma Barranquero
  2006-10-25 18:03 ` Richard Stallman
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2006-10-23 11:24 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-23 11:24 common-lisp-indent'ation of def* Juanma Barranquero
@ 2006-10-25 18:03 ` Richard Stallman
  2006-10-26 20:42   ` Chong Yidong
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2006-10-25 18:03 UTC (permalink / raw)
  Cc: emacs-devel

    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?

Since the callers of `lisp-indent-line' fail when it returns such a
value, I conclude they agree with its documentation.  So I conclude
that the bug is in `common-lisp-indent-function' and its subroutines.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-25 18:03 ` Richard Stallman
@ 2006-10-26 20:42   ` Chong Yidong
  2006-10-26 22:10     ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Chong Yidong @ 2006-10-26 20:42 UTC (permalink / raw)
  Cc: Juanma Barranquero, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     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?
>
> Since the callers of `lisp-indent-line' fail when it returns such a
> value, I conclude they agree with its documentation.  So I conclude
> that the bug is in `common-lisp-indent-function' and its subroutines.

I concur.  I've checked in a fix.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-26 20:42   ` Chong Yidong
@ 2006-10-26 22:10     ` Juanma Barranquero
  2006-10-27  0:53       ` Chong Yidong
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2006-10-26 22:10 UTC (permalink / raw)
  Cc: emacs-devel

On 10/26/06, Chong Yidong <cyd@stupidchicken.com> wrote:

> I concur.  I've checked in a fix.

Thanks.

Now I'm seeing something weird. After eval'ing the progn, doing M-C-q
at the start of the if gives:

 (if ()
     (deffoo bar
	 ()) ;; indent this
     (foo bar))

However, hitting TAB in each line gives:

 (if ()
     (deffoo bar
	 ()) ;; indent this
   (foo bar))

Is that expected?

-- 
                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-26 22:10     ` Juanma Barranquero
@ 2006-10-27  0:53       ` Chong Yidong
  2006-10-27  8:15         ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Chong Yidong @ 2006-10-27  0:53 UTC (permalink / raw)
  Cc: emacs-devel

"Juanma Barranquero" <lekktu@gmail.com> writes:

> Now I'm seeing something weird. After eval'ing the progn, doing M-C-q
> at the start of the if gives:
>
> (if ()
>     (deffoo bar
> 	 ()) ;; indent this
>     (foo bar))
>
> However, hitting TAB in each line gives:
>
> (if ()
>     (deffoo bar
> 	 ()) ;; indent this
>   (foo bar))
>
> Is that expected?

No.  I've checked in a fix for the fix.  I think it's right, but the
code in cl-indent.el is pretty grungy :-(

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-27  0:53       ` Chong Yidong
@ 2006-10-27  8:15         ` Juanma Barranquero
  2006-10-27 13:31           ` Stefan Monnier
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2006-10-27  8:15 UTC (permalink / raw)


On 10/27/06, Chong Yidong <cyd@stupidchicken.com> wrote:

> I've checked in a fix for the fix.

Yeah, now it works. Thanks.

> I think it's right, but the
> code in cl-indent.el is pretty grungy :-(

That's why I just reported the bug. I love cl*.el, but the code makes me dizzy.

-- 
                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-27  8:15         ` Juanma Barranquero
@ 2006-10-27 13:31           ` Stefan Monnier
  2006-10-27 14:23             ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2006-10-27 13:31 UTC (permalink / raw)
  Cc: emacs-devel

> That's why I just reported the bug. I love cl*.el, but the code makes
> me dizzy.

Yup.  Lucky it doesn't have any confusing comments ;-)


        Stefan

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-27 13:31           ` Stefan Monnier
@ 2006-10-27 14:23             ` Juanma Barranquero
  2006-10-28 18:13               ` Richard Stallman
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2006-10-27 14:23 UTC (permalink / raw)
  Cc: emacs-devel

On 10/27/06, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> Yup.  Lucky it doesn't have any confusing comments ;-)

No, and I consider myself lucky if I don't find many more like this one:

;;; Future notes:

;; Once Emacs 19 becomes standard, many things in this package which are
;; messy for reasons of compatibility can be greatly simplified.  For now,
;; I prefer to maintain one unified version.

Emacs 19... I *really* wonder if these "messy things" were ever simplified.

-- 
                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-27 14:23             ` Juanma Barranquero
@ 2006-10-28 18:13               ` Richard Stallman
  2006-10-28 20:00                 ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2006-10-28 18:13 UTC (permalink / raw)
  Cc: monnier, emacs-devel

    ;;; Future notes:

    ;; Once Emacs 19 becomes standard, many things in this package which are
    ;; messy for reasons of compatibility can be greatly simplified.  For now,
    ;; I prefer to maintain one unified version.

    Emacs 19... I *really* wonder if these "messy things" were ever simplified.

Probably not.  Can you identify the things we were going to change?
That way we could do so, for after the release.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-28 18:13               ` Richard Stallman
@ 2006-10-28 20:00                 ` Juanma Barranquero
  2006-10-28 22:34                   ` David Kastrup
  0 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2006-10-28 20:00 UTC (permalink / raw)


On 10/28/06, Richard Stallman <rms@gnu.org> wrote:

> Probably not.  Can you identify the things we were going to change?
> That way we could do so, for after the release.

I don't think anyone but the original author can; at least, not
easily. We're talking about 4000+ lines of quite complex code with
almost no comments. It's a little project in itself.

-- 
                    /L/e/k/t/u

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: common-lisp-indent'ation of def*
  2006-10-28 20:00                 ` Juanma Barranquero
@ 2006-10-28 22:34                   ` David Kastrup
  0 siblings, 0 replies; 11+ messages in thread
From: David Kastrup @ 2006-10-28 22:34 UTC (permalink / raw)
  Cc: emacs-devel

"Juanma Barranquero" <lekktu@gmail.com> writes:

> On 10/28/06, Richard Stallman <rms@gnu.org> wrote:
>
>> Probably not.  Can you identify the things we were going to change?
>> That way we could do so, for after the release.
>
> I don't think anyone but the original author can; at least, not
> easily. We're talking about 4000+ lines of quite complex code with
> almost no comments. It's a little project in itself.

Sounds like something that could be worth doing for a "Google summer
of code" project if something like this comes up again.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-10-28 22:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 11:24 common-lisp-indent'ation of def* Juanma Barranquero
2006-10-25 18:03 ` Richard Stallman
2006-10-26 20:42   ` Chong Yidong
2006-10-26 22:10     ` Juanma Barranquero
2006-10-27  0:53       ` Chong Yidong
2006-10-27  8:15         ` Juanma Barranquero
2006-10-27 13:31           ` Stefan Monnier
2006-10-27 14:23             ` Juanma Barranquero
2006-10-28 18:13               ` Richard Stallman
2006-10-28 20:00                 ` Juanma Barranquero
2006-10-28 22:34                   ` David Kastrup

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.