(defun LilyPond-compile-file (command name)
;; We maybe should know what we run here (Lily, ly2dvi, tex)
;; and adjust our error-matching regex ?
- (compile-internal command "No more errors" name ))
+ (compile-internal
+ (if (eq LilyPond-command-current 'LilyPond-command-master)
+ command
+ ;; use temporary directory for Commands on Buffer/Region
+ ;; hm.. the directory is set twice, first to default-dir
+ (concat "cd " (LilyPond-temp-directory) "; " command))
+ "No more errors" name))
;; do we still need this, now that we're using compile-internal?
(defun LilyPond-save-buffer ()
;; FIXME, this is broken
(defun LilyPond-region-file (begin end)
(let (
- ;; (dir "/tmp/")
- ;; urg
- (dir "./")
+ ;; (dir "./")
+ (dir (LilyPond-temp-directory))
(base LilyPond-region-file-prefix)
(ext LilyPond-file-extension))
(concat dir base ext)))
(and transient-mark-mode
(if (string-match "XEmacs\\|Lucid" emacs-version) (mark) mark-active)))
+(defun LilyPond-temp-directory ()
+ "Temporary file directory for Commands on Region."
+ (interactive)
+ (if (string-match "XEmacs\\|Lucid" emacs-version)
+ (concat (temp-directory) "/")
+ temporary-file-directory))
+
;;; Keymap
(defvar LilyPond-mode-map ()
(easy-menu-add LilyPond-mode-menu)
(easy-menu-add LilyPond-command-menu)
- ;; Use Command on Region even for deactivated regions.
- (setq mark-even-if-inactive t)
+ ;; Use Command on Region even for inactive mark (region).
+ (if (string-match "XEmacs\\|Lucid" emacs-version)
+ (setq zmacs-regions nil)
+ (setq mark-even-if-inactive t))
;; run the mode hook. LilyPond-mode-hook use is deprecated
(run-hooks 'LilyPond-mode-hook))