This is what finally worked for me. Thanks to Orm Finnendahl:

Install emacs: http://emacsformacosx.com

Install LilyPond:

http://www.lilypond.org/index.de.html

For absolute beginners: open your terminal. Go to /Applications/Utilities/Terminal.app




Lilypond emacs-Setup OS X

At first add LilyPond to your PATH:
Open Terminal

sudo touch ~/.bash_profile

Open .bash-profile in your favorite editor and fill in:
export PATH="/Applications/LilyPond.app/Contents/Resources/bin:$PATH"

Save

control with echo $PATH

Now you can start LilyPond by typing "lilypond" in your terminal.

CD to /Applications/LilyPond.app/Contents/Resources/share/emacs/site-lisp

Type:

sudo ln -s /Applications/LilyPond.app/Contents/Resources/share/emacs/site-lisp /Applications/Emacs.app/Contents/Resources/site-lisp

Now we have to edit lilypond-mode.el. Right click on the LilyPond.app. Show packages: navigate to Applications/LilyPond.app/Contents/Resources/share/emacs/site-lisp

Open lilypond-mode.el in emacs
type M-g-g
Go to line 335 and change (defcustom LilyPond-lilypond-command
change to
(defcustom LilyPond-lilypond-command "/Applications/LilyPond.app/Contents/Resources/bin/lilypond"
"Command used to compile LY files."
:group 'LilyPond
:type 'string)

We want to use our Preview.App for PS-Files, so change the above lines, too.

(defcustom LilyPond-ps-command " /Applications/Preview.app/Contents/MacOS/Preview --watch"
"Command used to display PS files."

:group 'LilyPond
:type 'string)

The same is with our standard PDF-Viewer, we choose Safari for URL-Handling.

(defcustom LilyPond-pdf-command "/Applications/Safari.app/Contents/MacOS/Safari“
"Command used to display PDF files."

:group 'LilyPond
:type 'string)

/* not yet working as expected

Change MIDI

(defcustom LilyPond-midi-command "open"
"Command used to play MIDI files."

Change MIDI-Player to Logic Pro X.



(defcustom LilyPond-all-midi-command "/Applications/Logic\ Pro\ X.app/Contents/MacOS/Logic\ Pro\ X -ia"
"Command used to play MIDI files."

:group 'LilyPond
:type 'string) */

save with M-x-s

on a Mac now type alt-shift-:

type
(find-file user-init-file)

standard lilypond.mode-config-suggestions do not use .ily-files, so I modified them too. Copy and Paste the following to your .emacs

in emacs type C-y

(setq load-path (append (list (expand-file-name"/Applications/LilyPond.app/Contents/Resources/share/emacs/site-lisp")) load-path))
(autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t)
(add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
(add-to-list 'auto-mode-alist '("\\.ily$" . LilyPond-mode))
(add-to-list 'auto-mode-alist '("\\.lytex$" . LilyPond-mode))
(add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock)))

(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)

restart emacs

You are done

Open a LilyPond-file in emacs and you'll see!

Cookies facilitate the provision of our services. By using our services, you agree that we use cookies and you agree to use Google Analytics! Privacy policy.