Currently, the editor for lilypond files (.ly) is a plain text editor. But the lilypond textual file format has a special editor called frescobaldi. It understand the format, and provides a graphical view of the music in addition to the text view. This makes it easier to work with lilypond music. Frescobaldi exists on linux, mac and windows, and is popular for working with lilypond.

So this patch specifies frescobaldi as the preferred editor for lilypond files. If it is not present, the usual text editors are fallback alternatives.

I have compiled, installed, and tested that LyX discovered the frescobaldi editor, and invoked it correctly for external editing.

I don't know if this is the right time, but it is a low-risk patch. It only touches configure.py. No file format change, and people who don't want to use frescobaldi probably don't have it. (And if they do, they are free to select vim/emacs/notepad instead.)

Helge Hafting

diff --git a/lib/configure.py b/lib/configure.py
index e9b789085e..c55580e190 100644
--- a/lib/configure.py
+++ b/lib/configure.py
@@ -651,7 +651,6 @@ def checkFormatEntries(dtl_tools):
 \Format r          R      "R/S code"              "" "" "%%"	"document,menu=export"	""
 \Format knitr      Rnw    "Rnw (knitr)"           "" "" "%%"	"document,menu=export"	""
 \Format knitr-ja   Rnw    "Rnw (knitr, Japanese)" "" "" "%%"	"document,menu=export"	""
-\Format lilypond   ly     "LilyPond music"        "" ""	"%%"	"vector"	"text/x-lilypond"
 \Format lilypond-book    lytex "LilyPond book (LaTeX)"   "" ""	"%%"	"document,menu=export"	""
 \Format lilypond-book-ja lytex "LilyPond book (pLaTeX)"   "" ""	"%%"	"document,menu=export"	""
 \Format latex      tex    "LaTeX (plain)"         L  ""	"%%"	"document,menu=export"	"text/x-tex"
@@ -665,6 +664,11 @@ def checkFormatEntries(dtl_tools):
 \Format text4      txt    "Plain text (catdvi)"   "" ""	"%%"	"document"	""
 \Format textparagraph txt "Plain Text, Join Lines" "" ""	"%%"	"document"	""
 \Format beamer.info pdf.info   "Info (Beamer)"         "" ""   "%%"    "document,menu=export"	""''' ])
+   #Lilypond files have special editors, but fall back to plain text editors
+    checkViewerEditor('a lilypond editor',
+        ['frescobaldi', 'xemacs', 'gvim', 'kedit', 'kwrite', 'kate',
+         'nedit', 'gedit', 'geany', 'leafpad', 'mousepad', 'xed', 'notepad'],
+        rc_entry = [r'''\Format lilypond   ly     "LilyPond music"        "" ""	"%%"	"vector"	"text/x-lilypond"''' ])
    #Spreadsheets using ssconvert from gnumeric
     checkViewer('gnumeric spreadsheet software', ['gnumeric'],
       rc_entry = [r'''\Format gnumeric gnumeric "Gnumeric spreadsheet" "" ""    "%%"   "document"	"application/x-gnumeric"

Reply via email to