X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=elisp%2Flilypond-mode.el;h=98b9401150d01844c71b405f42f8cc627ae5a29a;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=665f23e24d73b6d5045b7163dcba4e090dc01801;hpb=b7a0cffbf9d1069860368f289a5b50e9d1d90ba8;p=lilypond.git diff --git a/elisp/lilypond-mode.el b/elisp/lilypond-mode.el index 665f23e24d..98b9401150 100644 --- a/elisp/lilypond-mode.el +++ b/elisp/lilypond-mode.el @@ -1,7 +1,7 @@ ;;;; lilypond-mode.el -- Major mode for editing GNU LilyPond music scores ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 1999--2009 Jan Nieuwenhuizen +;;;; Copyright (C) 1999--2015 Jan Nieuwenhuizen ;;;; Changed 2001--2003 Heikki Junes ;;;; * Add PS-compilation, PS-viewing and MIDI-play (29th Aug 2001) ;;;; * Keyboard shortcuts (12th Sep 2001) @@ -286,15 +286,14 @@ in LilyPond-include-path." (defun LilyPond-compile-file (command name) ;; We maybe should know what we run here (Lily, lilypond, tex) ;; and adjust our error-matching regex ? - (compile-internal + (compilation-start (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)) + (concat "cd " (LilyPond-temp-directory) "; " command)))) -;; do we still need this, now that we're using compile-internal? +;; do we still need this, now that we're using compilation-start? (defun LilyPond-save-buffer () "Save buffer and set default command for compiling." (interactive) @@ -436,8 +435,6 @@ in LilyPond-include-path." `( ("LilyPond" . (,(concat LilyPond-lilypond-command " %s") "%s" "%l" "View")) ("2PS" . (,(concat LilyPond-lilypond-command " -f ps %s") "%s" "%p" "ViewPS")) - ("2Gnome" . (,(concat LilyPond-lilypond-command " -b gnome %s"))) - ("Book" . ("lilypond-book %x" "%x" "%l" "LaTeX")) ("LaTeX" . ("latex '\\nonstopmode\\input %l'" "%l" "%d" "ViewDVI")) @@ -570,11 +567,6 @@ Must be the car of an entry in `LilyPond-command-alist'." (LilyPond-command (LilyPond-command-menu "2PS") 'LilyPond-get-master-file) ) -(defun LilyPond-command-formatgnome () - "Format the gnome output of the current document." - (interactive) - (LilyPond-command (LilyPond-command-menu "2Gnome") 'LilyPond-get-master-file)) - (defun LilyPond-command-formatmidi () "Format the midi output of the current document." (interactive) @@ -632,14 +624,15 @@ Must be the car of an entry in `LilyPond-command-alist'." (l (split-file-name file)) (dir (car l)) (base (cadr l))) - (LilyPond-command-expand - (concat (substring string 0 b) - (shell-quote-argument (concat dir base)) - (let ((entry (assoc (substring string b e) - LilyPond-expand-alist))) - (if entry (cdr entry) "")) - (substring string e)) - file)) + (concat (substring string 0 b) + (shell-quote-argument (concat dir base)) + (LilyPond-command-expand + (concat + (let ((entry (assoc (substring string b e) + LilyPond-expand-alist))) + (if entry (cdr entry) "")) + (substring string e)) + file))) string))) (defun LilyPond-shell-process (name buffer command) @@ -758,7 +751,6 @@ command." (define-key LilyPond-mode-map "\C-c\C-c" 'LilyPond-command-master) (define-key LilyPond-mode-map "\C-cm" 'LilyPond-command-formatmidi) (define-key LilyPond-mode-map "\C-c\C-f" 'LilyPond-command-formatps) - (define-key LilyPond-mode-map "\C-c\C-g" 'LilyPond-command-formatgnome) (define-key LilyPond-mode-map "\C-c\C-s" 'LilyPond-command-view) (define-key LilyPond-mode-map "\C-c\C-p" 'LilyPond-command-viewps) (define-key LilyPond-mode-map [(control c) return] 'LilyPond-command-current-midi) @@ -995,17 +987,17 @@ command." (defun LilyPond-menu-keywords () "Make Insert Tag menu. -The Insert Tag -menu is splitted into parts if it is long enough." +The Insert Tag -menu is split into parts if it is long enough." (let ((li (mapcar 'LilyPond-menu-keywords-item LilyPond-menu-keywords)) (w (round (sqrt (length LilyPond-menu-keywords)))) - (splitted '()) + (split '()) (imin 0) imax lw rw) (while (< imin (length LilyPond-menu-keywords)) (setq imax (- (min (+ imin w) (length LilyPond-menu-keywords)) 1)) (setq lw (nth imin LilyPond-menu-keywords)) (setq rw (nth imax LilyPond-menu-keywords)) - (add-to-list 'splitted + (add-to-list 'split (let ((l (list (concat (substring lw 0 (min 7 (length lw))) " ... " (substring rw 0 (min 7 (length rw))))))) @@ -1013,7 +1005,7 @@ The Insert Tag -menu is splitted into parts if it is long enough." (add-to-list 'l (nth imin li)) (setq imin (1+ imin))) (reverse l)))) - (if (> (length LilyPond-menu-keywords) 12) (reverse splitted) li))) + (if (> (length LilyPond-menu-keywords) 12) (reverse split) li))) ;;; LilyPond-mode-menu should not be interactive, via "M-x LilyPond-" (easy-menu-define LilyPond-mode-menu @@ -1155,11 +1147,12 @@ LilyPond-command-alist\t\talist from name to command" ;; Use Command on Region even for inactive mark (region). (if (string-match "XEmacs\\|Lucid" emacs-version) - (setq zmacs-regions nil) + (progn + (setq zmacs-regions nil) + (make-local-hook 'post-command-hook)) ; XEmacs requires (setq mark-even-if-inactive t)) ;; Context dependent syntax tables in LilyPond-mode - (make-local-hook 'post-command-hook) ; XEmacs requires (add-hook 'post-command-hook 'LilyPond-mode-context-set-syntax-table nil t) ;; Turn on paren-mode buffer-locally, i.e., in LilyPond-mode