]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/stencil.scm (write-system-signature): better escaping.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 May 2006 22:40:50 +0000 (22:40 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 28 May 2006 22:40:50 +0000 (22:40 +0000)
* scm/framework-ps.scm (output-framework): dump-signatures support
for plain output.

* GNUmakefile.in: create web-signature-root/ too

* make/lilypond-vars.make (LILYPOND_BOOK_FLAGS): add -ddump-signatures.

* scm/framework-ps.scm (write-preamble): redefine mark_URI to nop
for -dno-point-and-click

ChangeLog
GNUmakefile.in
make/lilypond-vars.make
scm/framework-eps.scm
scm/framework-ps.scm
scm/lily-library.scm
scm/stencil.scm

index b2820535f244eac0ed933467ad8026799d78d18c..f91581a81479267815947683ed53b500f0995fbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2006-05-29  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
+       * scm/stencil.scm (write-system-signature): better escaping.
+
+       * scm/framework-ps.scm (output-framework): dump-signatures support
+       for plain output.
+
+       * GNUmakefile.in: create web-signature-root/ too
+
+       * make/lilypond-vars.make (LILYPOND_BOOK_FLAGS): add -ddump-signatures.
+
        * scm/framework-ps.scm (write-preamble): redefine mark_URI to nop
        for -dno-point-and-click
 
index 8a7becf1a62c99a81154d0cf5ac9ca643745d3e4..2506689861d6189c308d184375b714c862ecdce7 100644 (file)
@@ -76,18 +76,25 @@ local-WWW-post:
        cd $(top-build-dir) && find Documentation input \
                $(web-ext:%=-path '*/out-www/*.%' -or) -type l \
                > $(outdir)/weblist
+       cd $(top-build-dir) && find Documentation input \
+               -path '*/out-www/*.signature' \
+               > $(outdir)/siglist
        ls $(outdir)/*.html >> $(outdir)/weblist
 
 ## rewrite file names so we lose out-www
        rm -rf $(outdir)/web-root/
-       mkdir $(outdir)/web-root/
+       mkdir $(outdir)/web-root/  $(outdir)/web-signature-root/
        cat $(outdir)/weblist | (cd $(top-build-dir); tar -cf-  -T- ) | \
                tar -C $(outdir)/web-root/ -xf -  
-       cd $(outdir)/web-root/ &&  \
+       cat $(outdir)/siglist | (cd $(top-build-dir); tar -cf-  -T- ) | \
+               tar -C $(outdir)/web-signature-root/ -xf -
+       for dir in $(outdir)/web-root/ $(outdir)/web-signature-root/ ; do  \
+               cd $$dir && \
                for a in `find . -name out-www`; do \
                        rsync -a  --link-dest $$a/ $$a/ $$a/.. ; \
                        rm -rf $$a ; \
-               done
+               done \
+       done
 
 tree-prefix = $(outdir)
 tree-bin = $(tree-prefix)/bin
index 9f6ef3f97e418634a41a1bc72856b064dba6a733..1dd53512b89e31d624b98b4fb1fdf4290da82911 100644 (file)
@@ -25,7 +25,7 @@ CONVERT_LY = $(script-dir)/convert-ly.py
 LILYPOND_BOOK = $(script-dir)/lilypond-book.py
 LILYPOND_BOOK_INCLUDES = -I $(src-dir)/ -I $(outdir) -I $(input-dir) -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(top-build-dir)/mf/$(outconfbase)/  -I $(top-build-dir)/mf/out/
 LILYPOND_BOOK_LILYPOND_FLAGS=-dgs-font-load
-LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) --backend=eps --formats=ps,png --header=texidoc -I $(top-src-dir)/input/test -dinternal-type-checking -danti-alias-factor=2 $(LILYPOND_BOOK_LILYPOND_FLAGS)"
+LILYPOND_BOOK_FLAGS = --process="$(LILYPOND_BINARY) --backend=eps --formats=ps,png --header=texidoc -I $(top-src-dir)/input/test -dinternal-type-checking -ddump-signatures -danti-alias-factor=2 $(LILYPOND_BOOK_LILYPOND_FLAGS)"
 TEXINPUTS=$(top-src-dir)/tex/::
 export TEXINPUTS
 
index 13874d2af770bc6d4606c46a8de8fb535e556594..930ac51bf1141577bc80a23285adea40203e45d0 100644 (file)
@@ -96,16 +96,6 @@ stencil, so LaTeX includegraphics doesn't fuck up the alignment."
                        (format "~a.eps" basename) (ly:output-formats)))
 
 
-(define (write-system-signatures basename paper-systems count)
-  (if (pair? paper-systems)
-      (begin
-       (let*
-           ((outname (format "~a-~a.signature" basename count)) )
-            
-         (ly:message "writing ~a" outname)
-         (write-system-signature outname (car paper-systems))
-         (write-system-signatures basename (cdr paper-systems) (1+ count))))))
-
 
 (define-public (output-classic-framework basename book scopes fields)
   (output-scopes scopes fields basename)
index 3a95c5166dea6f9c2fd19dd857d1e667bbb02154..bf794c3a74d67e81138ad6b8f1b3ea4d1c0097a0 100644 (file)
                     (open-file filename "wb")
                     "ps"))
         (paper (ly:paper-book-paper book))
+        (systems (ly:paper-book-systems book))
         (page-stencils (map page-stencil (ly:paper-book-pages book)))
         
         (landscape? (eq? (ly:output-def-lookup paper 'landscape) #t))
         (page-count (length page-stencils))
         (port (ly:outputter-port outputter)))
 
+    (if (ly:get-option 'dump-signatures)
+       (write-system-signatures basename (ly:paper-book-systems book) 0))
+  
     (output-scopes scopes fields basename)
     (display (file-header paper page-count #t) port)
 
index 8ba25d53479865eae93627b4dbf131117400a757..d178c6926c80d7a6c1d1b6c9e9c1d8cb3dcf16b9 100644 (file)
@@ -428,6 +428,7 @@ possibly turned off."
   (define matches '())
   (define end-of-prev-match 0)
   (define (notice match)
+
     (set! matches (cons (substring (match:string match)
                                   end-of-prev-match
                                   (match:start match))
index fdbefd1f0ff04e9abe6f83a4b30e3d2fe13281f0..6b13e72d049bb388d6b624ce4ba1749b9993f75e 100644 (file)
@@ -269,6 +269,18 @@ grestore
        (ly:make-stencil "" '(0 . 0) '(0 . 0)))
     ))
 
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; output signatures.
+(define-public (write-system-signatures basename paper-systems count)
+  (if (pair? paper-systems)
+      (begin
+       (let*
+           ((outname (format "~a-~a.signature" basename count)) )
+            
+         (ly:message "writing ~a" outname)
+         (write-system-signature outname (car paper-systems))
+         (write-system-signatures basename (cdr paper-systems) (1+ count))))))
+
 
 (define-public (write-system-signature filename paper-system)
   (define (float? x)
@@ -276,9 +288,11 @@ grestore
 
   (define system-grob
     (paper-system-system-grob paper-system))
+  
   (define output (open-output-file filename))
   
   (define (strip-floats expr)
+    "Replace floats by #f"
     (cond
      ((float? expr) #f)
      ((ly:font-metric? expr) (ly:font-name expr))
@@ -287,6 +301,7 @@ grestore
      (else expr)))
 
   (define (fold-false-pairs expr)
+    "Try to remove lists of #f as much as possible."
     (if (pair? expr)
        (let*
            ((first (car expr))
@@ -307,7 +322,8 @@ grestore
        (else #f))))
 
   (define (pythonic-string expr)
-    (string-regexp-substitute "'" "\\'" (format "~a" expr)))
+    "escape quotes and slashes for python consumption"
+    (regexp-substitute/global #f "([\\\\'\"])" (format "~a" expr) 'pre "\\" 1 'post))
 
   (define (pythonic-pair expr)
     (format "(~a,~a)"
@@ -342,7 +358,9 @@ grestore
   (define (interpret-for-signature escape collect expr)
     (define (interpret expr)
       (let*
-         ((head (car expr)))
+         ((head (if (pair? expr)
+                    (car expr)
+                    #f)))
 
        (cond
         ((eq? head 'grob-cause) (escape (cdr expr)))
@@ -358,6 +376,8 @@ grestore
 
     (interpret expr))
 
+  (display (format "# Output signature\n# Generated by LilyPond ~a\n" (lilypond-version))
+          output)
   (interpret-for-signature found-grob (lambda (x) #f)
                           (ly:stencil-expr
                            (paper-system-stencil paper-system))))