Hi,

I'm trying to get a tighter integration between emacs-snapshot and
xpdf by starting up xpdf in server mode (with the -remote switch, one
for each "*.ly" buffer) and kicking the current document rather than
restarting a new xpdf process.

Can someone give an advice how to integrate that gracefully into the
command-call and customization scheme of lilypond-mode.el? I wrote a
function (LilyPond-kick-pdf), which starts a server process for the
current buffer if necessary and sends the pdf file to that process,
but as far as I can see, the mechanism in the current mode binds
customizable strings to the menu which are shell commands rather than
binding to elisp functions.

Attached is the elisp code for those interested.

--
Orm

----------- Begin lilypond-mode.el snippet ---------

(defun LilyPond-kick-pdf ()
  (interactive)
  (let ((buffname (LilyPond-get-master-file))
        (pl (process-list)))
    (unless
; check whether a process named <buffname> exists
        (catch 'result 
          (while (setq pname (pop pl))
            (if (eq pname buffname) (throw 'result t))))
; start a new xpdf server if process doesn't exist
      (start-process 
       buffname
       nil
       "xpdf"  
       "-remote" 
       buffname))
; kick pdf
  (call-process 
   "xpdf" 
   nil 
   nil 
   nil 
   "-remote" 
   buffname
   (concat (substring (LilyPond-get-master-file) 0 -3) ".pdf")
   )
  ))

----------- End lilypond-mode.el snippet ---------



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

Reply via email to