Keep "\""-signs for graphviz (issue 292110043 by thomasmorle...@gmail.com)

2016-03-22 Thread thomasmorley65

Reviewers: ,

Message:
Please review

Not sure, whether it's the best way to do it.

Description:
Keep "\""-signs for graphviz

Transform them to "\\\""

Please review this at https://codereview.appspot.com/292110043/

Affected files (+8, -2 lines):
  M ly/graphviz-init.ly


Index: ly/graphviz-init.ly
diff --git a/ly/graphviz-init.ly b/ly/graphviz-init.ly
index  
470faffa6ac36228222bb077a250e1fdb2e240cb..96f45ded93ccc3f784eeaea6e1ebe8a61764f2b1  
100644

--- a/ly/graphviz-init.ly
+++ b/ly/graphviz-init.ly
@@ -2,6 +2,8 @@

 #(use-modules (scm graphviz))

+#(use-modules (ice-9 regex))
+
 #(define last-grob-action '())

 #(define sym-blacklist '())
@@ -55,9 +57,13 @@

 #(define (grob-mod grob file line func prop val)
   (let* ((val-str (truncate-value val))
- (label (format #f "~a\\n~a:~a\\n~a <- ~a" (grob::name grob) file  
line prop val-str)))
+ (label (format #f "~a\\n~a:~a\\n~a <- ~a" (grob::name grob) file  
line prop val-str))

+ ;; to keep escaped "\"" we need to transform it to "\\\""
+ ;; otherwise the final pdf-creation will break
+ (escaped-label
+   (regexp-substitute/global #f "\"" label 'pre "\\\"" 'post)))
(if (relevant? grob file line prop)
-   (grob-event-node grob label file
+   (grob-event-node grob escaped-label file

 #(define (grob-cache grob prop callback value)
   (let* ((val-str (truncate-value value))



___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Keep "\""-signs for graphviz (issue 292110043 by thomasmorle...@gmail.com)

2016-03-26 Thread pkx166h

I cannot test this patch using the method suggested by Thomas from the
CG:

http://www.lilypond.org/doc/v2.19/Documentation/contributor/tracing-object-relationships

as it appears to no longer work (or we need more 'steps' or information
for those that don't know enough about how graphviz and LP are supposed
to work together).

So the least I can do is to test this the 'usual' way.

Passes make, make check and a full make doc.

https://codereview.appspot.com/292110043/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel