What's the prefered style for indenting DEFPACKAGE expressions. I'm
getting different answers from Xemacs depending on which inferior
lisp, etc. packages I have loaded. So I'm going to try to make emacs
do the right thing but I don't know what that is. My natural
inclination would be to format it like:
(defpackage "PACKAGE-NAME"
(:use "COMMON-LISP")
(:nicknames "PN")
(:export "FOO" "BAR" "BAZ"))
I.e. package name on the first line and all the options indented two
spaces. I don't yet have an opinion abotu what to do f a single option
doesn't fit on one line. Currently ilisp + common-lisp-indent-function
format it thusly:
(defpackage "PACKAGE-NAME"
(:use "COMMON-LISP")
(:nicknames "PN")
(:export "FOO" "BAR" "BAZ"))
which is pretty gross looking to me.
-Peter
--
Peter Seibel
·····@javamonkey.com
Peter Seibel <·····@javamonkey.com> writes:
> I'm getting different answers from Xemacs depending on which
> inferior lisp, etc. packages I have loaded.
Really? Inferior Lisp packages should not affect this.
> do the right thing but I don't know what that is. My natural
> inclination would be to format it like:
This is how I indent it as well and most of the code I have seen
(and remember) has followed the same convention. This is also what
Emacs' cl-indent does.
> (defpackage "PACKAGE-NAME"
> (:use "COMMON-LISP")
> (:nicknames "PN")
> (:export "FOO" "BAR" "BAZ"))
> doesn't fit on one line. Currently ilisp + common-lisp-indent-function
> format it thusly:
ILISP has nothing to do with this. XEmacs' cl-indent (in other
words common-lisp-indent-function) is the culprit here. If you
insist on using XEmacs, you could replace its cl-indent with Emacs'
one (or add a proper defpackage indentation spec yourself but I
recall Emacs' cl-indent is slightly better otherwise as well).
> (defpackage "PACKAGE-NAME"
> (:use "COMMON-LISP")
> (:nicknames "PN")
> (:export "FOO" "BAR" "BAZ"))
--
Hannu