diff options
| author | Mark Oteiza | 2015-10-13 18:14:49 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2015-10-13 18:14:49 -0400 |
| commit | e90de8276fb8c8365be8b8d0f696b3c93c4b7c4f (patch) | |
| tree | 50bb0c0b4f4bdf5ac47a6282ef0331ed9b4cd17f | |
| parent | 18b0eb7f1cc16fe33f89c74d2497a6fcb4b863fd (diff) | |
| download | emacs-e90de8276fb8c8365be8b8d0f696b3c93c4b7c4f.tar.gz emacs-e90de8276fb8c8365be8b8d0f696b3c93c4b7c4f.zip | |
Derive mpc-mode from special-mode
lisp/mpc.el (mpc-mode-map): Make from sparse keymap. Unbind g.
(mpc-mode): Derive from special mode.
(mpc-songs-mode-map): Don't set parent keymap.
| -rw-r--r-- | lisp/mpc.el | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lisp/mpc.el b/lisp/mpc.el index 063a545da81..2142529b2e0 100644 --- a/lisp/mpc.el +++ b/lisp/mpc.el | |||
| @@ -1090,8 +1090,7 @@ If PLAYLIST is t or nil or missing, use the main playlist." | |||
| 1090 | ;;; The actual UI code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1090 | ;;; The actual UI code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 1091 | 1091 | ||
| 1092 | (defvar mpc-mode-map | 1092 | (defvar mpc-mode-map |
| 1093 | (let ((map (make-keymap))) | 1093 | (let ((map (make-sparse-keymap))) |
| 1094 | (suppress-keymap map) | ||
| 1095 | ;; (define-key map "\e" 'mpc-stop) | 1094 | ;; (define-key map "\e" 'mpc-stop) |
| 1096 | (define-key map "q" 'mpc-quit) | 1095 | (define-key map "q" 'mpc-quit) |
| 1097 | (define-key map "\r" 'mpc-select) | 1096 | (define-key map "\r" 'mpc-select) |
| @@ -1110,6 +1109,7 @@ If PLAYLIST is t or nil or missing, use the main playlist." | |||
| 1110 | ;; is applied elsewhere :-( | 1109 | ;; is applied elsewhere :-( |
| 1111 | ;; (define-key map [(double mouse-2)] 'mpc-play-at-point) | 1110 | ;; (define-key map [(double mouse-2)] 'mpc-play-at-point) |
| 1112 | (define-key map "p" 'mpc-pause) | 1111 | (define-key map "p" 'mpc-pause) |
| 1112 | (define-key map "g" nil) | ||
| 1113 | map)) | 1113 | map)) |
| 1114 | 1114 | ||
| 1115 | (easy-menu-define mpc-mode-menu mpc-mode-map | 1115 | (easy-menu-define mpc-mode-menu mpc-mode-map |
| @@ -1158,10 +1158,9 @@ If PLAYLIST is t or nil or missing, use the main playlist." | |||
| 1158 | :help "Append to the playlist") | 1158 | :help "Append to the playlist") |
| 1159 | map)) | 1159 | map)) |
| 1160 | 1160 | ||
| 1161 | (define-derived-mode mpc-mode fundamental-mode "MPC" | 1161 | (define-derived-mode mpc-mode special-mode "MPC" |
| 1162 | "Major mode for the features common to all buffers of MPC." | 1162 | "Major mode for the features common to all buffers of MPC." |
| 1163 | (buffer-disable-undo) | 1163 | (buffer-disable-undo) |
| 1164 | (setq buffer-read-only t) | ||
| 1165 | (if (boundp 'tool-bar-map) ; not if --without-x | 1164 | (if (boundp 'tool-bar-map) ; not if --without-x |
| 1166 | (setq-local tool-bar-map mpc-tool-bar-map)) | 1165 | (setq-local tool-bar-map mpc-tool-bar-map)) |
| 1167 | (setq-local truncate-lines t)) | 1166 | (setq-local truncate-lines t)) |
| @@ -1883,7 +1882,6 @@ A value of t means the main playlist.") | |||
| 1883 | 1882 | ||
| 1884 | (defvar mpc-songs-mode-map | 1883 | (defvar mpc-songs-mode-map |
| 1885 | (let ((map (make-sparse-keymap))) | 1884 | (let ((map (make-sparse-keymap))) |
| 1886 | (set-keymap-parent map mpc-mode-map) | ||
| 1887 | (define-key map [remap mpc-select] 'mpc-songs-jump-to) | 1885 | (define-key map [remap mpc-select] 'mpc-songs-jump-to) |
| 1888 | map)) | 1886 | map)) |
| 1889 | 1887 | ||