;;; Inspired on auctex
+;;;
+;;; Add this to your .emacs.el
+;;; (load-library "lilypond-mode.el")
+;;; (setq auto-mode-alist
+;;; (append '(("\\.ly$" . LilyPond-mode) auto-mode-alist)))
+;;;
(load-library "lilypond-font-lock")
;; Should check whether in command-alist?
-(defvar LilyPond-command-default "LilyPond")
+(defcustom LilyPond-command-default "LilyPond"
+ "Default command. Must identify a member of LilyPond-command-alist."
+
+ :group 'LilyPond
+ :type 'string)
;;;(make-variable-buffer-local 'LilyPond-command-last)
(defvar LilyPond-command-current 'LilyPond-command-master)
;; variable instead of quering the user.
(defvar LilyPond-command-force nil)
+(defcustom LilyPond-xdvi-command "xdvik"
+ "Command used to display DVI files."
+
+ :group 'LilyPond
+ :type 'string)
;; This is the major configuration variable.
(defcustom LilyPond-command-alist
- '(
+ `(
("LilyPond" . ("lilypond %s" . "TeX"))
("TeX" . ("tex '\\nonstopmode\\input %t'" . "View"))
-
+
+ ("2Dvi" . ("ly2dvi %s" . "View"))
+
+ ("Book" . ("lilypond-book %x" . "LaTeX"))
+ ("LaTeX" . ("latex '\\nonstopmode\\input %l'" . "View"))
+
;; point-n-click (arg: exits upop USR1)
("SmartView" . ("xdvi %d" . "LilyPond"))
;; refreshes when kicked USR1
- ("View" . ("xdvik %d" . "LilyPond"))
+ ("View" . (,(concat LilyPond-xdvi-command " %d") . "LilyPond"))
)
"AList of commands to execute on the current document.
LilyPond-expand-list.
"
:group 'LilyPond
- :type '(repeat (group (string :tag "Name")
+ :type '(repeat (cons :tag "Command Item"
+ (string :tag "Key")
+ (cons :tag "How"
(string :tag "Command")
- (choice :tag "How"
- :value LilyPond-run-command
- (function-item LilyPond-run-command)
- (function-item LilyPond-run-LilyPond)
- (function :tag "Other"))
- (boolean :tag "Prompt")
- (sexp :format "End\n"))))
+ (string :tag "Next Key")))))
;; drop this?
(defcustom LilyPond-file-extensions '(".ly" ".sly" ".fly")
("%t" . ".tex")
("%d" . ".dvi")
("%p" . ".ps")
+ ("%l" . ".latex")
+ ("%x" . ".tely")
)
"Alist of expansion strings for LilyPond command names."
:group 'LilyPond
- :type '(repeat (group (string :tag "Key")
- (sexp :tag "Expander")
- (repeat :inline t
- :tag "Arguments"
- (sexp :format "%v")))))
+ :type '(repeat (cons :tag "Alist item"
+ (string :tag "Symbol")
+ (string :tag "Expansion"))))
(defcustom LilyPond-command-Show "View"
"*The default command to show (view or print) a LilyPond file.
-Must be the car of an entry in LilyPond-command-alist."
+Must be the car of an entry in `LilyPond-command-alist'."
:group 'LilyPond
:type 'string)
(make-variable-buffer-local 'LilyPond-command-Show)
(if LilyPond-mode-map
()
(setq LilyPond-mode-map (make-sparse-keymap))
- (define-key LilyPond-mode-map "\C-c\C-c" 'LilyPond-command-master)
(define-key LilyPond-mode-map "\C-c\C-r" 'LilyPond-command-region)
(define-key LilyPond-mode-map "\C-c\C-b" 'LilyPond-command-buffer)
(define-key LilyPond-mode-map "\C-c\C-k" 'LilyPond-kill-job)
+ (define-key LilyPond-mode-map "\C-c\C-c" 'LilyPond-command-master)
)
;;; Menu Support
(funcall LilyPond-command-current)))
(defun LilyPond-mode ()
- "Major mode for editing LilyPond music files."
+ "Major mode for editing LilyPond music files.
+
+This mode knows about LilyPond keywords and line comments, not about
+indentation or block comments. It features easy compilation, error
+finding and viewing of a LilyPond source buffer or region.
+
+COMMANDS
+\\{LilyPond-mode-map}
+VARIABLES
+
+LilyPond-command-alist\t\talist from name to command
+LilyPond-xdvi-command\t\tcommand to display dvi files -- bit superfluous"
(interactive)
;; set up local variables
(kill-all-local-variables)
(interactive)
(message "Using `LilyPond-mode' version %s" LilyPond-version))
-(provide 'LilyPond-mode)
-;;; LilyPond-mode.el ends here
+(provide 'lilypond-mode)
+;;; lilypond-mode.el ends here