]> git.donarmstrong.com Git - lilypond.git/commitdiff
(LY_DEFINE): deprecate
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 27 Feb 2005 17:25:21 +0000 (17:25 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 27 Feb 2005 17:25:21 +0000 (17:25 +0000)
ly:set-point-and-click

13 files changed:
ChangeLog
Documentation/user/point-and-click.itely
input/les-nereides.ly
input/mutopia/F.Schubert/standchen.ly
input/mutopia/J.S.Bach/baerenreiter-sarabande.ly
input/regression/page-breaks.ly
input/simple-song.ly
lily/include/main.hh
lily/lily-parser-scheme.cc
ps/music-drawing-routines.ps
scm/output-ps.scm
scripts/convert-ly.py
scripts/lilypond-pdfpc-helper.py

index bda00eb12b986f44206b11710803fd41b952c564..76c70f9821493f22bb33da1229b107fc9767f2b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/lily-parser-scheme.cc (LY_DEFINE): deprecate
+       ly:set-point-and-click
+
 2005-02-27  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * ps/music-drawing-routines.ps (mark_file_line): Switch Action
@@ -8,6 +13,9 @@
 
 2005-02-27  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * Documentation/user/point-and-click.itely: update for PDF point &
+       click.
+
        * scripts/lilypond-pdfpc-helper.py: new file. Invoke different
        editors based on EDITOR setting.
 
index 019d9238625c43df2bc0c068970aa15590744591..df12403bddc59545a9e15b9ce855caced29ea401 100644 (file)
 @appendix Point and click
 @cindex point and click
 
-@cindex source specials
-@cindex specials, source
-
-Point and click lets you find notes in the input by clicking on them in
-the Xdvi window.  This makes it easier to find input that causes some
-error in the sheet music.
-
-To use it, you need the following software:
-
-@itemize @bullet
-@item a dvi viewer that supports src specials.
-
-The most obvious choice is Xdvi@footnote{KDVI also provides src
-@cindex Xdvi
-@cindex KDVI
-@cindex KDE
-specials, but does not use the kpathsea library, so it cannot find
-LilyPond font and PostScript library files.}, version 22.36 or newer.
-It is available from
-@uref{ftp://@/ftp@/.math@/.berkeley@/.edu/@/pub/@/Software/@/TeX/@/xdvi@/.tar@/.gz,
-ftp@/.math@/.berkeley@/.edu}.
-
-Most @TeX{} distributions ship with @command{xdvik}, which is always a few
-versions behind the official Xdvi.  To find out which Xdvi you are
-running, try @code{xdvi -version} or @code{xdvi.bin -version}.
 
-@item an editor with a client/@/server interface (or a lightweight GUI
-editor):
 
 
-@cindex editor
-
-@itemize @minus
-@item
-Emacs.  Emacs is an extendable text editor.  It is available from
-@uref{http://@/www@/.gnu@/.org/@/software/@/emacs/}.  You need version 21
-to use column location.
-
-@c move this elsewhere?
+@cindex source specials
+@cindex specials, source
 
+Point and click lets you find notes in the input by clicking on them
+in the PDF viewer.  This makes it easier to find input that causes
+some error in the sheet music.
 
-@cindex Emacs
-@cindex Emacs mode
-@cindex lilypond-mode for Emacs
-@cindex syntax coloring
+When this functionality is active, LilyPond adds hyperlinks to the PDF
+file. These hyperlinks are sent to the web-browser, which opens a
+text-editor with the cursor in the right place. 
 
-@item
-XEmacs.  XEmacs is very similar to Emacs.
+To make this chain work, the following should done:
 
-@cindex XEmacs
+@itemize @bullet
 
 @item
-NEdit.  NEdit runs under Windows and Unix.
-It is available from @uref{http://@/www@/.nedit@/.org}.
-
-@cindex NEdit
+The PDF viewer must be configured for following hyperlinks, preferably
+using Mozilla Firefox.
 
-@item
-GVim.  GVim is a GUI variant of VIM, the popular VI
-clone.  It is available from @uref{http://@/www@/.vim@/.org}.
+For Xpdf on Unix, the following should be present in
+@file{xpdfrc}@footnote{On unix, this file is found either in
+@file{/etc} or your home directory.}
 
-@cindex GVim
-@cindex Vim
+@example
+urlCommand     "firefox -remote 'OpenURL(%s)'"
+@end example
 
+@item Your web-browser must be configured for the @code{textedit}
+protocol,
 
-@item
-jEdit.  jEdit is an editor written in Java with extensive plug-in
-support.  The LilyPond plugin for jEdit comes with an DVI 
-viewer, which is preconfigured for point-and-click. 
+For Mozilla and Mozilla Firefox, this is done by adding following
+lines to the @file{prefs.js}@footnote{On a typical unix system, this
+file is found in your home-directory under
+@file{.mozilla/firefox/default.trn/prefs.js}.}  
 
-@cindex jEdit
+@example
+user_pref("network.protocol-handler.app.textedit", "lilypond-pdfpc-helper");
+user_pref("network.protocol-handler.warn-external.textedit", false);
+@end example
 
 @end itemize
-@end itemize
-
 
-Xdvi must be configured to find the @TeX{} fonts and music
-fonts.  Refer to the Xdvi documentation for more information.
-
-To use point-and-click, add one of these lines to the top of your @file{.ly}
-file:
+The program @file{lilypond-pdfpc-helper} is a small helper program.
+It tests the environment variable @code{EDITOR} for the following
+patterns,
 
+@table @code
+@item emacs
+  this will invoke
 @example
-#(ly:set-point-and-click 'line)
+emacsclient --no-wait +@var{line}:@var{column} @var{file}
 @end example
-@cindex line-location
-
-When viewing, Control-Mousebutton@tie{}1 will take you to the originating
-spot in the @file{.ly} file.  Control-Mousebutton@tie{}2 will show all
-clickable boxes.
-
-If you correct large files with point-and-click, be sure to start
-correcting at the end of the file.  When you start at the top, and
-insert one line, all following locations will be off by a line.
-
-@cindex Emacs
-For using point-and-click with Emacs, add the following
-In your Emacs startup file (usually @file{~/@/.emacs}):
+@item vim
+  this will invoke
 @example
-(server-start)
+gvim --remote +:@var{line}:norm@var{column} @var{file}
 @end example
 
-Make sure that the environment variable @var{XEDITOR} is set to
+@item nedit
 @example
-emacsclient --no-wait +%l %f
+  nc -noask +@var{line} @var{file}'
 @end example
-@cindex @var{XEDITOR}
-If you use XEmacs instead of Emacs, insert @code{(gnuserve-start)} in
-your @file{.emacs} file, and set @code{XEDITOR} to
-@code{gnuclient -q +%l %f}.
-
-For using Vim, set @code{XEDITOR} to @code{gvim --remote +%l %f}, or
-use this argument with Xdvi's @code{-editor} option.
-
-@cindex NEdit
-For using NEdit, set @code{XEDITOR} to @code{nc -noask +%l %f}, or
-use this argument with Xdvi's @code{-editor} option.
-
-It can also make your editor jump to the exact location of the note
-you clicked.  This is only supported on Emacs and VIM.  Users of Emacs version
-20 must apply the patch @file{emacsclient.patch}.  Users of version 21
-must apply @file{server.el.patch} (version 21.2 and earlier).  At the
-top of the @code{.ly} file, replace the @code{set-point-and-click} line
-with the following line:
+@end table
+
+The environment variable @code{LYEDITOR} is used to override this. It
+contains the command line to start the editor, where @code{%(file)s},
+@code{%(column)s}, @code{%(line)s} is replaced with the file, column
+and line respectively. The  setting
+
 @example
-#(ly:set-point-and-click 'line-column)
+emacsclient --no-wait +%(line)s:%(column)s %(file)s
 @end example
-@cindex line-column-location
-and set @code{XEDITOR} to @code{emacsclient --no-wait +%l:%c %f}.  Vim
-users can set @code{XEDITOR} to @code{gvim --remote +:%l:norm%c| %f}.
+
+@noindent
+for @code{LYEDITOR} is equivalent to the standard emacsclient
+invocation.
+
index 93debb6c31754269989718ef5395d26a1fc1c16f..cdbeaf7ed84505ab028f90a14efba4d4a318a3d3 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.4.0"
+\version "2.5.13"
 \header {
     composer = "ARTHUR GRAY"
     title = "LES NÉRÉIDES"
@@ -25,7 +25,6 @@ possibly more impressive to render without tweaks?
 
 %}
 
-#(ly:set-point-and-click 'line-column)
 #(define (make-text-checker text)
   (lambda (elt) (equal? text (ly:get-grob-property elt 'text))))
 
index 6ee7b7c2df345e91b4063ae7eb8210c05d4ad180..3fe50d91a55b6c4e42cfcb569f5b7bc848d7eab0 100644 (file)
@@ -1,11 +1,9 @@
 #(ly:set-option 'old-relative)
 
-% #(ly:set-point-and-click 'line-column)
-
 instrument = "Piano"
 
 \header {
-  title = "Ständchen"
+  title = "Ständchen"
   subtitle = "(Serenade)"
   subsubtitle = "Leise flehen meine Lieder"
   opus = "D. 957 No. 4"
@@ -42,7 +40,7 @@ instrument = "Piano"
  footer = "Mutopia-2001/04/27-xx"
 } 
 
-\version "2.4.0"
+\version "2.5.13"
 
 dynamicUp = \override DynamicLineSpanner  #'direction = #1
 dynamicRevert = \revert DynamicLineSpanner #'direction
@@ -121,42 +119,42 @@ lyricVerseOne = \lyricmode {
        in den stil -- len Hain her nie -- der,
        Lieb -- chen, komm zu mir! 
        
-       Flüs -- ternd schlan -- ke Wip -- fel rau -- schen
+       Flüs -- ternd schlan -- ke Wip -- fel rau -- schen
        in des Mon -- des Licht,
        in des Mon -- des Licht;
 
-       des Ver -- rä -- ters feind -- lich Lau -- schen
-       fürch -- te, Hol -- de, nicht,
-       fürch -- te, Hol -- de, nicht.
+       des Ver -- rä -- ters feind -- lich Lau -- schen
+       fürch -- te, Hol -- de, nicht,
+       fürch -- te, Hol -- de, nicht.
 }
        
 lyricVerseTwo = \lyricmode{
-       Hörst die Nach -- ti -- gal -- len schla -- gen?
+       Hörst die Nach -- ti -- gal -- len schla -- gen?
        ach! sie fle -- hen dich, 
-       mit der Tö -- ne sü -- "\ss en" Kla -- gen
-       fle -- hen sie für mich. 
+       mit der Tö -- ne sü -- "\ss en" Kla -- gen
+       fle -- hen sie für mich. 
        
        Sie -- ver -- "steh'n" des Bu -- sens Seh -- nen,
        ken -- nen Lieb -- es -- schmerz,
        ken -- nen Lieb -- es -- schmerz,
 
-       rüh -- ren mit den Sil -- ber -- tö -- nen
+       rüh -- ren mit den Sil -- ber -- tö -- nen
        jed -- es wei -- che Herz,
        jed -- es wei -- che Herz.
 }
 
 lyricThrough = \lyricmode{
        La\ss auch dir die Brust be -- we -- gen 
-       Lieb -- chen, hö -- re mich! 
+       Lieb -- chen, hö -- re mich! 
        be -- bend harr' ich dir ent -- ge -- gen! 
        
-       komm, be -- glük -- ke mich!
-       komm, be -- glük -- ke mich, __ 
-       be -- glük -- ke mich!
+       komm, be -- glük -- ke mich!
+       komm, be -- glük -- ke mich, __ 
+       be -- glük -- ke mich!
 }
 
 trebleIntro = \relative c{
-       r8^"\bf Mäßig"\pp <g' c>-. <c es>-. <g c>-. <c es>-. <g c>-. |
+       r8^"\bf Mäßig"\pp <g' c>-. <c es>-. <g c>-. <c es>-. <g c>-. |
        r8 <as c>-. <c es>-. <as c>-. <c es>-. <as c>-. |
        r8 <as c>-. <c d>-. <as c>-. <c d>-. <as c>-. |
        r8 <g b>-. <b d>-. <g b>-. <b d>-. <g b>-. |
index 738c78f25151d15a29ea9bd2a3b0220ef4295999..bcbb6b030ba498ae1f89d76be7065e676bc77c5c 100644 (file)
@@ -1,6 +1,4 @@
-\version "2.4.0"
-
-% #(ly:set-point-and-click 'line-column)
+\version "2.5.13"
 
 forcedLastBreak =  { \break }
 
index 823e5a00579611958b8ce9c1692f5a876e8847ee..12f04cad9da30850f99321bee7c0015982b16c8d 100644 (file)
@@ -1,5 +1,4 @@
-#(ly:set-point-and-click 'line-column)
-\version "2.4.0"
+\version "2.5.13"
 
 \header {
 
index 000245ebe278c072076c2898af51d4082157a3b6..344c8b8aedf543fb62d961256783768792cb9812 100644 (file)
@@ -1,5 +1,3 @@
-%% Optional helper for quick click and edit mode.  May be omitted
-#(ly:set-point-and-click 'line-column)
 
 %% A simple song in LilyPond
 <<
@@ -15,5 +13,5 @@
 >>
 
 %% Optional helper for automatic updating by convert-ly.  May be omitted.
-\version "2.4.0"
+\version "2.5.13"
     
index f1ac6bc847f3b896756d7c17eeacd0061dd00592..e0038dd6dd327dbf9bf5a4b212aaac8a21bf5436 100644 (file)
@@ -31,7 +31,6 @@ extern String output_backend_global;
 extern String output_name_global;
 extern bool be_safe_global;
 extern bool be_verbose_global;
-extern bool store_locations_global;
 extern bool do_internal_type_checking_global;
 extern bool is_pango_format_global;
 extern char const *prefix_directories[];
index 32f4405bebaf6fa5bd6836b7c0ce676a0f33e8d7..d50aa564ad6163a1e1c910fb6912d76d7845b3c9 100644 (file)
 #include "book.hh"
 #include "paper-book.hh"
 
-/*
-  junkme?
- */
-bool store_locations_global;
-
 /* Do not append `!' suffix, since 1st argument is not modified. */
 LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
           1, 0, 0, (SCM what),
-         "Set the options for Point-and-click source specials output. The\n"
-"argument is a symbol.  Possible options are @code{none} (no source specials), \n"
-"@code{line} and @code{line-column}")
+          "Deprecated.")
 {
-  /* UGH. */
-  SCM val = SCM_BOOL_F;
-  if (ly_symbol2scm ("line-column") == what)
-    val = ly_lily_module_constant ("line-column-location");
-  else if (what == ly_symbol2scm ("line"))
-    val = ly_lily_module_constant ("line-location");
-
-  scm_module_define (global_lily_module, ly_symbol2scm ("point-and-click"),
-                    val);
-  store_locations_global = ly_c_procedure_p (val);
+  warning ("ly:set-point-and-click called");
   return SCM_UNSPECIFIED;
 }
 
index 0c5c3ce9b7aebe650b1f03c17aab230cabff9995..c7c0956e4473fed219cf4a98207bd6115b5ccb50 100644 (file)
        /Rect [ llx lly urx ury ]
        /Border [ 0 0 0 0 ]
 
-       pdf-viewer (acroread) eq
-       {
-           /Action
+        /Action
            <<
                /Subtype /URI
                /URI command
            >>
-       }
-       {
-           % xpdf.  FIXME: gpdf, kpdf etc?
-           /Action
-           <<
-               /Launch
-               /File command
-           >>
-       } ifelse
         /Subtype /Link
     /ANN
     pdfmark
index d258df8e9e7811ff21cf0b859063c92215549f76..cd11700e75f05ba6e6dc703cd983362406d32721 100644 (file)
                       (ly:input-file-line-column music-origin)
                       #f
                       ))
+        (file (if location (string-append (getcwd) "/" (car location))
+                  #f))
         (x-ext (ly:grob-extent grob grob X)) 
         (y-ext (ly:grob-extent grob grob Y)) 
         )
 
     (if location
-       (format "~a ~a ~a ~a (~a:~a:~a) mark_file_line\n"
+       (format "~a ~a ~a ~a (textedit://~a:~a:~a) mark_file_line\n"
                (+ (car offset) (car x-ext))
                (+ (cdr offset) (car y-ext))
                (+ (car offset) (cdr x-ext))
                (+ (cdr offset) (cdr y-ext))
-               (car location)
+               file
                (cadr location)
                (caddr location))
        "")))
index 272833d4a00bda040a1dda54f3a8d59a5b673e08..a95d56a34e49b8e283f29ed185f8cc72fd8dc98b 100644 (file)
@@ -2429,11 +2429,15 @@ def conv (str):
                        de_utf_8 (str)
                except UnicodeDecodeError:
                        str = en_utf_8 (de_input (str)[0])[0]
+
+
+
+       str = re.sub (r"#\(ly:set-point-and-click '[a-z-]+\)", '', str)
        return str
 
 conversions.append (((2, 5, 13),
                     conv,
-                    '\\encoding: smart recode latin1..utf-8'))
+                    '\\encoding: smart recode latin1..utf-8. Remove ly:point-and-click'))
 
 
 ################################
index 87f23c008867aa0b947626f31fcbb27bf30f7cfb..8f9500dbd7baf4259c9d22a9518a55635c27272b 100644 (file)
@@ -3,6 +3,7 @@ import re
 import getopt
 import sys
 import os
+import string
 
 version = '@TOPLEVEL_VERSION@'
 
@@ -60,7 +61,12 @@ if not files:
 
 ################################################################
 
-match = re.match ('([^:]+):([^:]+):(.*)', files[0])
+
+arg = files[0]
+
+arg = re.sub ('textedit://','', arg)
+
+match = re.match ('([^:]+):([^:]+):(.*)', arg)
 if not match:
        sys.stderr.write (_("Not in FILE:LINE:COL format: ")
                          + files[0])
@@ -86,6 +92,8 @@ if ly_pc_editor == None:
 
 command = ly_pc_editor % vars()
 
+print 'invoked with %s\ncalling %s\n' % (string.join (sys.argv),command)
+
 status = os.system (command)
 if status:
        sys.stderr.write (_("Command failed: `%s' (status %d)") % (command, status) + '\n')