diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-02-17 22:50:01 +0000 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-02-17 22:50:01 +0000 |
commit | 51ce40aee0b4dff89266add1ff5879e73b7372d7 (patch) | |
tree | d264263e58502dbcbbd4a607bda81820bad917e3 | |
parent | 038d51b405573e2f6a065856a3fa20018a2bc81c (diff) | |
download | dotfiles-51ce40aee0b4dff89266add1ff5879e73b7372d7.tar.gz dotfiles-51ce40aee0b4dff89266add1ff5879e73b7372d7.tar.bz2 dotfiles-51ce40aee0b4dff89266add1ff5879e73b7372d7.zip |
+elfeed/dispatch-entry -> +elfeed/dispatch
Don't pop the option up to the user on entry, just provide a good
binding to access when needed.
-rw-r--r-- | Emacs/.config/emacs/config.org | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org index 68ef458..088387c 100644 --- a/Emacs/.config/emacs/config.org +++ b/Emacs/.config/emacs/config.org @@ -3722,6 +3722,9 @@ to elfeed for loading the system. "gr" #'elfeed-update "s" #'elfeed-search-live-filter "<return>" #'elfeed-search-show-entry) + (nmmap + :keymaps 'elfeed-show-mode-map + "M-RET" #'+elfeed/dispatch) :init (setq elfeed-db-directory (no-littering-expand-var-file-name "elfeed/")) :config @@ -3732,7 +3735,7 @@ to elfeed for loading the system. '(("Yank URL" . (lambda (url) (kill-new url) - (message "elfeed: Yanked %s" url))) + (message "elfeed-dispatch: Yanked %s" url))) ("Open via EWW" . eww) ("Play via EMPV" . (lambda (url) @@ -3740,17 +3743,18 @@ to elfeed for loading the system. ;; FIXME: Using internal macro (empv--with-video-enabled (empv-play-or-enqueue url)) - (message "elfeed: EMPV is not available"))))) + (message "elfeed-dispatch: EMPV is not available"))))) "Options available on entering an elfeed post.") - (defun +elfeed/dispatch-entry (entry) + (defun +elfeed/dispatch () "Provide some extra options once you've clicked on an article." + (interactive) + (if (null elfeed-show-entry) + (user-error "elfeed-dispatch: Not in an elfeed post.")) (let ((choice (completing-read "Choose action: " (mapcar #'car +elfeed/dispatch-options))) - (url (elfeed-entry-link entry))) + (url (elfeed-entry-link elfeed-show-entry))) (if-let ((option (cdr (assoc choice +elfeed/dispatch-options #'string=)))) - (funcall option url)))) - - (advice-add 'elfeed-search-show-entry :after #'+elfeed/dispatch-entry)) + (funcall option url))))) #+end_src *** Elfeed-org #+begin_src emacs-lisp |