From c3f70f3e6d530d88e4f0b28719e6569d47c0ea5c Mon Sep 17 00:00:00 2001 From: Lucien Cartier-Tilet Date: Tue, 9 Nov 2021 13:39:34 +0100 Subject: [PATCH] [Emacs] Better keybinds, Emacs no longer clears MPD playlist --- org/config/emacs.org | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/org/config/emacs.org b/org/config/emacs.org index 6e81f5b..95e97b5 100644 --- a/org/config/emacs.org +++ b/org/config/emacs.org @@ -583,14 +583,23 @@ to the right or below the current window (respectively), but also to focus the new window immediately. #+begin_src emacs-lisp (defun split-window-right-and-focus () + "Spawn a new window right of the current one and focus it." (interactive) (split-window-right) (windmove-right)) (defun split-window-below-and-focus () + "Spawn a new window below the current one and focus it." (interactive) (split-window-below) (windmove-down)) + +(defun kill-buffer-and-delete-window () + "Kill the current buffer and delete its window." + (interactive) + (progn + (kill-this-buffer) + (delete-window))) #+end_src *** ~phundrak/toggle-org-src-window-split~ @@ -1952,9 +1961,12 @@ configuration [[file:mpd.org][here]]). (emms-all) (add-to-list 'emms-info-functions 'emms-info-mpd) (add-to-list 'emms-player-list 'emms-player-mpd) + (emms-player-mpd-sync-from-mpd) (emms-player-mpd-connect) - (add-hook 'emms-playlist-cleared-hook #'emms-player-mpd-clear) <> + (defun emms-player-toggle-pause () + (interactive) + (shell-command-and-echo "mpc toggle")) :custom ((emms-source-file-default-directory (expand-file-name "~/Music")) (emms-player-mpd-server-name "localhost") @@ -5757,12 +5769,7 @@ Undefining some stuff to make keybind prefixes work correctly. "w8" '(winum-select-window-8 :wk nil) "w9" '(winum-select-window-9 :wk nil) - "wb" '((lambda () - (interactive) - (progn - (kill-this-buffer) - (delete-window))) - :wk "Kill buffer and window") + "wb" #'kill-buffer-and-delete-window "wd" #'delete-window "wo" #'other-window "wD" #'delete-other-windows