summaryrefslogtreecommitdiff
path: root/src/guile
diff options
context:
space:
mode:
authorLudovic Courtès2008-12-21 23:12:03 +0100
committerLudovic Courtès2008-12-21 23:12:03 +0100
commita18292538f1d45d3f2dce8da530e031b91ac3739 (patch)
tree2b03949f207d99de2b8bd4da4e121b8d719b491b /src/guile
parent1012103185f6bd282693f0efd85ca5e1fa841ade (diff)
downloadskribilo-a18292538f1d45d3f2dce8da530e031b91ac3739.tar.gz
skribilo-a18292538f1d45d3f2dce8da530e031b91ac3739.tar.lz
skribilo-a18292538f1d45d3f2dce8da530e031b91ac3739.zip
lout: Issue a warning instead of an error for `(image :url ...)'.
* src/guile/skribilo/engine/lout.scm (image): Produce a warning, not an error, if URL is provided. Use SRFI-35 conditions for invalid arguments. * po/POTFILES.in: Add. * NEWS: Update.
Diffstat (limited to 'src/guile')
-rw-r--r--src/guile/skribilo/engine/lout.scm33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/guile/skribilo/engine/lout.scm b/src/guile/skribilo/engine/lout.scm
index 64e8634..7a9e871 100644
--- a/src/guile/skribilo/engine/lout.scm
+++ b/src/guile/skribilo/engine/lout.scm
@@ -24,6 +24,7 @@
:use-module (skribilo config)
:use-module (skribilo engine)
:use-module (skribilo writer)
+ :use-module (skribilo condition)
:use-module (skribilo utils keywords)
:use-module (skribilo utils strings)
:use-module (skribilo utils syntax)
@@ -37,6 +38,8 @@
:use-module (srfi srfi-11)
:use-module (srfi srfi-13)
:use-module (srfi srfi-14)
+ :autoload (srfi srfi-34) (raise)
+ :use-module (srfi srfi-35)
:autoload (ice-9 popen) (open-output-pipe)
:autoload (ice-9 rdelim) (read-line)
@@ -2399,18 +2402,24 @@
(if (list? efmt)
efmt
'("eps"))))))
- (if url ;; maybe we should run `wget' then? :-)
- (skribe-error 'lout "Image URLs not supported" url))
- (if (not (string? img))
- (skribe-error 'lout "Illegal image" file)
- (begin
- (if width
- (format #t "\n~a @Wide" (lout-width width)))
- (if height
- (format #t "\n~a @High" (lout-width height)))
- (if zoom
- (format #t "\n~a @Scale" zoom))
- (format #t "\n@IncludeGraphic { \"~a\" }\n" img))))))
+ (cond (url ;; maybe we should run `wget' then? :-)
+ (skribe-warning/ast 1 n
+ (_ "image URLs not supported")))
+
+ ((string? img)
+ (if width
+ (format #t "\n~a @Wide" (lout-width width)))
+ (if height
+ (format #t "\n~a @High" (lout-width height)))
+ (if zoom
+ (format #t "\n~a @Scale" zoom))
+ (format #t "\n@IncludeGraphic { \"~a\" }\n" img))
+
+ (else
+ (raise (condition
+ (&invalid-argument-error
+ (proc-name "image/lout")
+ (argument img)))))))))
;*---------------------------------------------------------------------*/
;* Ornaments ... */