Urs Liska <address@hidden> writes:
I've tried around for quite some time now to no avail, probably having
tried _everything_ except the right solution ;-) so I have to come
back here and ask.
I now have this implementation:
#(use-modules (ice-9 popen))
#(use-modules (ice-9 rdelim))
#(define (strsystem_internal cmd)
(let* ((port (open-input-pipe cmd))
(str (read-delimited "" port)))
(close-pipe port)
str))
#(define-markup-command (gitCommand layout props cmd) (markup?)
(let* ((result (string-split
(strsystem_internal (string-append "git " cmd))
#\newline)))
(interpret-markup layout props
(car result))))
If I feed it a command returning multiple lines, e.g.
\gitCommand "status"
this will create a markup with the first line of "git status"' result.
What way do I have to go to return either a \markuplist with all the
lines or a number of \markups, one for each line?
You use define-markup-command-list instead of define-markup-command,
interpret-markup-list instead of interpret-markup, and result instead of
(car result).