summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJSDurand <mmemmew@gmail.com>2022-08-24 15:56:19 +0800
committerJSDurand <mmemmew@gmail.com>2022-08-24 15:56:19 +0800
commitd2981800dabfb0cdae9eaaf5a4c644c177fb0e12 (patch)
tree081f7fe051a2a1992f572ff9f86985b3cc68033b
parentc9aba5df32dae367a70ffd99b1fa3a66b8c29a87 (diff)
Add RUMU support
-rw-r--r--init.el15
-rw-r--r--rumu.el39
2 files changed, 54 insertions, 0 deletions
diff --git a/init.el b/init.el
index ccba9dc..aeb700d 100644
--- a/init.el
+++ b/init.el
@@ -406,6 +406,21 @@ no effect."
'auto-mode-alist
(cons "\\.rs$" #'rustic-mode))))
+;;; Rust Music Mode (rumu)
+
+(load-after-function rumu-mode "rumu.el"
+ "Load Rust music configurations" nil
+ (rumu-mode))
+
+(cond
+ ((assoc "\\.rumu$" auto-mode-alist #'string=)
+ (setcdr
+ (assoc "\\.rumu$" auto-mode-alist #'string=)
+ #'rumu-mode))
+ ((add-to-list
+ 'auto-mode-alist
+ (cons "\\.rumu$" #'rumu-mode))))
+
;;; Cat and mouse
(cond ((display-mouse-p) (mouse-avoidance-mode 'none)))
diff --git a/rumu.el b/rumu.el
new file mode 100644
index 0000000..eeb900e
--- /dev/null
+++ b/rumu.el
@@ -0,0 +1,39 @@
+;;; rumu.el --- Rust music sheet files -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2022 李俊緯
+
+;; Author: 李俊緯 <mmemmew@gmail.com>
+;; Keywords: files, games, hypermedia, languages, multimedia, tools
+
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; This file implements the major mode for dealing with Rust Music
+;; files, called rumu files.
+;;
+;; This is a format for music sheets that are defined by my music
+;; converter program written in Rust, and hence the name.
+
+;;; Code:
+
+(define-derived-mode rumu-mode text-mode "Rumu"
+ "Major mode for editing rumu files."
+ (set (make-local-variable 'comment-start) ";")
+ (set (make-local-variable 'comment-end) "")
+ (set (make-local-variable 'comment-use-syntax) t)
+ (set (make-local-variable 'comment-multi-line) nil))
+
+(provide 'rumu)
+;;; rumu.el ends here