aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Court`es2006-05-10 16:03:57 +0000
committerLudovic Court`es2006-05-10 16:03:57 +0000
commit07752b6d47bef3591f1a112a6e0bbcaebfb2fdd3 (patch)
treea87a5f6d1d67e068733d5fb4b393e321c2e4fc1b
parentee58c4388deb347e880c3ec22b043b2a4e56cc6b (diff)
downloadskribilo-07752b6d47bef3591f1a112a6e0bbcaebfb2fdd3.tar.gz
skribilo-07752b6d47bef3591f1a112a6e0bbcaebfb2fdd3.tar.lz
skribilo-07752b6d47bef3591f1a112a6e0bbcaebfb2fdd3.zip
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
-rw-r--r--src/guile/skribilo/biblio.scm13
-rw-r--r--src/guile/skribilo/evaluator.scm3
-rw-r--r--src/guile/skribilo/utils/compat.scm2
3 files changed, 12 insertions, 6 deletions
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) (<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))