fasheng / elfeed-protocol

Provide extra protocols to make like Fever, NewsBlur, Nextcloud/ownCloud News and Tiny Tiny RSS work with elfeed
GNU General Public License v3.0
100 stars 18 forks source link

assignment to free variable 'elfeed-protocol-tags' #59

Closed bsvh closed 1 year ago

bsvh commented 1 year ago

I'm using the following snippet from the README in my init.el:

(defadvice elfeed (after configure-elfeed-feeds activate)
  "Make elfeed-org autotags rules works with elfeed-protocol."
  (setq elfeed-protocol-tags elfeed-feeds)
  (setq elfeed-feeds (list
                      (list "owncloud+https://user@myhost.com"
                            :password '(password-store-get "owncloud/app-pass")
                            :autotags elfeed-protocol-tags))))

This results in a bytecompile warning when launching emacs.

error backtrace

Warning (bytecomp): assignment to free variable ‘elfeed-protocol-tags’
Warning (bytecomp): reference to free variable ‘elfeed-protocol-tags’

The elfeed-protocol-tags variable does not seem to be present in any of the source file in the repository. Is the snippet still relevant?

fasheng commented 1 year ago

Yes, elfeed-protocol-tags is just a temp variable in the example snippet, you can use any variable instead to store elfeed-feeds here.

bsvh commented 1 year ago

Ok. When installing elfeed-protocol with use-package, the bytecomp warning appears every time I open emacs. I was able to silence the error by adding a (setq elfeed-protocol-tags nil) before the defadvice.

fasheng commented 1 year ago

I will update the example code later

(defvar elfeed-protocol-orig-feeds nil
  "Store original content of `elfeed-feeds'.")
(defadvice elfeed (after configure-elfeed-feeds activate)
  "Make elfeed-org autotags rules works with elfeed-protocol."
  (setq elfeed-protocol-orig-feeds elfeed-feeds)
  (setq elfeed-feeds (list
                      (list "owncloud+https://user@myhost.com"
                            :password '(password-store-get "owncloud/app-pass")
                            :autotags elfeed-protocol-orig-feeds))))