[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Speaking of Syntax

    Date: Tue, 10 Nov 87 07:03:43 PST
    From: David Kriegman <kriegs@coyote.stanford.edu>
    Speaking of defining syntaxes, I've defined some syntaxes such as
    has been mentioned, and I'd like the editor to be "smart" about the
    syntax when it formats the s-expression.  The default s-expression 
    puts in too many spaces.  My syntax looks something like this:

    (def-animal BABOON
       :species monkey
       :weight (0 100)
       :color brown)

    You get the picture.  def-animal, followed by an atom followed by 
    a list of keywords.  I'd like zmacs to format it as above but it
    formats it like this:

    (def-animal BABOON
      :species monkey
      :weight (0 100)
      :color brown)

    Zmacs is "smart" about defun, let, loop and other "standard" lisp

The way it does that is through the ZWEI:INDENTATION. Inside the definition
of DEF-ANIMAL (which is presumably a macro) you put a declaration of
ZWEI:INDENTATION. Something like the following:

(defmacro def-animal (name &key species weight color)
 (declare (zwei:indentation ...))

The only problem is that zwei:indentation is not documented and I don't
remember offhand the parameters that you give it. (I found them out
by experimenting. Hint: it takes from 1 to 4 integers)

    Any help would be appreciated...

            -Dave Kriegman