]> git.donarmstrong.com Git - lilypond.git/blobdiff - lilypond-mode.el
patch::: 1.3.38.jcn1
[lilypond.git] / lilypond-mode.el
index e4e6e4d2348fa0fe1a7294759c37f114d815a365..8a4c7ccf6fa0c5419c6403b68fd8e3e67ff073ad 100644 (file)
   "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))))