lilypond-user
[Top][All Lists]
Advanced

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

Re: Point & Click with Atom


From: David Wright
Subject: Re: Point & Click with Atom
Date: Sat, 31 Oct 2020 21:13:35 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Sat 31 Oct 2020 at 18:21:53 (+0100), Martín Rincón Botero wrote:
> Am Sa., 31. Okt. 2020 um 18:03 Uhr schrieb Henning Hraban Ramm 
> <lilypondml@fiee.net>:
> > > Am 31.10.2020 um 17:45 schrieb Martín Rincón Botero 
> > > <martinrinconbotero@gmail.com>:
> > >
> > > I went over the Usage Manual for trying to configure Point & Click so
> > that I can use it with Atom (as much as I like Frescobaldi, its poor
> > performance with large scores makes it unusable after a certain number of
> > lines of code). The usage manual
> > http://lilypond.org/doc/v2.20/Documentation/usage/configuring-the-system-for-point-and-click
> > says to "simply" write this line export LYEDITOR=atom, but doesn't say
> > where. After that I suppose I can go to the GNOME 3 steps and follow them,
> > but since those steps don't mention any particular editor, I guess I should
> > first know what to do with said export line.
> >
> > Try if it works in your shell (e.g. bash) before you call lilypond.
> >
> > If it works, you should add it to the startup file of your default shell,
> > e.g. .bashrc or .bash_profile
> 
> thank you for your answer. I don't think I understand correctly. I open a
> terminal and type export LYEDITOR=atom, hit Enter and then write something
> like lilypond myfile.ly? If it works (I just tried that and it didn't), I
> add the export line to .bashrc and then follow the steps in the Manual for
> Gnome 3 (I'm using Ubuntu 18.04)?

AIUI, point-and-click is always On in LilyPond unless you turn it off
with, say, -dno-point-and-click. The programs that need to know how to
call your editor are the one displaying the PDF (which needs to be
told to run lilypond-invoke-editor in response to clicks), and
lilypond-invoke-editor (which needs to know which editor to invoke).

You should be able to test things manually at the commandline. For
example, here are the steps I would use. They don't involve Gnome
(which I don't use), and so the steps make it clearer what you're
actually trying to communicate.

My PDF viewer, Xpdf, has this line in its startup file, ~/.xpdfrc:
  urlCommand    "lilypond-invoke-editor %s"
This will make a LeftClick call lilypond-invoke-editor with the URI
string embedded at that point in the PDF file.

lilypond-invoke-editor will use scm/editor.scm to determine the editor
(from LYEDITOR/XEDITOR/EDITOR environment variables) and call it
appropriately. (It appears to know how to call atom, emacs, geany,
gedit, gvim, jedit, kate, lilypad, nedit, syn and uedit32.)
"Appropriately" typically means that it looks for a "remote" server
instance of the editor that has already been started, eg with
$ gvim --servername GVIM
but I'm not certain how this call is done for Atom. (I don't see a
special argument in the atom template, and I know nothing about atom.)

The editor is expected to parse the filename, line number and column
number from the arguments, and put its cursor at the correct point.

So in this simple text-based scenario, it's enough to pass the
LYEDITOR environment variable to Xpdf, by typing, for example,
$ LYEDITOR=gvim xpdf my-grand-opera.pdf
because Xpdf's children (like lilypond-invoke-editor) inherit it.

On a linux system, like my Debian, lilypond-invoke-editor writes
a line (on the terminal Xpdf was started from) each time it is
invoked, which shows the first step is working.

You can also test the lilypond-invoke-editor step by calling it
manually. (There's nothing special about it.) So, for example,
$ EDITOR=gvim lilypond-invoke-editor textedit:///etc/fstab:22:8:9
will open the system's /etc/fstab file and point to the ninth
(or eighth?¹) character on the 22nd line. If you get
    E247: no registered server named "GVIM": Send failed.
then lilypond-invoke-editor hasn't found the editor server for
some reason (eg it hasn't yet been started).

In order to make evince and zathura (alternative PDF viewers to
Xpdf) respond to LeftClicks, I had to follow the GNOME3 instructions
from LP's Usage guide, but they worked fine, so I won't post my crib.
(BTW, it's a double-click for zathura.) I think evince was a bit
noisy (with warning messages). I guess these viewers were designed by
and for Desktop Environment users, whereas Xpdf is 25 years old.

How to set an environment variable in Gnome is beyond my pay-grade.
Here's LWN.net in their "GNOME, Wayland, and environment variables"
article:

   "The problem, it seems, is that shells and environment variables
    (…) are seen as how our grandparents ran their computers. If one
    deals only with graphical applications, there is almost no scope
    for a shell to make an appearance at all, so it seems strange, to
    some, to involve the shell at login time. Environment variable
    definitions in shell startup files have been a common Unix
    customization method since the earliest days but, evidently,
    there is no easy place for that method in 2016.

¹ I'm not sure of the distinction between Character and Column in the
  textedit string. Perhaps it's used by spreadsheets or something.

Cheers,
David.



reply via email to

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