diff --git a/README.md b/README.md index 054d3c0..13b0f32 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,11 @@ extension for such files): (setq auto-mode-alist (cons '("\\.pro$" . chordpro-mode) auto-mode-alist)) (autoload 'chordpro-mode "chordpro-mode") -Now when you visit a .pro file you should automatically get chordpro-mode. +Now when you visit a .pro file you should automatically get +chordpro-mode. The file will automatically be saved in latin-1 +encoding (you can change this by setting the chordpro-file-encoding +variable in your .emacs, but you probably shouldn't as Chordii +currently expects latin-1 encoded files). Some of the functions use dropdown-list.el, which can be installed with package-list-packages in modern emacs. If you don't have this @@ -39,7 +43,7 @@ installed they'll just do nothing. ### Keyboard ### -All of the keyboard commands use the Ctrl-c prefix. +Most of the keyboard commands use the Ctrl-c prefix. * Ctrl-c i : Insert a chord at the point. You'll be prompted for the chord name in the minibuffer. The brackets will automatically be diff --git a/chordpro-mode.el b/chordpro-mode.el index 88d9fc7..9944d25 100644 --- a/chordpro-mode.el +++ b/chordpro-mode.el @@ -7,12 +7,15 @@ ("\\({subtitle[^}]*}\\)" . font-lock-type-face) ("\\({title[^}]*}\\)" . font-lock-keyword-face) ("\\({[^}]*}\\)" . font-lock-variable-name-face)))) + +(defvar chordpro-file-encoding 'latin-1) (define-derived-mode chordpro-mode text-mode "Chordpro" "Major mode for editing Chordpro files. Special commands: \\{chordpro-mode-map}" (setq font-lock-defaults chordpro-font-lock-defaults) + (setq buffer-file-coding-system chordpro-file-encoding) (auto-fill-mode -1)) (define-key chordpro-mode-map "\C-ci" 'chordpro-insert-chord)