From 86de6d9453a9d747bddadd20fce67e58c4dbe8c7 Mon Sep 17 00:00:00 2001
From: Ludovic Courtès
Date: Mon, 8 Mar 2010 00:27:57 +0100
Subject: Factorize encoding twiddling in `set-correct-file-encoding!'.

* doc/modules/skribilo/documentation/api.scm (api-search-definition):
  Call `set-correct-file-encoding!'.

* doc/user/src/outline.txt (Author): Remove accent from last name, as a
  temporary hack.

* doc/user/syntax.skb: Call `set-correct-file-encoding!' in the
  `outline' syntax example.

* doc/user/user.skb: Use `(skribilo utils syntax)'.

* src/guile/skribilo.scm (skribilo): Replace encoding twiddling with
  `set-correct-file-encoding!' call.

* src/guile/skribilo/evaluator.scm (load-document, include-document):
  Likewise.

* src/guile/skribilo/source.scm (source-read-lines): Call
  `set-correct-file-encoding!'.
  (source-read-definition): Likewise.

* src/guile/skribilo/utils/syntax.scm (set-correct-file-encoding!): New
  macro.
---
 doc/modules/skribilo/documentation/api.scm | 3 ++-
 doc/user/src/outline.txt                   | 2 +-
 doc/user/syntax.skb                        | 7 ++++---
 doc/user/user.skb                          | 3 ++-
 4 files changed, 9 insertions(+), 6 deletions(-)

(limited to 'doc')

diff --git a/doc/modules/skribilo/documentation/api.scm b/doc/modules/skribilo/documentation/api.scm
index ab445a4..959211b 100644
--- a/doc/modules/skribilo/documentation/api.scm
+++ b/doc/modules/skribilo/documentation/api.scm
@@ -28,7 +28,7 @@
   :use-module (skribilo output)
   :use-module (skribilo lib) ;; `define-markup'
   :use-module (skribilo utils compat)
-  :use-module (skribilo utils syntax) ;; `skribilo-module-syntax'
+  :use-module (skribilo utils syntax)
 
   :use-module (skribilo package base)
   :use-module (skribilo documentation manual)
@@ -243,6 +243,7 @@
 			path)
 	  (with-input-from-file f
 	     (lambda ()
+                (set-correct-file-encoding!)
 		(let loop ((exp (read)))
 		   (if (eof-object? exp)
 		       (skribe-error 'api-search-definition
diff --git a/doc/user/src/outline.txt b/doc/user/src/outline.txt
index b00992a..4a8dd1e 100644
--- a/doc/user/src/outline.txt
+++ b/doc/user/src/outline.txt
@@ -1,7 +1,7 @@
 -*- mode: outline; coding: iso-8859-1; -*-
 
 Title: Demonstrating Skribilo's Outline Syntax
-Author: Ludovic Court�s
+Author: Ludovic Courtes
 Keywords: Skribilo outline Emacs
 
 This document aims to *demonstrate*
diff --git a/doc/user/syntax.skb b/doc/user/syntax.skb
index 730f78d..1442c39 100644
--- a/doc/user/syntax.skb
+++ b/doc/user/syntax.skb
@@ -190,6 +190,7 @@ to the native ,(tt [skribe]) syntax:])
 	      (flush :side 'left
 		(pre (with-input-from-file src
 			(lambda ()
+			  (set-correct-file-encoding!)
 			  (let loop ((line   (read-line))
 				     (result '()))
 			    (if (eof-object? line)
@@ -201,9 +202,9 @@ to the native ,(tt [skribe]) syntax:])
 	   (with-output-to-string
 	     (lambda ()
 	       (let* ((read  (make-reader 'outline))
-		      (input (open-input-file src))
-		      (sexp  (read input)))
-		 (pretty-print sexp :width 65)))))))
+		      (input (open-input-file src)))
+		 (set-correct-file-encoding! input)
+		 (pretty-print (read input) :width 65)))))))
       
       (p [The ,(tt [outline]) mode makes it possible to quickly create
 documents that can be output in variety of formats (see ,(numref :text
diff --git a/doc/user/user.skb b/doc/user/user.skb
index 86eda21..53b2e8a 100644
--- a/doc/user/user.skb
+++ b/doc/user/user.skb
@@ -50,7 +50,8 @@
 	     (skribilo evaluator)
 	     (skribilo config)
 	     (skribilo index)
-	     (skribilo lib))  ;; for `skribe-warning'
+	     (skribilo lib)   ;; for `skribe-warning'
+	     (skribilo utils syntax)) ;; `set-correct-file-encoding!'
 
 ;*---------------------------------------------------------------------*/
 ;*    SRFIs							       */
-- 
cgit v1.2.3