From 9e48aae2523b75c7913a1b665310fb35155fea76 Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 26 Feb 2021 11:48:01 +0800 Subject: Bind zap-up-to-char and a key to conveniently exit elfeed. * basic.el (global-map): Bind zap-up-to-char. * elfeed-conf.el (elfeed-search-mode-map): (elfeed-search-exit): Bind a key to conveniently exit elfeed. --- basic.el | 4 ++++ elfeed-conf.el | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/basic.el b/basic.el index eb7ab1e..84c358c 100644 --- a/basic.el +++ b/basic.el @@ -198,6 +198,10 @@ window, then also delete the selected window." (define-key global-map (vector ?\s-k) #'durand-kill-current-buffer) +;;; zap-up-to-char and zap-to-char are both useful. + +(define-key global-map (vector (logior (ash 1 27) #x5a)) #'zap-up-to-char) + ;;; Repeating pops ;;;###autoload diff --git a/elfeed-conf.el b/elfeed-conf.el index 61e43a9..94c6f72 100644 --- a/elfeed-conf.el +++ b/elfeed-conf.el @@ -37,6 +37,8 @@ (list "https://protesilaos.com/politics.xml" 'prot 'politics))) +(define-key elfeed-search-mode-map (vector #x78) 'elfeed-search-exit) + ;; I still prefer the defaults. (setq elfeed-show-entry-switch #'switch-to-buffer) @@ -56,5 +58,17 @@ ((one-window-p)) ((delete-window (get-buffer-window (current-buffer)))))) +;;;###autoload +(defun elfeed-search-exit () + "Save the database, then kill all related buffers." + (interactive) + (elfeed-db-save) + (mapc + (function + (lambda (buffer) + (cond ((string-match-p "^\\*elfeed" (buffer-name buffer)) + (kill-buffer buffer))))) + (buffer-list))) + (provide 'elfeed-conf) ;;; elfeed-conf.el ends here -- cgit v1.2.3-18-g5258