1;;; Chordpro generic mode 2;; Chordpro is a format of songs with guitar chords. 3;; 4;; Instalation: 1) copy this file to emacs load path 5;; 2) add to your .emacs (load "chordpro-mode.el") 6;; 7;; This mode is automatically set on files with suffix .pro. 8;; You can change this, of course. 9 10 11(defun chordpro-mode-choir-around () 12 (interactive) 13 "Surround region with start and end of choir marks..." 14 (vim-filter "echo \"{soc}\";cat;echo \"{eoc}\"")) 15 16(defun call-key (key) 17 "Call the command KEY is bound to. Example of usage in lisp: (call-key [f2])." 18 (interactive) 19 (command-execute (key-binding key) t)) 20 21 22(define-generic-mode 'chordpro-generic-mode 23 nil 24 nil 25 '(("\\(\\[[^]]*\\]\\)" 1 'font-lock-string-face) 26 ("^\\(#.*\\)" 1 'font-lock-comment-face) 27 ("\\({subtitle[^}]*}\\)" 1 'font-lock-type-face) 28 ("\\({title[^}]*}\\)" 1 'font-lock-keyword-face) 29 ("\\({[^}]*}\\)" 1 'font-lock-variable-name-face) 30 ) 31 (list "\\.pro\\'" "httpd\\.conf\\'" "access\\.conf\\'") 32 nil 33 "Generic mode for Chordpro guitar chord files.") 34