summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-06-01 03:13:06 +0100
committerjao <jao@gnu.org>2021-06-01 03:13:06 +0100
commit3c6913a6d4fb0d89f3b40ad552c533473d0271c0 (patch)
tree0608f58613521aaef4808db1ba532e5b30924bbf
parentf44288f792b42c5b7fc3fe979e4915afdd3e2e33 (diff)
downloadelibs-3c6913a6d4fb0d89f3b40ad552c533473d0271c0.tar.gz
elibs-3c6913a6d4fb0d89f3b40ad552c533473d0271c0.tar.bz2
jao-mpc-add-url, for podcasts
-rw-r--r--gnus.org22
-rw-r--r--lib/media/jao-mpc.el5
2 files changed, 16 insertions, 11 deletions
diff --git a/gnus.org b/gnus.org
index 61ef7c5..a11bfa0 100644
--- a/gnus.org
+++ b/gnus.org
@@ -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)