lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lilypond-mode in Emacs on Windows


From: Jan Nieuwenhuizen
Subject: Re: lilypond-mode in Emacs on Windows
Date: Wed, 03 Jul 2002 00:58:51 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu)

"Peter Dixon" <address@hidden> 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).

> - 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?

> 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.

> 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?

> 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!

Greetings,
Jan.

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]