* lilypond-mode.el: Allow Midi on buffer.
Use only '.ly'-extension, remove '.sly' and '.fly'.
+ Allow use of inactive regions. Invoke next Command on Master file,
+ Buffer or Region, if C-cc, C-cb, or C-cr, accordingly, was pressed.
2003-05-14 Han-Wen Nienhuys <hanwen@cs.uu.nl>
(defun LilyPond-command-master ()
"Run command on the current document."
(interactive)
+ (LilyPond-command-select-master)
(LilyPond-command (LilyPond-command-query (LilyPond-master-file))
'LilyPond-master-file))
(defun LilyPond-command-region (begin end)
"Run LilyPond on the current region."
(interactive "r")
+ (if (or (> begin (point-min)) (< end (point-max)))
+ (LilyPond-command-select-region))
(write-region begin end (LilyPond-region-file begin end) nil 'nomsg)
(LilyPond-command (LilyPond-command-query
(LilyPond-region-file begin end))
'(lambda () (LilyPond-region-file begin end)))
;; Region may deactivate even if buffer was intact, reactivate?
+ ;; Currently, also deactived regions are used.
)
(defun LilyPond-command-buffer ()
"Run LilyPond on buffer."
(interactive)
+ (LilyPond-command-select-buffer)
(LilyPond-command-region (point-min) (point-max)))
(defun LilyPond-command-expand (string file)
(defun LilyPond-command-menu (name)
;; Execute LilyPond-command-alist NAME from a menu.
(let ((LilyPond-command-force name))
- (funcall LilyPond-command-current)))
+ (if (eq LilyPond-command-current 'LilyPond-command-region)
+ (if (eq (mark t) nil)
+ (progn (message "The mark is not set now") (sit-for 0 500))
+ (progn (if (not (not (and transient-mark-mode mark-active)))
+ (progn (message "Region is not active, using region between inactive mark and current point.") (sit-for 0 500)))
+ (LilyPond-command-region (mark t) (point))))
+ (funcall LilyPond-command-current))))
(defun LilyPond-mode ()
"Major mode for editing LilyPond music files.
(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)
+
;; run the mode hook. LilyPond-mode-hook use is deprecated
(run-hooks 'LilyPond-mode-hook))