lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Emacs-mode: un-comment-region


From: Heikki Johannes Junes
Subject: [PATCH] Emacs-mode: un-comment-region
Date: Tue, 9 Apr 2002 01:55:40 +0300 (EET DST)

Inspired by LaTeX-mode, there is now new grouping in menus which separates
commands which execute something outside Emacs ("Command"-menu) and
commands which edit the buffer ("LilyPond"-menu"). New feature is
un-comment-region.

--- VERSION.~1.375.~    Mon Apr  8 23:51:12 2002
+++ VERSION     Tue Apr  9 01:32:04 2002
@@ -2,7 +2,7 @@
 MAJOR_VERSION=1
 MINOR_VERSION=5
 PATCH_LEVEL=51
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=hjj1
 
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
--- ChangeLog.~1.62.~   Mon Apr  8 23:51:12 2002
+++ ChangeLog   Tue Apr  9 01:31:53 2002
@@ -1,3 +1,10 @@
+2002-04-09  Heikki Junes <address@hidden>
+
+       * lilypond-mode.el: new command: LilyPond-un-comment-region.
+       Added 2Midi to "Command"-menu. Inspired by latex.el and tex.el: 
+       separate "Command"-menu and "LilyPond"-menu. Added "Miscellanous"-
+       submenu to "LilyPond"-menu.
+
 2002-04-08  Han-Wen Nienhuys  <address@hidden>
 
        * input/regression/script-stack-order.ly: new file.
Index: lilypond-mode.el
===================================================================
RCS file: /home/lilypond/lilypond/lilypond-mode.el,v
retrieving revision 1.30
diff -p -u -r1.30 lilypond-mode.el
--- lilypond-mode.el    7 Apr 2002 10:55:53 -0000       1.30
+++ lilypond-mode.el    8 Apr 2002 22:41:04 -0000
@@ -2,7 +2,7 @@
 ;;; lilypond-mode.el --- Major mode for editing GNU LilyPond music scores
 ;;;
 ;;; source file of the GNU LilyPond music typesetter
-;;; 
+;;;  
 ;;; (c) 1999--2001 Jan Nieuwenhuizen <address@hidden>
 ;;; 
 ;;; Changed 2001 Heikki Junes <address@hidden>
@@ -25,7 +25,7 @@
 (require 'easymenu)
 (require 'compile)
 
-(defconst LilyPond-version "1.5.28"
+(defconst LilyPond-version "1.5.51"
   "`LilyPond-mode' version number.")
 
 (defconst LilyPond-help-address "address@hidden"
@@ -369,6 +369,11 @@ Must be the car of an entry in `LilyPond
                ".midi"))
      "Midi")))
 
+(defun LilyPond-un-comment-region (start end level)
+  "Remove up to LEVEL comment characters from each line in the region."
+  (interactive "*r\np") 
+  (comment-region start end (- level)))
+
 ;; FIXME, this is broken
 (defun LilyPond-region-file (begin end)
   (let (
@@ -487,6 +492,7 @@ command."
   (define-key LilyPond-mode-map "\C-c\C-m" 'LilyPond-command-next-midi)
   (define-key LilyPond-mode-map "\C-cn" 'LilyPond-insert-tag-notes)
   (define-key LilyPond-mode-map "\C-cs" 'LilyPond-insert-tag-score)
+  (define-key LilyPond-mode-map "\C-c:" 'LilyPond-un-comment-region)
   (define-key LilyPond-mode-map "\C-c;" 'comment-region)
   (define-key LilyPond-mode-map ")" 'LilyPond-electric-close-paren)
   (define-key LilyPond-mode-map ">" 'LilyPond-electric-close-paren)
@@ -537,7 +543,7 @@ command."
           (vector name (list 'LilyPond-command-menu name) t)))))
 
 
-(easy-menu-define LilyPond-mode-menu
+(easy-menu-define LilyPond-command-menu
     LilyPond-mode-map
     "Menu used in LilyPond mode."
   (append '("Command")
@@ -551,12 +557,6 @@ command."
             [ "Region" LilyPond-command-select-region
               :keys "C-c C-r" :style radio
               :selected (eq LilyPond-command-current 'LilyPond-command-region) 
]))
-         '(("Insert"
-            [ "\\notes..."  LilyPond-insert-tag-notes
-              :keys "C-c n" ]
-            [ "\\score..."  LilyPond-insert-tag-score
-              :keys "C-c s" ]
-            ))
 ;        (let ((file 'LilyPond-command-on-current))
 ;          (mapcar 'LilyPond-command-menu-entry LilyPond-command-alist))
 ;;; Some kind of mapping which includes :keys might be more elegant
@@ -564,12 +564,27 @@ command."
          '([ "TeX" (LilyPond-command (LilyPond-command-menu "TeX") 
'LilyPond-master-file) ])
          '([ "2Dvi" (LilyPond-command (LilyPond-command-menu "2Dvi") 
'LilyPond-master-file) :keys "C-c C-d"])
          '([ "2PS" (LilyPond-command (LilyPond-command-menu "2PS") 
'LilyPond-master-file) :keys "C-c C-f"])
+         '([ "2Midi" (LilyPond-command (LilyPond-command-menu "2Midi") 
'LilyPond-master-file)])
          '([ "Book" (LilyPond-command (LilyPond-command-menu "Book") 
'LilyPond-master-file) ])
          '([ "LaTeX" (LilyPond-command (LilyPond-command-menu "LaTeX") 
'LilyPond-master-file) ])
          '([ "SmartView" (LilyPond-command (LilyPond-command-menu "SmartView") 
'LilyPond-master-file) :keys "C-c C-s"])
          '([ "View" (LilyPond-command (LilyPond-command-menu "View") 
'LilyPond-master-file) :keys "C-c C-v"])
          '([ "ViewPS" (LilyPond-command (LilyPond-command-menu "ViewPS") 
'LilyPond-master-file) :keys "C-c C-p"])
          '([ "Midi (off)" (LilyPond-command-next-midi) :keys "C-c C-m"])
+         ))
+
+(easy-menu-define LilyPond-mode-menu
+  LilyPond-mode-map
+  "Menu used in LilyPond mode."
+  (append '("LilyPond")
+         '(("Insert"
+            [ "\\notes..."  LilyPond-insert-tag-notes t]
+            [ "\\score..."  LilyPond-insert-tag-score t]
+            ))
+         '(("Miscellaneous"
+            ["Uncomment Region" LilyPond-un-comment-region t]
+            ["Comment Region" comment-region t]
+            ))
          ))
 
 (defconst LilyPond-imenu-generic-re "^\\([a-zA-Z_][a-zA-Z0-9_]*\\) *="
--

Have fun!
--
      Heikki Junes




reply via email to

[Prev in Thread] Current Thread [Next in Thread]