From 8fddc0d0a741ca8b77c08a6c8f33ce1ee6a5925e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sat, 2 Feb 2013 00:56:15 +0100 Subject: [PATCH] emacs: Move EMMS settings to init.org --- .emacs.d/init.el | 7 ------ .emacs.d/init.org | 46 +++++++++++++++++++++++++++++++++++++++ .emacs.d/site-lisp/oni.el | 29 ------------------------ 3 files changed, 46 insertions(+), 36 deletions(-) diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 61e0f96..5d6a328 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -23,7 +23,6 @@ "Face for the supposedly empty line in commit messages." :group 'local) -(eval-after-load "emms-source-file" '(oni:emms-init)) (eval-after-load "flymake" '(oni:flymake-init)) (eval-after-load "ido" '(oni:ido-init)) (eval-after-load "jabber" '(oni:jabber-init)) @@ -98,7 +97,6 @@ (tool-bar-lines . nil) (font . "Envy Code R:pixelsize=18"))) (setq elnode-do-init nil) -(setq emms-source-file-default-directory "/mnt/music/") (setq erc-autojoin-channels-alist '(("freenode.net" "#ninthfloor" "#emacs"))) (setq erc-hide-list '("JOIN" "PART" "QUIT")) @@ -259,13 +257,8 @@ (define-key key-translation-map (kbd "C-l") (kbd "C-j")) (global-set-key (kbd "'") 'oni:self-insert-dwim) -(global-set-key (kbd "") 'emms-next) -(global-set-key (kbd "") 'oni:emms-toggle-playing) -(global-set-key (kbd "") 'emms-previous) -(global-set-key (kbd "") 'emms-stop) (global-set-key (kbd "") 'oni:raise-scratch) (global-set-key (kbd "") 'oni:view-mail) -(global-set-key (kbd "") 'oni:start-emms) (global-set-key (kbd "") 'git-project-show-files) (global-set-key (kbd "") 'ext:reload-buffer) (global-set-key (kbd "") 'jabber-switch-to-roster-buffer) diff --git a/.emacs.d/init.org b/.emacs.d/init.org index 9caead5..50a4161 100644 --- a/.emacs.d/init.org +++ b/.emacs.d/init.org @@ -83,6 +83,52 @@ (eval-after-load "eldoc" '(diminish 'eldoc-mode)) #+END_SRC + Use the standard EMMS configuration and add some MPD settings. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:emms-init () + "Initialization function for EMMS." + (require 'emms-setup) + (require 'emms-player-mpd) + + (emms-standard) + + (add-to-list 'emms-info-functions 'emms-info-mpd) + (add-to-list 'emms-player-list 'emms-player-mpd) + + (setq emms-player-mpd-server-name "localhost") + (setq emms-player-mpd-server-port "6600") + (setq emms-player-mpd-music-directory "/mnt/music/mp3")) + + (eval-after-load "emms-source-file" '(oni:emms-init)) + (setq emms-source-file-default-directory "/mnt/music/") + #+END_SRC + + Add some keybindings for EMMS. + + #+BEGIN_SRC emacs-lisp :tangle init2.el + (defun oni:emms-toggle-playing () + "Toggle between playing/paused states." + (interactive) + (if (eq emms-player-playing-p nil) + (emms-start) + (emms-pause))) + + (defun oni:start-emms () + "Check to see if the function `emms' exists, if not call + `emms-player-mpd-connect' and assume that will have loaded it." + (interactive) + (unless (fboundp 'emms) + (emms-player-mpd-connect)) + (emms)) + + (global-set-key (kbd "") 'emms-next) + (global-set-key (kbd "") 'oni:emms-toggle-playing) + (global-set-key (kbd "") 'emms-previous) + (global-set-key (kbd "") 'emms-stop) + (global-set-key (kbd "") 'oni:start-emms) + #+END_SRC + ** Eshell Add ~unison~ to the list of =eshell-visual-commands= because it diff --git a/.emacs.d/site-lisp/oni.el b/.emacs.d/site-lisp/oni.el index 453c01a..78dcb8f 100644 --- a/.emacs.d/site-lisp/oni.el +++ b/.emacs.d/site-lisp/oni.el @@ -104,27 +104,6 @@ DOT are intentionally being skipped." "Function for `emacs-lisp-mode-hook'." (eldoc-mode)) -(defun oni:emms-init () - "Initialization function for EMMS." - (require 'emms-setup) - (require 'emms-player-mpd) - - (emms-standard) - - (add-to-list 'emms-info-functions 'emms-info-mpd) - (add-to-list 'emms-player-list 'emms-player-mpd) - - (setq emms-player-mpd-server-name "localhost") - (setq emms-player-mpd-server-port "6600") - (setq emms-player-mpd-music-directory "/mnt/music/mp3")) - -(defun oni:emms-toggle-playing () - "Toggle between playing/paused states." - (interactive) - (if (eq emms-player-playing-p nil) - (emms-start) - (emms-pause))) - (defun oni:erc-mode-func () "Function for `erc-mode-hook'." (erc-fill-mode -1) @@ -562,14 +541,6 @@ If no direction is given, don't split." ((?h) (split-window-horizontally)) (t window)))) -(defun oni:start-emms () - "Check to see if the function `emms' exists, if not call -`emms-player-mpd-connect' and assume that will have loaded it." - (interactive) - (unless (fboundp 'emms) - (emms-player-mpd-connect)) - (emms)) - (defun oni:start-python-test-mail-server () "Run the python test mailserver." (interactive)