lilypond-user
[Top][All Lists]
Advanced

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

kick xpdf in lilypond-mod.el


From: Orm Finnendahl
Subject: kick xpdf in lilypond-mod.el
Date: Thu, 2 Mar 2006 13:51:03 +0100
User-agent: Mutt/1.5.9i

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 ---------





reply via email to

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