aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès2009-11-20 11:55:18 +0100
committerLudovic Courtès2009-11-20 11:57:09 +0100
commitc8adc394b79e928d38722327cc18c7dfc6f1cb26 (patch)
treea17412947c83652554d1d852163a1ba52db29e31
parent1d1d62c420ae807f5e3d6b51e4b585a9dcd3bb1e (diff)
downloadskribilo-c8adc394b79e928d38722327cc18c7dfc6f1cb26.tar.gz
skribilo-c8adc394b79e928d38722327cc18c7dfc6f1cb26.tar.lz
skribilo-c8adc394b79e928d38722327cc18c7dfc6f1cb26.zip
Choose the right encoding for input documents.
* src/guile/skribilo.scm (skribilo): Use the right encoding for the current input port. * src/guile/skribilo/evaluator.scm (load-document, include-document): Likewise. * doc/user/user.skb: Add a `coding:' comment for use by Guile at the top.
-rw-r--r--doc/user/user.skb5
-rw-r--r--src/guile/skribilo.scm5
-rw-r--r--src/guile/skribilo/evaluator.scm12
3 files changed, 18 insertions, 4 deletions
diff --git a/doc/user/user.skb b/doc/user/user.skb
index d4efaf4..86eda21 100644
--- a/doc/user/user.skb
+++ b/doc/user/user.skb
@@ -1,6 +1,6 @@
-;;; user.skb -- The Skribilo user manual.
+;;; user.skb -- The Skribilo user manual. -*- coding: iso-8859-1 -*-
;;;
-;;; Copyright 2005, 2006, 2007, 2008 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright 2005, 2006, 2007, 2008, 2009 Ludovic Courtès <ludo@gnu.org>
;;; Copyright 2001, 2002, 2003, 2004 Manuel Serrano
;;;
;;;
@@ -266,7 +266,6 @@ of documentation ``evaluation''.])))
#f)))))
;; Local Variables:
-;; coding: latin-1
;; comment-start: ";"
;; comment-end: ""
;; ispell-local-dictionary: "american"
diff --git a/src/guile/skribilo.scm b/src/guile/skribilo.scm
index 7208a00..7d066da 100644
--- a/src/guile/skribilo.scm
+++ b/src/guile/skribilo.scm
@@ -387,6 +387,11 @@ options."
(if input-file
(with-input-from-file input-file
(lambda ()
+ (cond-expand (guile-2
+ ;; Use the encoding specified by the `coding:'
+ ;; comment.
+ (let ((p (current-input-port)))
+ (set-port-encoding! p (file-encoding p)))))
(doskribe user-module)))
(doskribe user-module))
diff --git a/src/guile/skribilo/evaluator.scm b/src/guile/skribilo/evaluator.scm
index 329ba61..6ca0f13 100644
--- a/src/guile/skribilo/evaluator.scm
+++ b/src/guile/skribilo/evaluator.scm
@@ -1,7 +1,7 @@
;;; eval.scm -- Skribilo evaluator.
;;;
+;;; Copyright 2005, 2006, 2009 Ludovic Courtès <ludo@gnu.org>
;;; Copyright 2003, 2004 Erick Gallesio - I3S-CNRS/ESSI <eg@essi.fr>
-;;; Copyright 2005, 2006, 2007 Ludovic Courtès <ludovic.courtes@laas.fr>
;;;
;;;
;;; This program is free software; you can redistribute it and/or modify
@@ -188,6 +188,12 @@
;; Load it
(with-input-from-file filep
(lambda ()
+ (cond-expand (guile-2
+ ;; Use the encoding specified by the `coding:'
+ ;; comment.
+ (let ((p (current-input-port)))
+ (set-port-encoding! p
+ (file-encoding p)))))
(evaluate-document-from-port (current-input-port) ei
:module module
:reader reader)))
@@ -215,6 +221,10 @@
(with-input-from-file full-path
(lambda ()
+ (cond-expand (guile-2
+ ;; Use the encoding specified by the `coding:' comment.
+ (let ((p (current-input-port)))
+ (set-port-encoding! p (file-encoding p)))))
(save-module-excursion
(lambda ()
(set-current-module module)