aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtes2007-07-01 23:49:09 +0000
committerLudovic Courtes2007-07-01 23:49:09 +0000
commit303200b9e863d2a1ff07180b5211a6826ea75f36 (patch)
treeabaec35c81ace8e52a27e96f5a7269af5b79c2fb
parent61d482a4b1e6e720f4607a4ebda3900c8e88c3b5 (diff)
downloadskribilo-303200b9e863d2a1ff07180b5211a6826ea75f36.tar.gz
skribilo-303200b9e863d2a1ff07180b5211a6826ea75f36.tar.lz
skribilo-303200b9e863d2a1ff07180b5211a6826ea75f36.zip
`base' package: Honor `:line #f' in `prog'.
* src/guile/skribilo/prog.scm: Use `srfi-11' instead of `receive'. (make-prog-body): When creating a `&prog-line', set the `:number' option only if `lnum-init' is true. git-archimport-id: skribilo@sv.gnu.org--2006/skribilo--devo--1.2--patch-130
-rw-r--r--ChangeLog18
-rw-r--r--src/guile/skribilo/prog.scm32
2 files changed, 34 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index e993ff3..8a5a0e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,24 @@
# arch-tag: automatic-ChangeLog--skribilo@sv.gnu.org--2006/skribilo--devo--1.2
#
+2007-07-01 23:49:09 GMT Ludovic Courtes <ludovic.courtes@laas.fr> patch-130
+
+ Summary:
+ `base' package: Honor `:line #f' in `prog'.
+ Revision:
+ skribilo--devo--1.2--patch-130
+
+ * src/guile/skribilo/prog.scm: Use `srfi-11' instead of `receive'.
+ (make-prog-body): When creating a `&prog-line', set the `:number'
+ option only if `lnum-init' is true.
+
+ modified files:
+ ChangeLog src/guile/skribilo/prog.scm
+
+ new patches:
+ lcourtes@laas.fr--2005-mobile/skribilo--devel--1.2--patch-114
+
+
2007-07-01 23:48:43 GMT Ludovic Courtes <ludovic.courtes@laas.fr> patch-129
Summary:
diff --git a/src/guile/skribilo/prog.scm b/src/guile/skribilo/prog.scm
index 0113db6..9ea334d 100644
--- a/src/guile/skribilo/prog.scm
+++ b/src/guile/skribilo/prog.scm
@@ -1,7 +1,7 @@
;;; prog.scm -- All the stuff for the prog markup
;;;
-;;; Copyright 2003 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
-;;; Copyright 2006 Ludovic Courtès <ludovic.courtes@laas.fr>
+;;; Copyright 2003 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
+;;; Copyright 2006, 2007 Ludovic Courtès <ludovic.courtes@laas.fr>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,8 @@
(define-module (skribilo prog)
:use-module (ice-9 regex)
- :autoload (ice-9 receive) (receive)
+ :use-module (srfi srfi-11)
+
:use-module (skribilo lib) ;; `new'
:use-module (skribilo ast)
:use-module (skribilo utils syntax)
@@ -32,11 +33,10 @@
(fluid-set! current-reader %skribilo-module-reader)
-;;; ======================================================================
;;;
-;;; COMPATIBILITY
+;;; Bigloo compatibility.
;;;
-;;; ======================================================================
+
(define pregexp-match string-match)
(define pregexp-replace (lambda (rx str what)
(regexp-substitute/global #f rx str
@@ -54,7 +54,7 @@
;*---------------------------------------------------------------------*/
;* *lines* ... */
;*---------------------------------------------------------------------*/
-;; FIXME: Removed that global. Rework the thing.
+;; FIXME: Remove that global. Rework the thing.
(define *lines* (make-hash-table))
;*---------------------------------------------------------------------*/
@@ -99,14 +99,14 @@
(res '()))
(if (null? ls)
(values #f line)
- (receive (m l)
- (extract-mark (car ls) mark regexp)
+ (let-values (((m l)
+ (extract-mark (car ls) mark regexp)))
(if (not m)
(loop (cdr ls) (cons l res))
(values m (append (reverse! res) (cons l (cdr ls)))))))))
((node? line)
- (receive (m l)
- (extract-mark (node-body line) mark regexp)
+ (let-values (((m l)
+ (extract-mark (node-body line) mark regexp)))
(if (not m)
(values #f line)
(begin
@@ -200,17 +200,17 @@
lnum)
(length lines)))))
(let loop ((lines lines)
- (lnum lnum)
- (res '()))
+ (lnum lnum)
+ (res '()))
(if (null? lines)
(reverse! res)
- (receive (m l)
- (extract-mark (car lines) mark regexp)
+ (let-values (((m l)
+ (extract-mark (car lines) mark regexp)))
(let* ((line-ident (symbol->string (gensym "&prog-line")))
(n (new markup
(markup '&prog-line)
(ident line-ident)
- (options `((:number ,lnum)))
+ (options `((:number ,(and lnum-init lnum))))
(body (if m (make-line-mark m line-ident l) l)))))
(loop (cdr lines)
(+ lnum 1)