[cl-typesetting-devel] Re: [cl-pdf-devel] Paragraph

Dmitriy Ivanov divanov at aha.ru
Sun Oct 14 08:50:14 UTC 2007


Hello Gary,

| The paragraph macro doesn't evaluate its arguments which seems to
| make it hard to use programatically. I've hardly scratched the
| surface of CL-PDF and CL-Typesetting but the following change would
| allow the paragraph macro to take either a property list
| (unevaluated) or a symbol (evaluated) as argument. (Another, perhaps
| better, alternative would be to have two macros -- paragraph and
| paragraph*? -- one of which didn't evaluate its arguments and one of
| which did... Am I missing something? Is there another way to modify
| the styles "programmatically".

I am afraid the above is not true. The paragraph macro does evaluate its
arguments.

To provide "precompiled" styles, I would suggest the following:

1. Add the new class, e.g.
 (defclass paragraph-style (text-style)
   ((top-margin)
   (bottom-margin)
   (first-line-indent)))

(I would also vote for moving the left-margin and right-margin slots there.)

2. Treat the :style property indicator in the paragraph macro specially,
e.g.
(defmacro paragraph ((&rest plist &key style) &body body)
  (with-gensyms (new-style restore-style first-indent)
    ...
      `(let* ((,new-style ,(or style `,(make-instance 'paragraph-style
, at plist))) ...)
   ...)))

3. Rename with-style and set-style to with-style-plist and set-style-plist
correspondingly.

4. Redefine with-style and set-style to accept a style instance as an
argument instead of a plist.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru




More information about the cl-typesetting-devel mailing list