From 07752b6d47bef3591f1a112a6e0bbcaebfb2fdd3 Mon Sep 17 00:00:00 2001 From: Ludovic Court`es Date: Wed, 10 May 2006 16:03:57 +0000 Subject: Added `bib-for-each'. Fixed binding issues in the evaluator and compat. * src/guile/skribilo/biblio.scm (bib-for-each): New. * src/guile/skribilo/evaluator.scm: Autoload `engine' also when `*current-engine*' is met. * src/guile/skribilo/utils/compat.scm (skribe-read): Export it. git-archimport-id: lcourtes@laas.fr--2004-libre/skribilo--devel--1.2--patch-82 --- src/guile/skribilo/biblio.scm | 13 +++++++++---- src/guile/skribilo/evaluator.scm | 3 ++- src/guile/skribilo/utils/compat.scm | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src/guile') diff --git a/src/guile/skribilo/biblio.scm b/src/guile/skribilo/biblio.scm index 082fb99..c9c0637 100644 --- a/src/guile/skribilo/biblio.scm +++ b/src/guile/skribilo/biblio.scm @@ -33,8 +33,10 @@ :autoload (skribilo reader) (%default-reader) :autoload (skribilo parameters) (*bib-path*) :autoload (ice-9 format) (format) + :use-module (ice-9 optargs) + :export (bib-table? make-bib-table default-bib-table - bib-add! bib-duplicate + bib-add! bib-duplicate bib-for-each skribe-open-bib-file parse-bib)) (fluid-set! current-reader %skribilo-module-reader) @@ -66,15 +68,18 @@ (set! *bib-table* (make-bib-table "default-bib-table"))) *bib-table*) -;; -;; Utilities -;; (define (%bib-error who entry) (let ((msg "bibliography syntax error on entry")) (if (%epair? entry) (skribe-line-error (%epair-file entry) (%epair-line entry) who msg entry) (skribe-error who msg entry)))) +(define* (bib-for-each proc :optional (table (default-bib-table))) + (hash-for-each (lambda (ident entry) + (proc entry)) + table)) + + ;;; ====================================================================== ;;; ;;; BIB-DUPLICATE diff --git a/src/guile/skribilo/evaluator.scm b/src/guile/skribilo/evaluator.scm index b47f821..281372a 100644 --- a/src/guile/skribilo/evaluator.scm +++ b/src/guile/skribilo/evaluator.scm @@ -26,7 +26,8 @@ :autoload (skribilo parameters) (*verbose* *document-path*) :autoload (skribilo location) () :autoload (skribilo ast) (ast? markup?) - :autoload (skribilo engine) (engine? find-engine engine-ident) + :autoload (skribilo engine) (*current-engine* + engine? find-engine engine-ident) :autoload (skribilo reader) (*document-reader*) :autoload (skribilo verify) (verify) diff --git a/src/guile/skribilo/utils/compat.scm b/src/guile/skribilo/utils/compat.scm index 24ce784..cf97258 100644 --- a/src/guile/skribilo/utils/compat.scm +++ b/src/guile/skribilo/utils/compat.scm @@ -169,7 +169,7 @@ (define-public skribe-eval-port evaluate-document-from-port) (set! %skribe-reader #f) -(define* (skribe-read #:optional (port (current-input-port))) +(define*-public (skribe-read #:optional (port (current-input-port))) (if (not %skribe-reader) (set! %skribe-reader (make-reader 'skribe))) (%skribe-reader port)) -- cgit v1.2.3