lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SPAM] Re: Read multiple lines from an input-pipe


From: David Kastrup
Subject: Re: [SPAM] Re: Read multiple lines from an input-pipe
Date: Wed, 30 Apr 2014 11:00:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Urs Liska <address@hidden> writes:

> Thank you for that. However,
> (interpret-markup-list layout props result)
> returns all strings concatenated to one line.

No, it doesn't.  It returns a markup list, and if you put this into a
\markup without change, _then_ this list will be assembled into a single
line by implicitly calling \line on it.

With something like

\markuplist \column-lines \...

you get it properly spaced and broken across pages.  At least that's the
theory.

#(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-list-command (gitCommand layout props cmd) (markup?)
  (let* ((result
          (string-split
           (strsystem_internal (string-append "git " cmd))
           #\newline)))
    (interpret-markup-list layout props result)))

\markuplist \column-lines \gitCommand "log -1"
In current practice, it would appear that empty strings do not exactly
lead to expected behavior (I mean, wow), so you should use "map" to swap
them out for non-empty strings.

-- 
David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]