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
····@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! |
/ / `-----------------------'
( -. |
| ) |
(`-. '--.)
`. )----'
···@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