]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.19.jcn1
authorJan Nieuwenhuizen <janneke@gnu.org>
Fri, 14 Jan 2000 12:41:16 +0000 (13:41 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Fri, 14 Jan 2000 12:41:16 +0000 (13:41 +0100)
1.3.19.jcn1
==========

* lilypond-mode.el: guess init file for lily-*-region, lily-mode-map bindings

CHANGES
VERSION
lilypond-mode.el

diff --git a/CHANGES b/CHANGES
index 00fac87e23471b20fa7edf44e2e8b539849152be..0578f16cf0c5823f7d69afdc447e67eaf63f87e9 100644 (file)
--- 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 da9c5c44cba3537278ba9ed5525097b12474d87d..5030aa386cbb4558846aef35b1001c0754cb7586 100644 (file)
--- 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.
index 962659fe25a1b721d3a6fe37d870da92c5fce585..e4e6e4d2348fa0fe1a7294759c37f114d815a365 100644 (file)
 ;; 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.
 (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")))
 (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 ()