about summary refs log tree commit diff
path: root/src/guile/skribilo/engine
diff options
context:
space:
mode:
authorLudovic Court`es2006-05-09 15:30:39 +0000
committerLudovic Court`es2006-05-09 15:30:39 +0000
commitfadc45ade3cdec5c63deb199fdc5b3269d48b272 (patch)
treec0792be7d774752277a7a8c5c0ebe1bed6c8465c /src/guile/skribilo/engine
parentfc1393afb3a78e25eaeb5dc1380bfcde320c6937 (diff)
downloadskribilo-fadc45ade3cdec5c63deb199fdc5b3269d48b272.tar.gz
skribilo-fadc45ade3cdec5c63deb199fdc5b3269d48b272.tar.lz
skribilo-fadc45ade3cdec5c63deb199fdc5b3269d48b272.zip
Added `markup-option-set!'.
* src/guile/skribilo/ast.scm (markup-option-set!): New.

* src/guile/skribilo/engine/lout.scm (markup-option-set!): Removed.
  (lout-start-large-scale-structure): Don't invoke `markup-option-set!'
  on markups that are not a large-scale structure.

git-archimport-id: lcourtes@laas.fr--2004-libre/skribilo--devel--1.2--patch-80
Diffstat (limited to 'src/guile/skribilo/engine')
-rw-r--r--src/guile/skribilo/engine/lout.scm28
1 files changed, 10 insertions, 18 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index 8727df8..3b62224 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -1136,7 +1136,7 @@
 			 (lout-make-doc-cover-sheet n e))))
 
 	       (if doc-style?
-		   ;; Putting it here will only works with `doc' documents.
+		   ;; Putting it here will only work with `doc' documents.
 		   (lout-output-pdf-meta-info n e))))
 
    :after (lambda (n e)
@@ -1363,21 +1363,6 @@
 	 (printf "\n\n@End @~a\n\n" lout-markup))))
 
 
-(define (markup-option-set! m opt val)
-  ;; Sets the value of markup option `opt' of markup `m' to `val'.
-  (let ((o (assoc opt (markup-options m))))
-    (if o
-	(begin
-;	  (set-cdr! o val)
-	  (markup-option-add! m opt val) ;; FIXME: the above method fails
-	  (if (not (eq? (markup-option m opt) val))
-	      (skribe-error 'markup-option-set!
-			    "Doesn't work!" (markup-option m opt))))
-	(begin
-	  (lout-debug "markup-option-set!: markup ~a doesn't have option ~a"
-		      m opt)
-	  #f))))
-
 (define (lout-markup-child-type skribe-markup)
   ;; Return the child markup type of `skribe-markup' (e.g. for `chapter',
   ;; return `section').
@@ -1413,8 +1398,15 @@
 	      ;; first section while other styles don't.
 	      (printf "\n@Begin~as\n" lout-markup-name))
 
-	  ;; update the `&substructs-started?' option of the parent
-	  (markup-option-set! parent '&substructs-started? #t)
+	  ;; FIXME: We need to make sure that PARENT is a large-scale
+	  ;; structure, otherwise it won't have the `&substructs-started?'
+	  ;; option (e.g., if PARENT is a `color' markup).  I need to clarify
+	  ;; this.
+	  (if (memq (markup-markup parent)
+		    '(document chapter section subsection subsubsection))
+	      ;; update the `&substructs-started?' option of the parent
+	      (markup-option-set! parent '&substructs-started? #t))
+
 	  (lout-debug "start-struct: updated parent: ~a"
 		      (markup-option parent '&substructs-started?))))