-
Notifications
You must be signed in to change notification settings - Fork 12
/
simple-mpc-mode.el
56 lines (49 loc) · 2.13 KB
/
simple-mpc-mode.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
;;; simple-mpc-mode.el --- part of simple-mpc
;;
;; Copyright (C) 2015,2016 Joren Van Onder <[email protected]>
;; Author: Joren Van Onder <[email protected]>
;; URL: https://github.com/jorenvo/simple-mpc
;; Maintainer: Joren Van Onder <[email protected]>
;; Keywords: multimedia, mpd, mpc
;; Version: 1.0
;; This file is not part of GNU Emacs.
;;
;; 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 <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; Code:
(defvar simple-mpc-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "t" 'simple-mpc-toggle)
(define-key map "n" 'simple-mpc-next)
(define-key map "p" 'simple-mpc-prev)
(define-key map "f" 'simple-mpc-seek-forward)
(define-key map "b" 'simple-mpc-seek-backward)
(define-key map "V" 'simple-mpc-increase-volume)
(define-key map "v" 'simple-mpc-decrease-volume)
(define-key map "r" 'simple-mpc-toggle-repeat)
(define-key map "c" 'simple-mpc-view-current-playlist) ;; autoload this
(define-key map "C" 'simple-mpc-clear-current-playlist)
(define-key map "S" 'simple-mpc-shuffle-current-playlist)
(define-key map "l" 'simple-mpc-load-playlist)
(define-key map "s" 'simple-mpc-query) ;; autoload this
(define-key map "q" 'simple-mpc-quit)
map)
"Keymap for simple-mpc-mode.")
(define-derived-mode simple-mpc-mode special-mode "simple-mpc"
"Major mode for the simple-mpc screen.
\\{simple-mpc-mode-map}."
(setq truncate-lines t overwrite-mode 'overwrite-mode-binary)
(set (make-local-variable 'revert-buffer-function) #'simple-mpc))
(provide 'simple-mpc-mode)
;;; simple-mpc-mode.el ends here