unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* inferior-lisp mode indenting problem
@ 2003-08-14 22:29 Lowell
  2003-08-14 23:30 ` Jesper Harder
  0 siblings, 1 reply; 6+ messages in thread
From: Lowell @ 2003-08-14 22:29 UTC (permalink / raw)


The auto-indenting of 'if' clauses in inferior-lisp mode is not working 
properly. It does:

(if test
     then
   else)

but it should do:

(if test
     then
     else)

How can I change it?

Lowell

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

* Re: inferior-lisp mode indenting problem
  2003-08-14 22:29 inferior-lisp mode indenting problem Lowell
@ 2003-08-14 23:30 ` Jesper Harder
  2003-08-15  0:21   ` John Paul Wallington
  2003-08-15 10:29   ` Alan Mackenzie
  0 siblings, 2 replies; 6+ messages in thread
From: Jesper Harder @ 2003-08-14 23:30 UTC (permalink / raw)


Lowell <lkirsh@cs.ubc.ca> writes:

> The auto-indenting of 'if' clauses in inferior-lisp mode is not
> working properly. It does:
>
>
> (if test
>      then
>    else)

This is the way `if' should be indented in Lisp.

> but it should do:
>
> (if test
>      then
>      else)
>
> How can I change it?

(put 'if 'lisp-indent-function 0) will get you:

(if test
    then
    else)

But beware that most other people reading your code will find this
style annoying.

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

* Re: inferior-lisp mode indenting problem
  2003-08-14 23:30 ` Jesper Harder
@ 2003-08-15  0:21   ` John Paul Wallington
  2003-08-15  0:33     ` John Paul Wallington
  2003-08-15 10:29   ` Alan Mackenzie
  1 sibling, 1 reply; 6+ messages in thread
From: John Paul Wallington @ 2003-08-15  0:21 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> wrote:

> Lowell <lkirsh@cs.ubc.ca> writes:
>
>> The auto-indenting of 'if' clauses in inferior-lisp mode is not
>> working properly.
[...]
>> How can I change it?
>
> (put 'if 'lisp-indent-function 0) will get you:
>
> (if test
>     then
>     else)
>
> But beware that most other people reading your code will find this
> style annoying.

To get proper indentation of Common Lisp code without clobbering
conventional Emacs Lisp indentation you could do something like so:

(add-hook 'lisp-mode-hook
   (lambda ()
     (set (make-local-variable lisp-indent-function)
          'common-lisp-indent-function)))

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

* Re: inferior-lisp mode indenting problem
  2003-08-15  0:21   ` John Paul Wallington
@ 2003-08-15  0:33     ` John Paul Wallington
  0 siblings, 0 replies; 6+ messages in thread
From: John Paul Wallington @ 2003-08-15  0:33 UTC (permalink / raw)


John Paul Wallington <jpw@gnu.org> burbled:

> To get proper indentation of Common Lisp code without clobbering
> conventional Emacs Lisp indentation you could do something like so:
>
> (add-hook 'lisp-mode-hook
>    (lambda ()
>      (set (make-local-variable lisp-indent-function)
                                 ^
                                 Oh boy!  should be quoted, like so:

(add-hook 'lisp-mode-hook
          (lambda ()
            (set (make-local-variable 'lisp-indent-function)
                 'common-lisp-indent-function)))

I hadn't noticed before because the default value of
`lisp-indent-function' is `lisp-indent-function' !

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

* Re: inferior-lisp mode indenting problem
  2003-08-14 23:30 ` Jesper Harder
  2003-08-15  0:21   ` John Paul Wallington
@ 2003-08-15 10:29   ` Alan Mackenzie
  2003-08-15 13:33     ` Jesper Harder
  1 sibling, 1 reply; 6+ messages in thread
From: Alan Mackenzie @ 2003-08-15 10:29 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> wrote on Fri, 15 Aug 2003 01:30:38 +0200:
> Lowell <lkirsh@cs.ubc.ca> writes:

>> The auto-indenting of 'if' clauses in inferior-lisp mode is not
>> working properly. It does:
>>
>>
>> (if test
>>      then
>>    else)

> This is the way `if' should be indented in Lisp.

This is the way that `if' _is_ indented in Emacs Lisp.  This is helpful
in separating the `then' (which is a single form) from the `else' (which
is several forms).

But what does _should_ mean here?  Who says?  What's the authority?

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: inferior-lisp mode indenting problem
  2003-08-15 10:29   ` Alan Mackenzie
@ 2003-08-15 13:33     ` Jesper Harder
  0 siblings, 0 replies; 6+ messages in thread
From: Jesper Harder @ 2003-08-15 13:33 UTC (permalink / raw)


Alan Mackenzie<none@example.invalid> writes:

> Jesper Harder <harder@myrealbox.com> wrote:
>
>> This is the way `if' should be indented in Lisp.
>
> This is the way that `if' _is_ indented in Emacs Lisp.  This is helpful
> in separating the `then' (which is a single form) from the `else' (which
> is several forms).

You're right.  I had forgottent that the `else' form doesn't have an
implied progn in CL (like in Emacs Lisp).

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

end of thread, other threads:[~2003-08-15 13:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-14 22:29 inferior-lisp mode indenting problem Lowell
2003-08-14 23:30 ` Jesper Harder
2003-08-15  0:21   ` John Paul Wallington
2003-08-15  0:33     ` John Paul Wallington
2003-08-15 10:29   ` Alan Mackenzie
2003-08-15 13:33     ` Jesper Harder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).