diff options
author | mms <michal@sapka.me> | 2024-02-26 20:02:00 +0100 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-02-26 20:02:00 +0100 |
commit | 22d97916f51c049a777148205c0fd95a1aabc689 (patch) | |
tree | 2cb5d47ad1eded94d150005b84946fa9901d1a1b /content/emacs | |
parent | ea6a87ad7d78ec4d278fcb75cf8985ca08a3e3d0 (diff) |
fix: setq->let
Diffstat (limited to 'content/emacs')
-rw-r--r-- | content/emacs/watching-youtube-with-emacs.md | 15 |
1 files changed, 10 insertions, 5 deletions
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>`. |