"Run LilyPond on buffer."
(interactive)
(let ((buffer (buffer-name)))
- (if buffer-file-name
+ (if (buffer-file-name)
(progn
(lily-save-buffer)
- (lily-compile-file lily-command lily-parameters buffer))
+ (lily-compile-file lily-command lily-parameters (buffer-file-name)))
(progn
(error "Buffer %s is not associated with a file" buffer)
(lily-eval-region (min-point) (max-point))))))
(let ((basename "emacs-lily")
(suffix (if (string-match "^[\\]score" (buffer-substring start end))
".ly"
- (if (> 50 (abs (- start end)))
- ".fly")
- ".sly")))
+ (if (< 50 (abs (- start end)))
+ ".fly"
+ ".sly"))))
(write-region start end (concat basename suffix) nil 'nomsg)
(lily-compile-file lily-command lily-parameters (concat basename suffix))))