diff options
author | jao <jao@gnu.org> | 2021-06-01 03:13:06 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-06-01 03:13:06 +0100 |
commit | 3c6913a6d4fb0d89f3b40ad552c533473d0271c0 (patch) | |
tree | 0608f58613521aaef4808db1ba532e5b30924bbf | |
parent | f44288f792b42c5b7fc3fe979e4915afdd3e2e33 (diff) | |
download | elibs-3c6913a6d4fb0d89f3b40ad552c533473d0271c0.tar.gz elibs-3c6913a6d4fb0d89f3b40ad552c533473d0271c0.tar.bz2 |
jao-mpc-add-url, for podcasts
-rw-r--r-- | gnus.org | 22 | ||||
-rw-r--r-- | lib/media/jao-mpc.el | 5 |
2 files changed, 16 insertions, 11 deletions
@@ -683,17 +683,17 @@ (defun jao-gnus-open-enclosure (&optional playp) (interactive "P") - (gnus-summary-select-article-buffer) - (save-excursion - (goto-char (point-min)) - (when (search-forward "Enclosure:") - (forward-char 2) - (when-let ((url (thing-at-point-url-at-point))) - (message "%s %s ..." (if playp "Playing" "Adding") url) - (if playp (emms-play-url url) (emms-add-url url)) - (when playp - (sit-for 1) - (jao-emms-echo)))))) + (save-window-excursion + (gnus-summary-select-article-buffer) + (save-excursion + (goto-char (point-min)) + (when (search-forward "Enclosure:") + (forward-char 2) + (when-let ((url (thing-at-point-url-at-point))) + (message "%s %s ..." (if playp "Playing" "Adding") url) + (when playp (jao-mpc-clear)) + (jao-mpc-add-url url) + (when playp (jao-mpc-play))))))) #+end_src * Keyboard shortcuts #+BEGIN_SRC emacs-lisp diff --git a/lib/media/jao-mpc.el b/lib/media/jao-mpc.el index 669883c..5f70f15 100644 --- a/lib/media/jao-mpc.el +++ b/lib/media/jao-mpc.el @@ -203,6 +203,11 @@ (jao-notify (jao-mpc--current-str))) ;;;###autoload +(defun jao-mpc-add-url (url) + (interactive "sURL: ") + (jao-mpc--cmd (format "add %s" url))) + +;;;###autoload (defun jao-mpc-show-albums () "Show album list." (interactive) |