From: Jan Nieuwenhuizen Date: Fri, 14 Jan 2000 12:41:16 +0000 (+0100) Subject: patch::: 1.3.19.jcn1 X-Git-Tag: release/1.3.20~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c0bb69c807d8487a0eeb47131b1da66a985d96e9;p=lilypond.git patch::: 1.3.19.jcn1 1.3.19.jcn1 ========== * lilypond-mode.el: guess init file for lily-*-region, lily-mode-map bindings --- diff --git a/CHANGES b/CHANGES index 00fac87e23..0578f16cf0 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1.3.19.jcn1 +========== + +* lilypond-mode.el: guess init file for lily-*-region, lily-mode-map bindings + 1.3.18.uu2 ========== diff --git a/VERSION b/VERSION index da9c5c44cb..5030aa386c 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=19 -MY_PATCH_LEVEL= +MY_PATCH_LEVEL=jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/lilypond-mode.el b/lilypond-mode.el index 962659fe25..e4e6e4d234 100644 --- a/lilypond-mode.el +++ b/lilypond-mode.el @@ -17,15 +17,11 @@ ;; organization, is hereby granted, provided that the above copyright ;; notice and this paragraph appear in all copies. -;; Sigh - -;; This is a cannabalised version of python-mode.el (HWN) -;; Added lily-eval-buffer -- jcn +;; This started out as a cannabalised version of python-mode.el, by hwn +;; For changes see the LilyPond ChangeLog ;; ;; TODO: ;; * lily/ly/lilypond? -;; * fix lily-keymap -;; * mail Tim Peters about silly copyright (notice)? ;; * syntax ;; - should handle block comments too. ;; - handle lexer modes (\header, \melodic, \lyric) etc. @@ -185,12 +181,14 @@ (defun lily-eval-region (start end) "Run LilyPond on region." (interactive "r") - ;; (message "saving current buffer to temporary file ...") - ;; (write-file tmp-file-with-directory) - ;;(lily-compile-file lily-command "--init=init.fly" "-") - (let ((basename "emacs-lily")) - (write-region start end (concat basename ".fly") nil 'nomsg) - (lily-compile-file lily-command lily-parameters basename))) + (let ((basename "emacs-lily") + (suffix (if (string-match "^[\\]score" (buffer-substring start end)) + ".ly" + (if (> 50 (abs (- start end))) + ".fly") + ".sly"))) + (write-region start end (concat basename suffix) nil 'nomsg) + (lily-compile-file lily-command lily-parameters (concat basename suffix)))) (defun lily-running () (let ((process (get-process "lilypond"))) @@ -293,16 +291,18 @@ (defvar lily-mode-map () "Keymap used in `lilypond-mode' buffers.") +;; Note: if you make changes to the map, you must do +;; M-x set-variable lily-mode-map nil +;; M-x eval-buffer +;; M-x lilypond-mode +;; to let the changest take effect (if lily-mode-map () (setq lily-mode-map (make-sparse-keymap)) - ;; this doesn't work, here - ;; I would very much like to have [f9], globally defined as 'compile, - ;; being overidden to 'lily-eval-buffer for LilyPond buffers - (define-key lily-mode-map [C-f9] 'lily-eval-buffer) - ;; urg - ;; add to .emacs: - ;; (global-set-key [C-f9] 'lily-eval-buffer) + (define-key lily-mode-map [f9] 'lily-eval-buffer) + (define-key lily-mode-map [f10] 'lily-xdvi-buffer) + (define-key lily-mode-map [S-f9] 'lily-eval-region) + (define-key lily-mode-map [S-f10] 'lily-xdvi-region) ) (defun lilypond-mode ()