summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--content-org/emacs.org14
-rw-r--r--content/emacs/watching-youtube-with-emacs.md15
2 files changed, 19 insertions, 10 deletions
diff --git a/content-org/emacs.org b/content-org/emacs.org
index 7a0ae51..ed8850d 100644
--- a/content-org/emacs.org
+++ b/content-org/emacs.org
@@ -1059,11 +1059,11 @@ My (current) full function in use is:
#+begin_src emacs-lisp
(defun mms-open-link-under-point ()
(interactive)
- (setq url (thing-at-point 'url))
- (cond
- ((string-match "youtube.com" url) (yeetube-search url))
- (t (eww url)))
- )
+ (let (url (thing-at-point 'url))
+ (cond
+ ((string-match "youtube.com" url) (yeetube-search url))
+ (t (eww url)))
+ ))
#+end_src
So it will use =eww= for anything that is not a YT link, and I can expand it further whenever I want.
@@ -1075,6 +1075,10 @@ Then, just add a simple keyboard navigation, and you're done
"RET RET" '(lambda () (interactive) (mms-open-link-under-point) :wk "follow link"))
#+end_src
+*** Errata
+
+2024-02-26: Dave pointed me that using =let= inside custom method is preferable to =setq=
+
[fn:ytrss] The secret URL: =https://www.youtube.com/feeds/videos.xml?channel_id=<channel_id>=.
You can find the channel ID using different online services, as it is not as straight forward as it should be.
[fn:providers] Only if the package registers itself as a provider for =thing-at-point=.
diff --git a/content/emacs/watching-youtube-with-emacs.md b/content/emacs/watching-youtube-with-emacs.md
index ea13c6f..fc8b5da 100644
--- a/content/emacs/watching-youtube-with-emacs.md
+++ b/content/emacs/watching-youtube-with-emacs.md
@@ -89,11 +89,11 @@ My (current) full function in use is:
```emacs-lisp
(defun mms-open-link-under-point ()
(interactive)
- (setq url (thing-at-point 'url))
- (cond
- ((string-match "youtube.com" url) (yeetube-search url))
- (t (eww url)))
- )
+ (let (url (thing-at-point 'url))
+ (cond
+ ((string-match "youtube.com" url) (yeetube-search url))
+ (t (eww url)))
+ ))
```
So it will use `eww` for anything that is not a YT link, and I can expand it further whenever I want.
@@ -105,6 +105,11 @@ Then, just add a simple keyboard navigation, and you're done
"RET RET" '(lambda () (interactive) (mms-open-link-under-point) :wk "follow link"))
```
+
+## Errata {#errata}
+
+2024-02-26: Dave pointed me that using `let` inside custom method is preferable to `setq`
+
[^fn:1]: ["yeetube | Emacs Front-End for YouTube"](https://thanosapollo.org/post/yeetube/) blog post from the author
[^fn:2]: [mpv official website](https://mpv.io/)
[^fn:3]: The secret URL: `https://www.youtube.com/feeds/videos.xml?channel_id=<channel_id>`.