summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLudovic Courtès2008-04-15 20:29:17 +0200
committerLudovic Courtès2008-04-15 20:29:17 +0200
commitbaf2cb533c83f921849c54db3eb371d2bf03a063 (patch)
treeeabe813fc98d272e3632a156ea68e4f6b1037a10 /src
parent4d1fc093f311e94f3be9a5fc0155824415cf9384 (diff)
downloadskribilo-baf2cb533c83f921849c54db3eb371d2bf03a063.tar.gz
skribilo-baf2cb533c83f921849c54db3eb371d2bf03a063.tar.lz
skribilo-baf2cb533c83f921849c54db3eb371d2bf03a063.zip
Use SRFI-35 conditions in `(skribilo index)'.
* src/guile/skribilo/index.scm (resolve-the-index)[index-ref]: Raise a `&message' exception instead of using `skribe-error'.
Diffstat (limited to 'src')
-rw-r--r--src/guile/skribilo/index.scm18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/guile/skribilo/index.scm b/src/guile/skribilo/index.scm
index c6ee2d1..b537fb4 100644
--- a/src/guile/skribilo/index.scm
+++ b/src/guile/skribilo/index.scm
@@ -1,7 +1,7 @@
;;; index.scm
;;;
+;;; Copyright 2005, 2006, 2008 Ludovic Courtès <ludo@gnu.org>
;;; Copyright 2003, 2004 Manuel Serrano
-;;; Copyright 2005, 2006 Ludovic Courtès <ludovic.courtes@laas.fr>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
@@ -24,6 +24,8 @@
:use-syntax (skribilo lib)
:use-module (skribilo ast)
+ :autoload (srfi srfi-34) (raise)
+ :use-module (srfi srfi-35)
:use-module (srfi srfi-39)
;; XXX: The use of `mark' here introduces a cross-dependency between
@@ -31,6 +33,8 @@
;; modules autoloads the other one.
:autoload (skribilo package base) (mark)
+ :autoload (skribilo location) (location?)
+
:export (index? make-index-table *index-table*
default-index resolve-the-index))
@@ -83,7 +87,17 @@
(define (index-ref n)
(let ((name (markup-option n 'name)))
(if (>= char-offset (string-length name))
- (skribe-error 'the-index "char-offset out of bound" char-offset)
+ (let ((loc (if (location? loc)
+ (format #f "~a:~a:~a: "
+ (location-file loc)
+ (location-line loc)
+ (location-column loc))
+ ""))
+ (msg (format
+ #f (_ "the-index: char-offset `~A' out of bounds~%")
+ char-offset)))
+ (raise (condition (&message
+ (condition-message (string-append loc msg))))))
(string-ref name char-offset))))
;; sort a bucket of entries (the entries in a bucket share there name)
(define (sort-entries-bucket ie)