Hello everyone,
I'm trying to switch my config over to use-package and running into an
issue with org. Most of my init file seems to be org-related (!), so I
won't post the whole thing, but will try to summarize. I've also posted a
bug report to the use-package repo (
https://github.com/jwiegley/use-package/issues/730).
Like many people, I have lots of versions of org-mode installed on my
machine: the old org that comes with emacs 27.0.50, the version from the
org ELPA repo, which is a dependency of many other packages, and finally an
up-to-date git master, which is the version of org I prefer to use. When I
posted my bug report, I thought that the issue might result form using the
git repo, but it seems to persist even when I remove the repo paths from
load-path and take out the custom :load-path command form my use-package
for org.
On initial invocation of use-package and also on load of every subsequent
org-mode file, I get this error:
File mode specification error: (error Autoloading file ... failed to define
function org)
It also happens whenever I try to use the agenda, which seems completely
broken now. That's the main reason I hope to track down this bug :-(
This happens regardless of whether I use the ELPA org-plus-contrib or set
:load-path to the location of the lisp and contrb/lisp folders in the git
repo and :pin to manual. I'm wondering if anyone on the list has had and
hopefully solved this problem!
Here's the beginning of my current use-package invocation:
(use-package org
:ensure org-plus-contrib
:functions org
:init
(setq org-export-backends '(ascii beamer html hugo icalendar md gfm
reveal latex odt org))
:hook
((org-mode . (lambda () (flyspell-mode 1)))
(org-mode . turn-off-auto-fill))
:mode "\\.org"
:bind
(("C-c l" . 'org-store-link)
("C-c a" . 'org-agenda))
:commands (org-mode org-capture org-agenda )
:config
;; Targets include this file and any file contributing to the agenda - up
to 5 levels deep
(setq org-refile-targets (quote ((org-agenda-files :maxlevel . 5) (nil
:maxlevel . 5)
;; ....
;; ... set lots of variable values & do some other stuff
;; ....
)
Thank you as always!