summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-01-11 20:57:56 +0000
committerjao <jao@gnu.org>2021-01-11 20:57:56 +0000
commit566935a0e14bf5538467fd8ec69788e558c96278 (patch)
treec7ca75e7d39e8e44c7b258c032ae7ad6ef3994d2
parentc9218804220c496d0c841eecaa0c8b6a92146880 (diff)
downloadelibs-566935a0e14bf5538467fd8ec69788e558c96278.tar.gz
elibs-566935a0e14bf5538467fd8ec69788e558c96278.tar.bz2
oops
-rw-r--r--eos/jao-ednc.el (renamed from eos/sys/jao-ednc.el)0
-rw-r--r--eos/jao-embark.el (renamed from eos/sys/jao-embark.el)26
-rw-r--r--eos/jao-minibuffer.el (renamed from eos/sys/jao-minibuffer.el)0
-rw-r--r--eos/jao-notify.el (renamed from eos/sys/jao-notify.el)0
-rw-r--r--eos/jao-osd.el (renamed from eos/sys/jao-osd.el)0
-rw-r--r--eos/jao-sleep.el (renamed from eos/sys/jao-sleep.el)0
-rw-r--r--media/espotify.org9
7 files changed, 23 insertions, 12 deletions
diff --git a/eos/sys/jao-ednc.el b/eos/jao-ednc.el
index 03d4049..03d4049 100644
--- a/eos/sys/jao-ednc.el
+++ b/eos/jao-ednc.el
diff --git a/eos/sys/jao-embark.el b/eos/jao-embark.el
index 9572489..b590782 100644
--- a/eos/sys/jao-embark.el
+++ b/eos/jao-embark.el
@@ -26,6 +26,8 @@
(require 'embark)
+(declare-function w3m-anchor "w3m")
+
(defvar jao-embark-video-url-rx
(format "^https?://\\(?:www\\.\\)?%s/.+"
(regexp-opt '("youtu.be"
@@ -36,27 +38,33 @@
t))
"A regular expression matching URLs that point to video streams")
+;;;###autoload
(defun jao-embark-video-finder ()
"Check whether we're looking at a video URL.
Return (video-url . <URL>) if so."
- (when-let ((url (thing-at-point-url-at-point)))
- (when (string-match-p jao-embark-video-url-rx url)
- (cons 'video-url url))))
+ (when-let ((url (or (embark-target-url-at-point) (w3m-anchor))))
+ (if (string-match-p jao-embark-video-url-rx url)
+ (cons 'video-url url)
+ (cons 'url url))))
+;;;###autoload
(defun jao-embark-play-video-url (&optional url)
(interactive "sURL: ")
(let ((cmd (format "mpv %s" (shell-quote-argument url))))
(start-process-shell-command "mpv" nil cmd)))
-(add-to-list 'embark-target-finders #'jao-embark-video-finder)
+(define-key embark-url-map (kbd "f") #'browse-url-firefox)
(embark-define-keymap jao-embark-video-url-map
"Actions on URLs pointing to remote video streams."
- ("p" jao-embark-play-video-url)
- ("b" browse-url)
- ("f" browse-url-firefox))
-
-(add-to-list 'embark-keymap-alist '(video-url . jao-embark-video-url-map))
+ :parent embark-url-map
+ ("p" jao-embark-play-video-url))
+
+;;;###autoload
+(defun jao-embark-setup ()
+ (interactive)
+ (add-to-list 'embark-target-finders #'jao-embark-video-finder)
+ (add-to-list 'embark-keymap-alist '(video-url . jao-embark-video-url-map)))
(provide 'jao-embark)
;;; jao-embark.el ends here
diff --git a/eos/sys/jao-minibuffer.el b/eos/jao-minibuffer.el
index b626151..b626151 100644
--- a/eos/sys/jao-minibuffer.el
+++ b/eos/jao-minibuffer.el
diff --git a/eos/sys/jao-notify.el b/eos/jao-notify.el
index dc48ca4..dc48ca4 100644
--- a/eos/sys/jao-notify.el
+++ b/eos/jao-notify.el
diff --git a/eos/sys/jao-osd.el b/eos/jao-osd.el
index acdc629..acdc629 100644
--- a/eos/sys/jao-osd.el
+++ b/eos/jao-osd.el
diff --git a/eos/sys/jao-sleep.el b/eos/jao-sleep.el
index 93da0e7..93da0e7 100644
--- a/eos/sys/jao-sleep.el
+++ b/eos/jao-sleep.el
diff --git a/media/espotify.org b/media/espotify.org
index 5cc0fee..686bad4 100644
--- a/media/espotify.org
+++ b/media/espotify.org
@@ -200,7 +200,7 @@ Let's start with an umbrella customization group:
(defun espotify-search-all (callback term &optional types filter)
(let ((types (or types '(album track artist playlist))))
(espotify-search* (lambda (&rest items)
- (funcall callback (apply append items)))
+ (funcall callback (apply 'append items)))
term
types
filter)))
@@ -256,11 +256,14 @@ Let's start with an umbrella customization group:
The top-level command will have this form:
#+begin_src emacs-lisp
+ (defvar espotify-consult-history nil)
+
(defun consult-spotify-by (type &optional filter)
(consult--read (format "Search %ss: " type)
(espotify--search-generator type filter)
:lookup 'espotify--consult-lookup
- :category 'spotify-query-result
+ :category 'espotify-search-item
+ :history 'espotify-consult-history
:initial "#"
:require-match t))
#+end_src
@@ -386,7 +389,7 @@ Let's start with an umbrella customization group:
:face 'maginalia-modified :width 10))))
(add-to-list 'marginalia-annotators-heavy
- (cons 'spotify-query-result 'espotify-marginalia-annotate))
+ (cons 'espotify-search-item 'espotify-marginalia-annotate))
#+end_src
* Post-amble :noexport: