]> git.donarmstrong.com Git - lilypond.git/commitdiff
split Insert Tag -menu if it is long enough.
authorHeikki Junes <heikki.junes@hut.fi>
Tue, 12 Aug 2003 16:56:05 +0000 (16:56 +0000)
committerHeikki Junes <heikki.junes@hut.fi>
Tue, 12 Aug 2003 16:56:05 +0000 (16:56 +0000)
ChangeLog
lilypond-mode.el
lilypond.words

index dc343b76422357c05df3d3b0a228a336048a80f5..40a333f88eeef9c11e5136d1773e95b6572e342c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-08-12  Heikki Junes <hjunes@cc.hut.fi>
+
+       * lilypond-mode.el: split `Insert Tag' if it is long enough.
+
+       * lilypond.words: add new features: markup, column, center, \[ \].
+       
 2003-08-10  Heikki Junes <hjunes@cc.hut.fi>
 
        * Documentation/topdocs/NEWS.texi, DEDICATION,
index bfdf571b45e73434b69b9f08c6c1d69d4a3de8b8..ee49d39886f93c712e313b2583849313e8dabeca 100644 (file)
@@ -19,7 +19,7 @@
 (require 'easymenu)
 (require 'compile)
 
-(defconst LilyPond-version "1.7.30"
+(defconst LilyPond-version "1.8.0"
   "`LilyPond-mode' version number.")
 
 (defconst LilyPond-help-address "bug-lilypond@gnu.org"
@@ -103,7 +103,7 @@ Finds file lilypond-words from load-path."
              (add-to-list 'wordlist currword)
              (while (and (> (length co) 0)
                          (not (string-equal "-" (car (setq co (cdr co))))))))))
-      wordlist))
+      (reverse wordlist)))
   "Keywords inserted from LilyPond-Insert-menu.")
 
 (defconst LilyPond-keywords
@@ -926,10 +926,33 @@ command."
          '([ "Midi all" LilyPond-command-all-midi t])
          ))
 
-(defun LilyPond-menu-keywords (arg)
-  "Make vector for LilyPond-mode-menu."
+(defun LilyPond-menu-keywords-item (arg)
+  "Make vector for LilyPond-mode-keywords."
   (vector arg (list 'LilyPond-insert-tag-current arg) :style 'radio :selected (list 'eq 'LilyPond-insert-tag-current arg)))
 
+(defun LilyPond-menu-keywords ()
+  "Make Insert Tags menu. 
+
+The Insert Tags -menu is splitte into pieces if it is long enough."
+
+  (let ((li (mapcar 'LilyPond-menu-keywords-item LilyPond-menu-keywords))
+       (w (round (sqrt (length LilyPond-menu-keywords))))
+       (splitted '())
+       (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
+         (let ((l (list (concat (substring lw 0 (min 7 (length lw))) 
+                               " ... " 
+                               (substring rw 0 (min 7 (length rw)))))))
+          (while (<= imin imax)
+            (add-to-list 'l (nth imin li))
+            (setq imin (1+ imin)))
+          (reverse l))))
+    (if (> (length LilyPond-menu-keywords) 12) (reverse splitted) li)))
+
 ;;; LilyPond-mode-menu should not be interactive, via "M-x LilyPond-<Tab>"
 (easy-menu-define LilyPond-mode-menu
   LilyPond-mode-map
@@ -939,8 +962,7 @@ command."
          (list (cons "Insert tag" 
                 (cons ["Previously selected" LilyPond-insert-tag-current t] 
                 (cons "-----"
-                     (mapcar 'LilyPond-menu-keywords 
-                             (reverse LilyPond-menu-keywords))))))
+                     (LilyPond-menu-keywords)))))
          '(("Miscellaneous"
             ["Autocompletion"   LilyPond-autocompletion t]
             ["(Un)comment Region" LilyPond-comment-region t]
index 76b2474903e989bfc82b9272f46a2e315cd0f7a4..595eeec779baf52d9a3d15dcad6a40a39fbe40e2 100644 (file)
@@ -1,6 +1,7 @@
 -\( - _ -\) -
 -\[ - _ -\] -
 -\\\( - _ -\\\) -
+\\\[ - _ \\\] -
 \\accent
 \\accentus
 \\accepts
@@ -41,7 +42,7 @@ Beam
 \\broken
 \\cadenzaOff
 \\cadenzaOn
-\\center
+\\center - \ << _ >> -
 \\cg
 \\ch
 \\char
@@ -62,7 +63,7 @@ ChordNames
 Cluster
 \\cm
 \\coda
-\\column
+\\column - \ << _ >> -
 \\combine
 \\commandspanrequest
 \\complex
@@ -202,6 +203,7 @@ LyricsVoice
 \\marcato
 \\mark
 \\markup
+-\\markup - { _ } -
 \\maxima
 \\melisma
 \\melisma