From 5c69154f8ef9c10425d26ecb3a2c65f01b76959b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 26 May 2012 16:36:56 +0200 Subject: info: Add writers for `prog'. * src/guile/skribilo/engine/info.scm (prog, &prog-line): New markup writers. --- src/guile/skribilo/engine/info.scm | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/guile/skribilo/engine/info.scm b/src/guile/skribilo/engine/info.scm index a67288f..d25e584 100644 --- a/src/guile/skribilo/engine/info.scm +++ b/src/guile/skribilo/engine/info.scm @@ -760,5 +760,32 @@ (output label e) (output ")" e)))) +;*---------------------------------------------------------------------*/ +;* info ::%prog ... */ +;*---------------------------------------------------------------------*/ +(markup-writer 'prog info-engine + :options '(:line :mark) + :action (lambda (n e) + ;; Skip a line and indent the program. + (newline) + (set! *margin* (+ 2 *margin*)) + (with-justification + (make-justifier *text-column-width* 'verbatim) + (lambda () + (output (markup-body n) e))) + (set! *margin* (- *margin* 2)))) + +(markup-writer '&prog-line info-engine + :action (lambda (n e) + ;; Output the program line on a line of its own. + (let ((num (markup-option n :number))) + (and (number? num) + (output-justified (format #f "~3d: " num)))) + (output (markup-body n) e) + (output-flush *margin*))) + +;;; Local Variables: +;;; eval: (put 'markup-writer 'scheme-indent-function 2) +;;; End: ;;; info.scm ends here -- cgit v1.2.3