summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-04-06 14:50:06 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-04-06 14:50:06 +0200
commitc0e6f395d4241b1622c6b44ed2de3636ddab8cb9 (patch)
tree90a7006a863a8cb05f63d19f8867ecd49f3d0ac2
parentefd3a67e9a72bfe37cb69f88da0151fc2d98d5f3 (diff)
pict-attr: Accept optional initial XPath.
-rw-r--r--pict.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/pict.scm b/pict.scm
index 957910a..2fa0352 100644
--- a/pict.scm
+++ b/pict.scm
@@ -593,10 +593,10 @@ strings that are built from the list of attributes LST."
,txt))))
-(define (pict-attr attr pict)
+(define* (pict-attr attr pict #:key (path '()))
"Return the value of the selected ATTRIBUTE of the outermost element
of the SVG of PICT or #F."
- (and=> ((sxpath `(@ ,attr *any*))
+ (and=> ((sxpath `(,@path @ ,attr *any*))
(pict-sxml pict))
(lambda (m) (and (pair? m)
(car m)))))