Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elfeed-org fails to populate elfeed-feeds variable when (use-package elfeed-org :defer t) #95

Open
stottm opened this issue Aug 7, 2024 · 0 comments

Comments

@stottm
Copy link

stottm commented Aug 7, 2024

There are a lot of people instructing newbies to defer loading of all packages. That is bad advice. I have discovered an issue described below that could be considered user configuration error. This is not a bug. However, this behavior should be documented in the README at least. Add a recommended use-package configuration for elfeed & elfeed-org.

While you can defer load elfeed itself, if you attempt to also defer load elfeed-org, it will not populate the variable elfeed-feeds with the org file listing of feeds which means elfeed cannot update the feeds as it cannot see the feeds.

Turning off deferral on elfeed-org resulted in increased start times but resolved the problem with elfeed not updating feeds. Re-examining use-package docs and reviewing Prot's recent use-package video, I've come up with a solution.

Utilizing the following works for me (I am no expert) and reduced startup time for elfeed-org from 0.42 to 0.01 (YMMV) as measured by use-package-report and resulted in an overall reduced startup time of approximately a tenth of a second (every little bit counts towards the total).

(use-package elfeed
	:defer t
	:bind
	("C-c e" . elfeed))

(use-package elfeed-org
	:after (elfeed)
	:config
	(elfeed-org)
	(setq rmh-elfeed-org-files (list "~/.config/emacs/elfeed.org")))

You can enable use-package statistics in your init.el so you can benchmark load times of packages.

(setq use-package-compute-statistics t) ;; Review metrics M-x use-package-report

You can also enable printing the Emacs load time at every startup.

;; Reset variables, and new startup message
(add-hook 'emacs-startup-hook
	(lambda ()
	;; Reset the file handler list
	(setq file-name-handler-alist pure-file-name-handler-alist)
	;; Reset garbage collection
	(setq gc-cons-threshold 2000000)
	;; Startup time message
	(message (format "Emacs ready in %.5f seconds with %d garbage collections."
	 	   (float-time (time-subtract after-init-time before-init-time))
		   gcs-done))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant