From: Zachary Beane
Subject: Emacs won't indent some CL macros nicely
Date: 
Message-ID: <slrnasj3sr.jdj.xach@localhost.localdomain>
I've just started to write Lisp and I'm using emacs to format the
source and ILISP to run it. I'm having trouble with certain forms,
though. For example, emacs 21.1 lisp-mode wants to indent like this:

   (with-output-to-string (str)
                          (do ...))

instead of the more pleasant:

   (with-ouput-to-string (str)
     (do ...))

This also happens for a bunch of other `with-' macros. How can I get
emacs to use the nicer indentation?

Zach

From: Thomas F. Burdick
Subject: Re: Emacs won't indent some CL macros nicely
Date: 
Message-ID: <xcv3cqepci8.fsf@apocalypse.OCF.Berkeley.EDU>
····@xach.com (Zachary Beane) writes:

> I've just started to write Lisp and I'm using emacs to format the
> source and ILISP to run it. I'm having trouble with certain forms,
> though. For example, emacs 21.1 lisp-mode wants to indent like this:
> 
>    (with-output-to-string (str)
>                           (do ...))
> 
> instead of the more pleasant:
> 
>    (with-ouput-to-string (str)
>      (do ...))
> 
> This also happens for a bunch of other `with-' macros. How can I get
> emacs to use the nicer indentation?

Add this to your .emacs file:

(setf lisp-indent-function 'common-lisp-indent-function)

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: John Paul Wallington
Subject: Re: Emacs won't indent some CL macros nicely
Date: 
Message-ID: <87adkmjlkv.fsf@bundalo.shootybangbang.com>
···@apocalypse.OCF.Berkeley.EDU (Thomas F. Burdick) wrote:

>> This also happens for a bunch of other `with-' macros. How can I get
>> emacs to use the nicer indentation?
>
> Add this to your .emacs file:
>
> (setf lisp-indent-function 'common-lisp-indent-function)

Also, consider doing something like

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

instead, if you would prefer proper indentation of Common Lisp code
without clobbering conventional elisp indentation.

-- 
John Paul Wallington