[cl-pdf-devel] Better arglists for pdf:with-document, tt:paragraph, etc.

Marc Battyani marc.battyani at fractalconcept.com
Tue Apr 20 15:10:19 UTC 2010


On 19-04-10 12:53 AM, Pixel // pinterface wrote:
> Do you find it difficult to use cl-pdf or cl-typesetting with limited &rest
> lambda lists?  Do the autodoc hints in slime prove unhelpful?  Do you wish
> you could type "(with-document " or "(paragraph " and get an accurate
> listing of what arguments are available?  Do you use SBCL or Clisp?[1]
>
> Then have I got the .asd for you!
>
> Introducing cl-pdf.arglists: better arglists for cl-pdf and cl-typesetting
> macros.
>   http://web.kepibu.org/code/lisp/cl-pdf.arglists/
>
> Turns
>   (with-document (&rest args
>                   &key (max-number-of-pages 'pdf:*max-number-of-pages*)
>                   &allow-other-keys)
>                  &body body)
> into
>   (with-document (&rest args
>                   &key (max-number-of-pages 'pdf:*max-number-of-pages*)
>                   empty mode layout (creator "") author title subject
>                   keywords &allow-other-keys)
>                  &body body)
> and
>  (paragraph (&rest style) &body body)
> into
>  (paragraph (&rest style
>              &key font font-size text-x-scale color
>              background-color h-align left-margin right-margin
>              pre-decoration post-decoration leading-ratio)
>             &body body)
>
> Wow!
>
> But wait, there's more!
>
> Act now, and we'll include at no additional cost:
> * Keyword arguments from object initargs
> * Keyword arguments from initialize-instance
> * To-the-macroexpansion accuracy through the magic of introspection
>
> That's an arbitrary-dollar-amount value for only $0!  That's a savings of
> <division-by-zero>%!
>
>
> [1] Patches for other implementations welcome!
>   

Nice. :)

For LispWorks you can use lw:function-lambda-list to get the arglist:
(lw:function-lambda-list 'with-document)
((&rest args &key (max-number-of-pages (quote *max-number-of-pages*))
&allow-other-keys) &body body)

I don't know how to set it though.

Marc





More information about the cl-pdf-devel mailing list