Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 ;;;; | 1 ;;;; |
2 ;;;; lily-library.scm -- utilities | 2 ;;;; lily-library.scm -- utilities |
3 ;;;; | 3 ;;;; |
4 ;;;; source file of the GNU LilyPond music typesetter | 4 ;;;; source file of the GNU LilyPond music typesetter |
5 ;;;; | 5 ;;;; |
6 ;;;; (c) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org> | 6 ;;;; (c) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org> |
7 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> | 7 ;;;; Han-Wen Nienhuys <hanwen@xs4all.nl> |
8 | 8 |
9 ; for take, drop, take-while, list-index, and find-tail: | 9 ; for take, drop, take-while, list-index, and find-tail: |
10 (use-modules (srfi srfi-1)) | 10 (use-modules (srfi srfi-1)) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
89 (let ((value (ly:music-property music symbol))) | 89 (let ((value (ly:music-property music symbol))) |
90 (if (not (null? value)) | 90 (if (not (null? value)) |
91 value | 91 value |
92 #f))) | 92 #f))) |
93 (cond ((music-property 'page-marker) | 93 (cond ((music-property 'page-marker) |
94 ;; a page marker: set page break/turn permissions or label | 94 ;; a page marker: set page break/turn permissions or label |
95 (begin | 95 (begin |
96 (let ((label (music-property 'page-label))) | 96 (let ((label (music-property 'page-label))) |
97 (if (symbol? label) | 97 (if (symbol? label) |
98 (score-handler (ly:make-page-label-marker label)))) | 98 (score-handler (ly:make-page-label-marker label)))) |
99 » (for-each (lambda (symbol) | 99 » (for-each |
Patrick McCarty
2009/11/04 01:06:34
I would recommend indenting like so:
(for-each
Neil Puttock
2009/11/04 18:21:47
I'd recommend reverting the changes, since there's
Ian Hulin
2009/11/04 23:03:27
Done.
Ian Hulin
2009/11/04 23:03:27
Didn't get your e-mail until after I'd implemented
| |
100 » » (let ((permission (music-property symbol))) | 100 » (lambda (symbol) |
101 » » (if (symbol? permission) | 101 » (let ((permission (music-property symbol))) |
102 » » » (score-handler | 102 (if (symbol? permission) |
Neil Puttock
2009/11/05 00:40:44
aligns with `e' in (let
| |
103 » » » (ly:make-page-permission-marker symbol | 103 » » (score-handler |
104 » » » (if (eqv? 'forbid permission) | 104 » » (ly:make-page-permission-marker |
105 » » » » '() | 105 » » symbol |
106 » » » » permission)))))) | 106 » » (if (eqv? 'forbid permission) |
107 » » (list 'line-break-permission 'page-break-permission | 107 » » » '() |
108 » » » 'page-turn-permission)))) | 108 » » » permission)))))) |
109 » ((not (music-property 'void)) | 109 » (list 'line-break-permission 'page-break-permission |
110 » » 'page-turn-permission)))) | |
111 » ((not (music-property 'void)) | |
110 ;; a regular music expression: make a score with this music | 112 ;; a regular music expression: make a score with this music |
111 ;; void music is discarded | 113 ;; void music is discarded |
112 (score-handler (scorify-music music parser))))) | 114 (score-handler (scorify-music music parser))))) |
113 | 115 |
114 (define-public (collect-music-for-book parser music) | 116 (define-public (collect-music-for-book parser music) |
115 "Top-level music handler" | 117 "Top-level music handler" |
116 (collect-music-aux (lambda (score) | 118 (collect-music-aux (lambda (score) |
117 (collect-scores-for-book parser score)) | 119 (collect-scores-for-book parser score)) |
118 parser | 120 parser |
119 music)) | 121 music)) |
(...skipping 12 matching lines...) Expand all Loading... | |
132 (set! music (func music parser))) | 134 (set! music (func music parser))) |
133 toplevel-music-functions) | 135 toplevel-music-functions) |
134 | 136 |
135 (ly:make-score music)) | 137 (ly:make-score music)) |
136 | 138 |
137 | 139 |
138 (define (get-current-filename parser) | 140 (define (get-current-filename parser) |
139 "return any suffix value for output filename allowing for settings by | 141 "return any suffix value for output filename allowing for settings by |
140 calls to bookOutputName function" | 142 calls to bookOutputName function" |
141 (let ((book-filename (ly:parser-lookup parser 'book-filename))) | 143 (let ((book-filename (ly:parser-lookup parser 'book-filename))) |
142 (if (not book-filename) | 144 (if (not book-filename) |
Patrick McCarty
2009/11/04 01:06:34
The if block should be indented two more spaces he
Ian Hulin
2009/11/04 19:57:27
Done.
| |
143 (ly:parser-output-name parser) | 145 » (ly:parser-output-name parser) |
Patrick McCarty
2009/11/04 01:06:34
These two lines should begin in the same column as
Ian Hulin
2009/11/04 19:57:27
Done.
| |
144 book-filename))) | 146 » book-filename))) |
145 | 147 |
146 (define (get-current-suffix parser) | 148 (define (get-current-suffix parser) |
147 "return any suffix value for output filename allowing for settings by calls to | 149 "return any suffix value for output filename allowing for settings by calls to |
148 bookoutput function" | 150 bookoutput function" |
149 (let ((book-output-suffix (ly:parser-lookup parser 'book-output-suffix))) | 151 (let ((book-output-suffix (ly:parser-lookup parser 'book-output-suffix))) |
Patrick McCarty
2009/11/04 01:06:34
indent the if block
Ian Hulin
2009/11/04 19:57:27
Done.
| |
150 (if (not (string? book-output-suffix)) | 152 (if (not (string? book-output-suffix)) |
151 (ly:parser-lookup parser 'output-suffix) | 153 » (ly:parser-lookup parser 'output-suffix) |
Patrick McCarty
2009/11/04 01:06:34
align these with (not ...)
Ian Hulin
2009/11/04 23:03:27
Done.
| |
152 book-output-suffix))) | 154 » book-output-suffix))) |
153 | |
154 | 155 |
155 (define-public current-outfile-name #f) ; for use by regression tests | 156 (define-public current-outfile-name #f) ; for use by regression tests |
156 | 157 |
157 (define (get-outfile-name parser) | 158 (define (get-outfile-name parser) |
158 "return current filename for generating backend output files" | 159 "return current filename for generating backend output files" |
159 ;; user can now override the base file name, so we have to use· | 160 ;; user can now override the base file name, so we have to use· |
160 ;; the file-name concatenated with any potential output-suffix value | 161 ;; the file-name concatenated with any potential output-suffix value |
161 ;; as the key to out internal a-list | 162 ;; as the key to out internal a-list |
162 (let* ((base-name (get-current-filename parser)) | 163 (let* ((base-name (get-current-filename parser)) |
163 (output-suffix (get-current-suffix parser)) | 164 (output-suffix (get-current-suffix parser)) |
164 (alist-key (format "~a~a" base-name output-suffix)) | 165 (alist-key (format "~a~a" base-name output-suffix)) |
165 (counter-alist (ly:parser-lookup parser 'counter-alist))······ | 166 (counter-alist (ly:parser-lookup parser 'counter-alist))······ |
166 (output-count (assoc-get alist-key counter-alist 0)) | 167 (output-count (assoc-get alist-key counter-alist 0)) |
167 (result base-name)) | 168 (result base-name)) |
168 ;; Allow all ASCII alphanumerics, including accents | 169 ;; Allow all ASCII alphanumerics, including accents |
169 (if (string? output-suffix) | 170 (if (string? output-suffix) |
170 (set! result· | 171 (set! result· |
171 (format "~a-~a" | 172 (format "~a-~a" |
172 result· | 173 result· |
173 (string-regexp-substitute | 174 (string-regexp-substitute |
174 "[^-[:alnum:]]"· | 175 "[^-[:alnum:]]"· |
Neil Puttock
2009/11/05 00:40:44
goes with `s' in string-regexp-substitute
| |
175 "_" | 176 "_" |
Neil Puttock
2009/11/05 00:40:44
as above
| |
176 output-suffix)))) | 177 output-suffix)))) |
Neil Puttock
2009/11/05 00:40:44
as above
| |
177 ···· | 178 ···· |
178 ;; assoc-get call will always have returned a number | 179 ;; assoc-get call will always have returned a number |
179 (if (> output-count 0) | 180 (if (> output-count 0) |
180 (set! result (format #f "~a-~a" result output-count))) | 181 (set! result (format #f "~a-~a" result output-count))) |
181 ···· | 182 ···· |
182 (ly:parser-define! | 183 (ly:parser-define! |
183 parser 'counter-alist | 184 parser 'counter-alist |
184 (assoc-set! counter-alist alist-key (1+ output-count))) | 185 (assoc-set! counter-alist alist-key (1+ output-count))) |
185 (set! current-outfile-name result)· | 186 (set! current-outfile-name result)· |
186 result)) | 187 result)) |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 (format #f | 698 (format #f |
698 (_ "no \\version statement found, please add~afor future compatibili ty") | 699 (_ "no \\version statement found, please add~afor future compatibili ty") |
699 (format #f "\n\n\\version ~s\n\n" (lilypond-version))))) | 700 (format #f "\n\n\\version ~s\n\n" (lilypond-version))))) |
700 | 701 |
701 (define-public (old-relative-not-used-message input-file-name) | 702 (define-public (old-relative-not-used-message input-file-name) |
702 (ly:message | 703 (ly:message |
703 "~a:0: ~a ~a" | 704 "~a:0: ~a ~a" |
704 input-file-name | 705 input-file-name |
705 (_ "warning:") | 706 (_ "warning:") |
706 (_ "old relative compatibility not used"))) | 707 (_ "old relative compatibility not used"))) |
LEFT | RIGHT |