lilypond-user
[Top][All Lists]
Advanced

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

Re: emacs lilypond-mode broken for lilypond-snapshot?


From: Nicolas Sceaux
Subject: Re: emacs lilypond-mode broken for lilypond-snapshot?
Date: Sun, 26 Sep 2004 16:23:54 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Paul Scott <address@hidden> writes:

> When I load a .ly file after installing lilypond-snapshot I get:
> File mode specification error: (file-error "Cannot open load file" "
> lilypond-mode")

I don't think this is a packaging problem.

lilypond-mode.el:

  ;; This is the major configuration variable.
  (defcustom LilyPond-command-alist
    ;; Should expand this to include possible keyboard shortcuts which
    ;; could then be mapped to define-key and menu.
    `(
      ("LilyPond" . ("lilypond -ftex %s" "%s" "%l" "View"))
      ("TeX" . ("tex '\\nonstopmode\\input %t'" "%t" "%d" "View"))
  
      ("2Dvi" . ("lilypond -f tex %s" "%s" "%d" "LaTeX"))
      ("2PS" . ("lilypond -f ps %s" "%s" "%p" "ViewPS"))
      ("2Midi" . ("lilypond -m %s" "%s" "%m" "Midi"))
  
      ("Book" . ("lilypond-book %x" "%x" "%l" "LaTeX"))
      ("LaTeX" . ("latex '\\nonstopmode\\input %l'" "%l" "%d" "View"))
  
      ;; point-n-click (arg: exits upop USR1)
      ("SmartView" . ("xdvi %d"))
  
      ;; refreshes when kicked USR1
      ("View" . (,(concat LilyPond-xdvi-command " %d")))
      ("ViewPS" . (,(concat LilyPond-gv-command " %p")))
  
      ;; The following are refreshed in LilyPond-command:
      ;; - current-midi depends on cursor position and
      ("Midi" . (,(concat LilyPond-midi-command " " 
(LilyPond-string-current-midi)))) ; 
      ;; - all-midi depends on number of midi-score.
      ("MidiAll" . (,(concat LilyPond-all-midi-command " " 
(LilyPond-string-all-midi))))
      )
  
The "Midi" definition causes the error, more precisely the
(LilyPond-string-current-midi) call:

  (defun LilyPond-string-current-midi ()
    "Check the midi file of the following midi-score in the current document."
    (let ((fnameprefix (if (eq LilyPond-command-current 
'LilyPond-command-master)
                         (substring (LilyPond-get-master-file) 0 -3); suppose 
".ly"
                       LilyPond-region-file-prefix))
        (allcount (string-to-number (substring (count-midi-words) 0 -12)))
        (count (string-to-number (substring (count-midi-words-backwards) 0 
-12))))
      (concat  fnameprefix
             (if (and (> allcount 1) (> count 0)) ; not first score
                 (if (eq count allcount)          ; last score
                     (concat "-" (number-to-string (+ count -1)))
                   (concat "-" (number-to-string count))))
             ".midi")))

It seems that (LilyPond-get-master-file) evaluates to nil, and thus
cannot be substring-ed, at the time "lilypond-mode.el" is loaded. I am
not sure what is intended here...

nicolas





reply via email to

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