From 22d97916f51c049a777148205c0fd95a1aabc689 Mon Sep 17 00:00:00 2001 From: mms Date: Mon, 26 Feb 2024 20:02:00 +0100 Subject: fix: setq->let --- content-org/emacs.org | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'content-org/emacs.org') 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==. 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=. -- cgit v1.2.3