Sorry that it has taken me so long to respond to your helpful comments. I have been working on it, and cearing out a virus...
----- Original Message ----- From: "Jan Nieuwenhuizen" <[EMAIL PROTECTED]> To: "Peter Dixon" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, July 02, 2002 11:58 PM Subject: Re: lilypond-mode in Emacs on Windows > "Peter Dixon" <[EMAIL PROTECTED]> writes: > > > I have been running Lilypond under Linux for 2 years quite successfully > > and am now wanting to move to Windows. There are 2 reasons: > > Sure, whatever gets you going. However, > > > - our Linux machine is silent (no sound card), and we are making increasing > > use of MIDI output. > > a simple soundcard can be quite cheap (~$20). I would really rather not have sound on that machine because of what it is used for and where it is. > > > - although I have learnt a great deal about music and typesetting through > > using Lilypond I feel that the Linux-phobic musicians would be more > > effective if they did it rather than telling me what to do. > > you loose me here. Could you rephrase that? Sorry - I am finding this sentence confusing too now :-( I set the system up on Linux and enjoy using it but I feel that the musicians on our network would get on better if they used LilyPond instead of passing the scripts to me. Unfortunately they are not willing to learn Linux. > > > I have installed Lilypond 1.4.14.jcn3-1 onto Cygwin 1.3.10-1, and GNU > > emacs 21.2 on Windows XP. I chose to install emacs directly onto > > Windows. LilyPond and Emacs are both working successfully and > > "lilypond-mode" is syntax-colouring the .ly files. > > Ok. Now, that's quite interesting. From our 'lily-on-windows' > documentation page: > > [TODO: > > > * emacs-mode installation, figure out and describe proper > emacs-on-cygwin setup. > > In other words, this has never been done, or at least, no-one has made > a comment or written documentation about this before. > > Installing Emacs directly for Windows seems the only way, currently. > However, XFree 4.2 has just been ported to Cygwin, it could be > interesting to watch what happens there, wrt Emacs. > > > My problem comes when I press the "2PS" command: > > > > cd c:/cygwin/home/Peter/ > > ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly > > 'ly2dvi' is not recognized as an internal or external command, > > operable program or batch file. > > That's what you would expect. Ly2dvi is a Python script. Windows is > (afaik) not able to run scripts that need interpreters directly, other > than .BAT and .CMD or possibly other Microsoft script products (that > can be executed directly through email messages :-) > > What you can try is to make a wrapper .BAT script, like so: > > ly2dvi-dos.bat: > REM Duh. Let's hope no more than 9 arguments are used. > REM Hope I'm not showing my ignorance here. > python /usr/bin/lyd2vi %1 %2 %3 %4 %5 %6 %7 %8 %9 > > and put that in your path. You could also try to edit or override the > LilyPond-command-alist in lilypond-mode.el, like so: > > (defcustom LilyPond-command-alist > `( > ;; Lily probably works, as it's an .exe > ("LilyPond" . ("lilypond %s" . "TeX")) > > ;; Tex also > ("TeX" . ("tex '\\nonstopmode\\input %t'" . "View")) > > ;; Windows can't handle 3rd party interpeters, call them explicitely > ;;("2Dvi" . ("ly2dvi %s" . "View")) > ;;("2PS" . ("ly2dvi -P %s" . "View")) > ("2Dvi" . ("python /usr/bin/ly2dvi %s" . "View")) > ("2PS" . ("python /usr/bin/ly2dvi -P %s" . "View")) > > all of this untested, of course. I tried this but it looks as if cmdproxy.exe cannot run python. I get the message: The NTVDM CPU has encountered an illegal instruction CS:0f2d IP:210f OP:6369666965 > > > 2PS exited abnormally with code 1 at Fri Jun 28 18:38:02 > > ---------------------------------- > > > > I tried changing the emacs variable 'shell-file-name' from > > "c:/emacs/bin/CMDproxy.exe" to "c:/cygwin/bin/sh/exe" and then got: > > > > cd c:/cygwin/home/Peter/ > > ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly > > ly2dvi: not found > > > > 2PS exited abnormally with code 127 at Fri Jun 28 18:42:33 > > -------------------------------- > > That's interesting, but won't that break other usage of shell > commands? Yes...I have tried setting shell-file-name as a buffer-local-variable in lilypond-mode-hook, but of course the buffer is *2ps*, not the .ly buffer. > > > I then started emacs from cygwin using /cygdrive/c/emacs/bin/runemacs. > > After changing shell-file-name as above I got: > > > > cd c:/cygwin/home/Peter/ > > ly2dvi -P c:/cygwin/home/Peter/praedulium-fuga-E.ly > > Hmm. That's strange. > > > Running LilyPond... > > GNU LilyPond 1.4.14.jcn3 > > warning: can't find file: > > `/home/Peter/c:/cygwin/home/Peter/praedulium-fuga-E' > > No, of course not :-) 'c:/cygwin/home/...' does not start with a /, > and thus is a relative filename, for POSIX tools. > > > I've searched http://lilypond.org/ and > > http://www.gnu.org/software/emacs/windows/ for hints on configuring emacs > > without success. What should I do? > > I'm not sure. Probably experiment some more. The remaining problem > seems to be, that Emacs is using windows style names to pass them on > to ly2dvi. Did you install cygwin-mount.el (if you haven't, search on > google for the latest version). Maybe that helps. > > If it doesn't, you must try to convert the DOS style filenames > yourself. You can do that using the 'cygpath' tool (I hope that's > still the name). You could try something like: > > ly2dvi-dos.bat: > REM second try > bash /usr/bin/lyd2vi-wrapper.sh > > and then: > > /usr/bin/ly2dvi-wrapper.sh: > #!/bin/bash > # let's hope $1 is our dos style filename > lyd2vi `cygpath -u $1` > > If you're handy with Emacs lisp, you can try to convert the DOS style > file name in lilypond-mode.el directly, that would be less of a kludge. > > I hope you can manage, if you need more hints or info, just ask. It > would be very nice if you could figure out a nice way to use emacs > with lily on Windows, so that we can document that! Thanks. I'm happy to keep trying. I'll have a go at using your wrapper suggestion next. > > Greetings, > Jan. > > -- > Jan Nieuwenhuizen <[EMAIL PROTECTED]> | GNU LilyPond - The music typesetter > http://www.xs4all.nl/~jantien | http://www.lilypond.org > _______________________________________________ Lilypond-user mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/lilypond-user