]> code.delx.au - gnu-emacs/blobdiff - lisp/org/ob-lilypond.el
Add 2012 to FSF copyright years for Emacs files
[gnu-emacs] / lisp / org / ob-lilypond.el
index 23f5d511d3410cd8dae6b609f2fd8b33530f9b29..0dde0de9e42b163b825805d988c59f139dab323c 100644 (file)
@@ -1,11 +1,10 @@
 ;;; ob-lilypond.el --- org-babel functions for lilypond evaluation
 
-;; Copyright (C) 2010  Free Software Foundation, Inc.
+;; Copyright (C) 2010-2012  Free Software Foundation, Inc.
 
 ;; Author: Martyn Jago
 ;; Keywords: babel language, literate programming
 ;; Homepage: https://github.com/mjago/ob-lilypond
-;; Version: 7.7
 
 ;; This file is part of GNU Emacs.
 
@@ -115,7 +114,7 @@ blocks")
                body))))
      vars)
     body))
+
 (defun org-babel-execute:lilypond (body params)
   "This function is called by `org-babel-execute-src-block'.
 Depending on whether we are in arrange mode either:
@@ -139,7 +138,7 @@ specific arguments to =org-babel-tangle="
 
 (defun ly-process-basic (body params)
   "Execute a lilypond block in basic mode"
-  
+
   (let* ((result-params (cdr (assoc :result-params params)))
         (out-file (cdr (assoc :file params)))
         (cmdline (or (cdr (assoc :cmdline params))
@@ -148,7 +147,7 @@ specific arguments to =org-babel-tangle="
 
     (with-temp-file in-file
       (insert (org-babel-expand-body:generic body params)))
-    
+
     (org-babel-eval
      (concat
       (ly-determine-ly-path)
@@ -178,7 +177,7 @@ If error in compilation, attempt to mark the error in lilypond org file"
           (ly-temp-file (ly-switch-extension
                          (buffer-file-name) ".ly")))
       (if (file-exists-p ly-tangled-file)
-          (progn 
+          (progn
             (when (file-exists-p ly-temp-file)
               (delete-file ly-temp-file))
             (rename-file ly-tangled-file
@@ -244,7 +243,7 @@ FILE-NAME is full path to lilypond file"
   "Mark the erroneous lines in the lilypond org buffer.
 FILE-NAME is full path to lilypond file.
 LINE is the erroneous line"
+
   (switch-to-buffer-other-window
    (concat (file-name-nondirectory
             (ly-switch-extension file-name ".org"))))
@@ -257,7 +256,7 @@ LINE is the erroneous line"
           (set-mark (point))
           (goto-char (- (point) (length line))))
       (goto-char temp))))
-  
+
 (defun ly-parse-line-num (&optional buffer)
   "Extract error line number."
 
@@ -285,7 +284,7 @@ LINE is the erroneous line"
   "Extract the erroneous line from the tangled .ly file
 FILE-NAME is full path to lilypond file.
 LINENO is the number of the erroneous line"
+
   (with-temp-buffer
     (insert-file-contents (ly-switch-extension file-name ".ly")
                          nil nil nil t)
@@ -295,12 +294,12 @@ LINENO is the number of the erroneous line"
          (forward-line (- lineNo 1))
          (buffer-substring (point) (point-at-eol)))
       nil)))
-    
+
 (defun ly-attempt-to-open-pdf (file-name &optional test)
   "Attempt to display the generated pdf file
 FILE-NAME is full path to lilypond file
 If TEST is non-nil, the shell command is returned and is not run"
-  
+
   (when ly-display-pdf-post-tangle
     (let ((pdf-file (ly-switch-extension file-name ".pdf")))
       (if (file-exists-p pdf-file)
@@ -341,7 +340,7 @@ If TEST is non-nil, it contains a simulation of the OS for test purposes"
 (defun ly-determine-pdf-path (&optional test)
   "Return correct path to pdf viewer depending on OS
 If TEST is non-nil, it contains a simulation of the OS for test purposes"
-  
+
   (let ((sys-type
          (or test system-type)))
     (cond ((string= sys-type  "darwin")
@@ -353,7 +352,7 @@ If TEST is non-nil, it contains a simulation of the OS for test purposes"
 (defun ly-determine-midi-path (&optional test)
   "Return correct path to midi player depending on OS
 If TEST is non-nil, it contains a simulation of the OS for test purposes"
-   
+
   (let ((sys-type
          (or test test system-type)))
     (cond ((string= sys-type  "darwin")
@@ -361,10 +360,10 @@ If TEST is non-nil, it contains a simulation of the OS for test purposes"
           ((string= sys-type "win32")
            ly-win32-midi-path)
           (t ly-nix-midi-path))))
+
 (defun ly-toggle-midi-play ()
   "Toggle whether midi will be played following a successful compilation"
-  
+
   (interactive)
   (setq ly-play-midi-post-tangle
         (not ly-play-midi-post-tangle))
@@ -374,7 +373,7 @@ If TEST is non-nil, it contains a simulation of the OS for test purposes"
 
 (defun ly-toggle-pdf-display ()
   "Toggle whether pdf will be displayed following a successful compilation"
-   
+
   (interactive)
   (setq ly-display-pdf-post-tangle
         (not ly-display-pdf-post-tangle))
@@ -442,6 +441,6 @@ dependent on LY-ARRANGE-MODE"
 
 (provide 'ob-lilypond)
 
-;; arch-tag: ac449eea-2cf2-4dc5-ae33-426f57ba4894
+
 
 ;;; ob-lilypond.el ends here