diff options
author | Thomas White <taw@physics.org> | 2023-06-04 11:55:09 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2023-06-04 11:55:09 +0200 |
commit | 61bef7ed7a0592dc8ca4718070c09958543d0b4c (patch) | |
tree | bb93db977a2accc4c6ae4d7c1d6ad00d4ce9d614 | |
parent | 09a6e6516946949a7794a2a04d480a95b0ff36ba (diff) |
get-selection-as-string: Set dotted form of fixture name
Previously it sent "(list-ref xxx nnn)", which is much harder to parse
and defeats the point of using a string instead of a Scheme expression
here.
This routine is currently only used for OSC selection updates.
-rw-r--r-- | guile/starlet/selection.scm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/guile/starlet/selection.scm b/guile/starlet/selection.scm index 7e5ca1a..2798fc1 100644 --- a/guile/starlet/selection.scm +++ b/guile/starlet/selection.scm @@ -41,12 +41,20 @@ selection) +(define (dotted-fixture-name s) + (with-output-to-string + (lambda () + (format #t "~a.~a" (second s) (third s))))) + + (define (get-selection-as-string) (cat-with-spaces (map (lambda (s) - (symbol->string - (get-fixture-name s))) + (let ((name (get-fixture-name s))) + (if (symbol? name) + (symbol->string name) + (dotted-fixture-name name)))) selection))) |