2 ;; kpathsea.scm -- implement kpath support using command-line
5 ;; source file of the GNU LilyPond music typesetter
7 ;; (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 (define-module (scm kpathsea))
12 (use-modules (ice-9 popen)
18 (define-public (ly:kpathsea-find-file name)
20 ((cmd (format #f "kpsewhich ~a"
21 (sanitize-command-option name)))
22 (unused (if (ly:get-option 'verbose)
23 (ly:message "Running ~a" cmd)))
24 (pipe (open-input-pipe cmd))
25 (answer (read-line pipe)))
31 (define-public (ly:kpathsea-expand-variable var)
33 ((cmd (format #f "kpsexpand '$'~a"
34 (sanitize-command-option var)))
35 (unused (if (ly:get-option 'verbose)
36 (ly:message "Running ~a" cmd)))
37 (pipe (open-input-pipe cmd))
38 (answer (read-line pipe)))
45 ;;(display (ly:kpathsea-find-file "cmr10.tfm"))
47 ;;(display (ly:kpathsea-expand-variable "TEXMF"))