lilypond-user
[Top][All Lists]
Advanced

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

Re: mac osx pdf point-and-click [was: mac osx emacs lilypond-mode]


From: Sean Reed
Subject: Re: mac osx pdf point-and-click [was: mac osx emacs lilypond-mode]
Date: Fri, 13 May 2005 10:11:53 +0200

hi arjan,

this is my first real contribution to furthering knowledge on the list!
i've gotten the point-and-click to work on macos 10.3.9 with ly 2.5.23, but with a couple of ticks which you (or maybe han-wen or others?) could help me iron out.

the solution was to do everything in xwindows with x11 and not from the terminal.app (which you perhaps already knew?)

here's what i did:
1) i installed firefox from FINK to be run from an xterm in apple's x11.

2) i added the following lines to the prefs.js file in ~HOME/.mozilla/firefox/vgftrus6.default/, with the full path to the lilypond-pdfpc-helper (not given on the lilypond website documentation):

user_pref("network.protocol-handler.app.textedit", "/sw/bin/lilypond-pdfpc-helper");
user_pref("network.protocol-handler.warn-external.textedit", false);

3) i installed Xpdf using FINK

4) i added the following line to the xpdfrc file in /sw/etc/; again note the full path:

urlCommand     "/sw/bin/firefox -remote 'openURL(%s)'"

5) i modified the editor search in the lilypond-pdfpc-helper binary in /sw/bin/ to read (again note the full path):

if ly_pc_editor == None:
        if  re.search ("emacs", editor):
ly_pc_editor = '/sw/bin/emacsclient --no-wait +%(line)s:%(column)s %(file)s'

6) i then start apple's x11, and start /sw/bin/emacs from an xterm (this is one point where you may be able to help me: i can't figure out where to set the commands for the xterm so that i can just type "emacs" and have it automatically prepend the /sw/bin/)

7) you have to start the emacs server with M-x server-start

8) in a new xterm i then select emacs as the EDITOR using: export EDITOR="/sw/bin/emacs" (this is the next point you may be able to help me with. when i just enter "export" i see that, for example, the SHELL is set to bash etc., but no default for EDITOR. i can't seem to find the file to enter the EDITOR default, which is apparently, for example, the .profile file for the Terminal.app. I added export EDITOR="/sw/bin/emacs" to the bashrc file, but this didn't seem alleviate having to do it by hand in the xterm).

9) then i start firefox in a new xterm with /sw/bin/firefox

10) in another new xterm i start /sw/bin/xpdf

11) i load a pdf file made with ly2.5.23 into xpdf.

12) clicking on a note or other object now opens the corresponding lilypond file and takes me to A spot in the script. (it doesn't call emacs to the front though).

This final point is the tick, and may be where han-wen or somebody could add some advice. It takes me to the line and number as stated in the textedit:// hyperlink, but this is not the corresponding code for the given object. it is generally a line or two down. I checked to see if it had anything to do with lines which have been commented out, but it doesn't seem to. i'm wondering if it is different with a single voice lilypond file, but as yet have only tried it with multiple voice files.

In the hope that this may help you out a bit, and that we can find the last step in the chain to the correct position in the lilypond file!!

Best,
Sean

ps: my autoload still doesn't work for lilypond files in emacs, even in the xwindows environment. i'll keep trying to figure that out.

--------------------------------------------
Sean Reed
Hamburg, Germany
Web: www.seanreed.de

On 11.05.2005, at 20:16, Arjan Bos wrote:


On 10 mei 2005, at 9:18, Sean Reed wrote:

hi arjan,

thanks, that got me a useable LilyPond mode in emacs.
i still have to load it by hand with the M-x load-library, and i think it only works when i load the lilypond-init.el despite the "autoload" in the .emacs file, opening an .ly file doesn't automatically load the mode.
Strange, I copied the part straight from my .emacs file, and for me it works.


when i try to just load lilypond-mode and open an .ly file i get an error message: Wrong type argument: arryp, nil
This I get as well. I never took the time to really figure out why. I think I was put off by the strange way the syntax-table is organized.


if i M-x load-library "lilypond-init.el", then C-x C-f a lilypond file, it loads in LilyPond mode, but gives me the error: Error in post-command-hook: (wrong-type-argument integerp nil), but the buffer is LilyPond mode, the lilypond menu is available, and it for all i can determine, it works.

the pdf point-and-click isn't working for me yet either.

i installed firefox and Xpdf, changed the firefox prefs.js to include the user_pref() statements for lilypond-pdfpc-helper textedit protocol, and added the urlCommand to the xpdfrc file. xpdf shows me the textedit:// link when i point at a note, but doesn't open the text editor.

i tried running lilypond-pdfpc-helper alone from terminal by manually entering a path to a file and a :line:character, and got the following error:

Traceback (most recent call last):
  File "/sw/bin/lilypond-pdfpc-helper", line 78, in ?
    editor = os.environ['EDITOR']
  File "/sw/lib/python2.3/UserDict.py", line 19, in __getitem__
    def __getitem__(self, key): return self.data[key]
KeyError: 'EDITOR'


You might have found the answer yourself already. What you need is to define an environment variable called "EDITOR" pointing to the editor you use. In the Terminal you start lilypond from you need to do:
 export EDITOR=/sw/bin/emacs
or some other editor of choice. This is for bash. I forgot the tcsh syntax. For convenience sake, you can put that export command in your .profile file.

is it possible that there is a different command necessary to determine the EDITOR for darwin? can i determine whether emacs or a given text editor is set as default for my darwin environment? or can i set that to emacs? or is textedit a protocol that isn't available on darwin? when i placed the hyperlink of a note from the pdf directly into the firefox address box i got the message that firefox didn't support the textedit protocol. is it possible that the macos firefox doesn't? sorry for all the questions.

btw: Bertalan: is there a LilyTool available or becoming available that will allow point-and-click with ly 2.5.23 in jEdit?

thanks for the assistance.

best,
sean

ps: thanks for the auctex tip.

--------------------------------------------
Sean Reed
Hamburg, Germany
Web: www.seanreed.de

On 09.05.2005, at 08:24, arjan.bos wrote:

Sean,

Did you put in your .emacs the code that links .ly files with lilypond-mode?
You can do this by adding:
;; lilypond
(autoload 'LilyPond-mode "lilypond-mode" "LilyPond Editing Mode" t)
(add-to-list 'auto-mode-alist '("\\.ly$" . LilyPond-mode))
(add-hook 'LilyPond-mode-hook (lambda () (turn-on-font-lock)))

Or, alternatively, you can use M-x load-library [ret] lilypond-mode
to load lilypond mode. This makes the lilypond functions available to emacs. You then are able to switch on lilypond mode by M-x LilyPond-mode. Please be aware that these names are case-sensitive.

HTH,
Arjan

Btw [ot] When starting with Latex in emacs, please consider auctex as an enhanced latex-mode. It helps with a lot of small things, like placing the correct environment with begin and end, changing fonts and things like that.


-----Oorspronkelijk bericht-----
Van:    Sean Reed [mailto:address@hidden
Verzonden:      zo 8-5-2005 1:22
Aan:    Arjan Bos
CC:     lilypond-user's list
Onderwerp:      Re: mac osx emacs lilypond-mode
hi arjan,

thanks for the response.
i still must be doing something wrong, or not understanding something.

i created an .emacs file and added-to-list 'load-path the directories
/sw/etc/emacs21/site-start.d (where i have lilypond-init.el) and
/sw/share/emacs21/site-lisp (where i have lilypond-mode.el, -indent.el, -font-lock.el etc.). having quit and restarted the program, i used C-h
v load-path and saw that both directories were now indeed listed the
load-paths.

but M-x gave me no option for loading any lilypond-mode.
is that not how you load it?
could it be a version discrepancy? (installed emacs 21.3.50 via fink
today).

i am (pretty much) brand new (again) to emacs and went through the
whole tutorial with C-h t today. even if the point-and-click doesn't
work out, i would be interested in learning it a bit more, since i
would consider using it for latex documents and eventually for CLM at
some point again (which is where i used it bumbingly a couple of months
5 years ago for the first time).

thanks again for any tips.

best,
sean

--------------------------------------------
Sean Reed
Hamburg, Germany
Web: www.seanreed.de

On 07.05.2005, at 21:21, Arjan Bos wrote:

To create a .emacs file, simply start editing one. For example by:
 C-x C-f ~/.emacs

If you do:
C-h v load-path
it will show you the path emacs searches when it looks for files.
There are bound to be a whole lot of directories in them. Just put
your files in one of them. Alternatively, if you want to add a
directory to the load-path, add the following to your .emacs file:
(add-to-list 'load-path "/sw/share/emacs/site-lisp" t)
Where /sw/share/emacs/site-lisp is the name of the directory you want
to add to the load-path.

By the way, if you are new to emacs, it wouldn't do no harm to read
the tutorial which you can access via the 'help' menu, or via C-h t
(That is control-h t)

I never could get point-and-click to work on Mac OS X 10.3.n, not even when using X11 and xdvi and emacs via X11, so if it works for you I'd
be delighted to know.

Hope this helps,

Arjan Bos

On 7 mei 2005, at 18:26, Sean Reed wrote:

might anyone have any hints on how to get the emacs lilypond-mode to
work on macos 10.3.9?

i have been using jEdit very happily up to now, but the
point-and-click function doesn't seem to be compatible with the two
versions i have (2.5.23 and 2.5.0). it returns a bean shell error
when i try to "enable point-and-click" and selecting "view output
dvi" gives me an empty jDvi viewer.

the documentation for the new pdf hyperlink point-and-click addresses
emacs and vim, so i thought i'd try emacs.

the installation documentation for lilypond-mode in emacs doesn't
refer specifically to macos 10.x and i can't figure out where to put
the .el files. i can find no .emacs file, and no matter which
combination of where i place the lilypond-init.el and other .el files into the various /site-start and /site-lips folders i've found, when
i start emacs and perform an M-x, i am offered no option for
lilypond-mode. (i assume this is the correct procedure, since i can
successfully select latex-mode this way and it functions fine).

i have made long attempts with the fink installation of emacs,
XEmacs, enhanced carbon emacs, and emacs for aqua, but just ain't
gettin' it.

i have installed firefox and Xpdf, as the documentation instructs,
and modified the xpdfrc and prefs.js files. all three of my PDF
viewers successfully identify the hyperlinks (Xpdf, Preview, and
Acrobat Reader), but clicking on them does nothing.

thanks in advance for any clues.

best,
sean

--------------------------------------------
Sean Reed
Hamburg, Germany
Web: www.seanreed.de



_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user


---
Multiple exclamation marks are a sure sign of a sick mind

-- (Terry Pratchett, Mort)








_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user


---
A marriage is always made up of two people who are prepared to swear that only the other one snores.

-- (Terry Pratchett, The Fifth Elephant)






reply via email to

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