aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/elisp/org-bookmark.el
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-07-27 16:29:41 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-07-27 16:36:34 +0100
commitf740c21d7957e0c1fd4099efcd01193374e8cee9 (patch)
treecfceac8ef77a6c7bfb2b841d92a34197580bb072 /Emacs/.config/emacs/elisp/org-bookmark.el
parent370793e72e67c22fae687ee3438fe65dcb136311 (diff)
downloaddotfiles-f740c21d7957e0c1fd4099efcd01193374e8cee9.tar.gz
dotfiles-f740c21d7957e0c1fd4099efcd01193374e8cee9.tar.bz2
dotfiles-f740c21d7957e0c1fd4099efcd01193374e8cee9.zip
(Emacs/elisp)~Make separate module for mpv from org-bookmark
Diffstat (limited to 'Emacs/.config/emacs/elisp/org-bookmark.el')
-rw-r--r--Emacs/.config/emacs/elisp/org-bookmark.el18
1 files changed, 3 insertions, 15 deletions
diff --git a/Emacs/.config/emacs/elisp/org-bookmark.el b/Emacs/.config/emacs/elisp/org-bookmark.el
index 3b4c7d1..d2ab950 100644
--- a/Emacs/.config/emacs/elisp/org-bookmark.el
+++ b/Emacs/.config/emacs/elisp/org-bookmark.el
@@ -27,11 +27,9 @@
(autoload #'org-get-tags "org")
(autoload #'org-entry-get "org")
(autoload #'org-make-tags-matcher "org")
+(autoload #'mpv-start-process "mpv")
(defvar org-bookmark/file (expand-file-name (concat org-directory "/bookmarks.org")))
-(defvar org-bookmark/mpv-args "-v --ytdl-raw-options=force-ipv4= \
- --ytdl-format=\"bestvideo[height<=1080][fps<=60]+bestaudio/best[height<=1920]\" \
- --profile=fast --hwdec=auto-copy")
(defun org-bookmark/--get-heading-data ()
"In an org-mode buffer, with point on a heading: get the title,
@@ -68,6 +66,7 @@ urls)."
(defvar org-bookmark/--cache nil
"Cached alist constructed from bookmarks file of form (TITLE+TAG
. URL).")
+
(defvar org-bookmark/--cache-last-modified nil
"Last modified time for bookmarks file as a float.")
@@ -85,21 +84,10 @@ are cached for faster lookup."
(org-bookmark/--get-all-heading-data))))))
org-bookmark/--cache)
-(defun org-bookmark/open-mpv (url)
- (interactive)
- (message "[bookmark]: Starting MPV process")
- (with-current-buffer (get-buffer-create "*mpv*")
- (ansi-color-for-comint-mode-on)
- (comint-mode))
- (set-process-filter (start-process-shell-command
- "bookmark-mpv" "*mpv*"
- (concat "mpv " org-bookmark/mpv-args " \"" url "\""))
- #'comint-output-filter))
-
(defconst org-bookmark/dispatch-list
'((("^https://\\(www.\\)?youtu\\(.\\)?be"
"\\.mp4$")
- . org-bookmark/open-mpv)
+ . mpv-start-process)
(otherwise . eww))
"List of pairs of type (PATTERNS . FUNC) which is used in
ORG-BOOKMARK/OPEN-BOOKMARK to handle opening urls.