This issue really has me scratching my head:
I have swtiched to using straight.el because org-mode was complaining about switching repos and I really enjoy the flexibility if offers in selecting pacakages from sources such as Github. Recently, however, I have noticed that when I load any file .org file I get the following message:
```
File mode specification error: (error Autoloading file /home/thomas/.emacs.d/straight/build/org/org.elc failed to define function org)
```
This error occurs every time an org file is loaded. I have found I can suppress the error by simply commenting out the line ``(org-agenda-files `("~/Dropbox/gtd"))`` in my init.el file.
This works well, however, my favorite feature of org-mode is the agenda and this essentially breaks that feature. I cannot for the life of me figure out why setting this variable raises this error.
Below is the full configuration I use for org-mode with straight.el and use-package in my init.el file. I included the whole thing in case there is some conflict with how the variables are loaded.
```
(use-package org
:straight (org :host github
:repo "emacs-straight/org-mode"
:branch "main")
:mode ("\\.org\\'" . org-mode)
:bind
("C-c c" . org-capture)
("C-c a" . org-agenda)
("C-c l" . org-store-link)
:hook
(org-mode . #'turn-on-flyspell)
(org-mode . #'toggle-truncate-lines)
:custom
(org-directory "~/Dropbox/gtd")
(org-agenda-start-on-weekday nil)
(org-agenda-files `("~/Dropbox/gtd"))
(org-default-notes-file (concat org-directory "/inbox.org"))
(org-refile-targets '((org-agenda-files :maxlevel . 3)))
(org-refile-use-outline-path 'file)
(org-outline-path-complete-in-steps nil)
(org-refile-allow-creating-parent-nodes (quote confirm))
(org-log-into-drawer t)
(org-todo-keywords
'((sequence "TODO(t)"
"WAITING(w)"
"|" "DONE(d)"
"CANCELLED(c)")))
(org-tags-exclude-from-inheritance '("project"))
(org-stuck-projects
'("+project/-MAYBE-DONE"
("NEXT" "TODO")
nil
"\\<IGNORE\\>"))
(org-latex-pdf-process
'("pdflatex -interaction nonstopmode -output-directory %o %f"
"biber %b"
"pdflatex -interaction nonstopmode -output-directory %o %f"
"pdflatex -interaction nonstopmode -output-directory %o %f"))
(org-tags-column 0)
(org-startup-indented t)
(org-src-tab-acts-natively t)
(org-todo-keyword-faces
'(("TODO" . org-warning)
("WAITING" . "yellow")
("CANCELED" . (:foreground "blue" :weight bold))
("DONE" . org-done)))
(org-plantuml-jar-path (expand-file-name "~/.emacs.d/plantuml/plantuml.jar"))
:config
(add-to-list 'org-src-lang-modes '("plantuml" . plantuml))
(org-babel-do-load-languages 'org-babel-load-languages
'((awk . t)
(calc . t)
(css . t)
(emacs-lisp . t)
(eshell . t)
(gnuplot . t)
(dot . t)
(latex . t)
(ledger . t)
(octave . t)
(plantuml . t)
(R . t)
(sed . t)
(shell . t))))
```
Another issue that I have noticed that my init.org no longer tangles to init.el on saving automatically.but only works when called directly with org-babel-tangle. A minor inconvenience.
I thought that changing straight to use the built-in org-mode might fix this error but that had no effect either.
Any ideas?