When attempting to use org-refile the operation fails and I'm shown this error:
Invalid function: org-preserve-local-variables
Buffer has been modified; could not load undo-tree history
Getting targets...
uncompressing .!Users!jbaty!Dropbox!org!timesheet.org.~undo-tree~.gz...done
uncompressing .!Users!jbaty!Dropbox!org!tickler.org.~undo-tree~.gz...done
Getting targets...done
Copied: Subtree(s) with 531 characters
org-copy-subtree: Invalid function: org-preserve-local-variables
Running org-refile should refile the subtree
C-c C-w (org-refile)This feels like a package issue but I've run doom refresh, recompile, etc. with no effect. The only thing similar I could find was a Spacemacs error that looks to have been fixed by recompiling.
Click to expand
elisp
elc count: 29
uname -a: Darwin Jacks-iMac.localdomain 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64 x86_64
modules: (:feature eval (evil +everywhere) file-templates (lookup +docsets) snippets spellcheck syntax-checker workspaces :completion company helm :ui doom doom-dashboard doom-modeline doom-quit evil-goggles hl-todo nav-flash treemacs (popup +all +defaults) vc-gutter vi-tilde-fringe window-select :editor multiple-cursors rotate-text :emacs dired ediff electric hideshow imenu term vc :tools macos magit :lang data emacs-lisp markdown (org +attach +babel +capture +export +present) (sh +fish) :config default)
packages: (org-journal)
exec-path: (~/bin/ /Library/TeX/texbin/ /usr/local/bin/ /usr/local/sbin/ /bin/ /usr/local/git/bin/ /usr/bin/ /usr/sbin/ /sbin/ /Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_10/ /Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_10/ /Applications/Emacs.app/Contents/MacOS/libexec/)
I'm encountering exactly the same error message when using org-refile. I've tried stripping my init.el back literally to nothing, and it still occurs, although when launching with emacs --no-init it works fine.
System information
Addendum
Downgrading to the Debian repository version of org (9.1.14) rather than elpa's 9.2 and org-refile works fine with my regular init.el, so it would seem to be a problem relating to org 9.2. No it actually doesn't! :(
@jackbaty Try to remove all the .elc file from org folder in .emacs.d/elpa. It worked for me. You can find more infos in here: https://github.com/syl20bnr/spacemacs/issues/11801
You could also try running ~/.emacs.d/bin/doom compile :plugins to recompile all your packages, including org.
You could also try running
~/.emacs.d/bin/doom compile :pluginsto recompile all your packages, including org.
This worked for me. I just switched from spacemacs and had the same issue there.
Recompiling worked, thanks. Could have sworn I tried that but seems not. Refiling is working great, now.
I encountered this same problem after updating (and upgrading) today. I tried all the methods above, doesn't work. I even reinstalled doom emacs, the issue is still there.
The old instructions are obsolete now, so I'll compile the solutions into a new post:
doom build to recompile all your packages' byte-code. This seems to have fixed it for most folks.org too early (likely in your ~/.doom.d/init.el. Loading org that early means you're loading the wrong version of org. Remove any use-package or require calls in your init.el.~/.emacs.d/.local/straight/build/org-mode/*.elc files as a temporary measure.Hope that helps!
The old instructions are obsolete now, so I'll compile the solutions into a new post:
- Run
doom buildto recompile all your packages' byte-code. This seems to have fixed it for most folks.- Failing that, it's possible you are manually loading
orgtoo early (likely in your~/.doom.d/init.el. Loading org that early means you're loading the wrong version of org. Remove anyuse-packageorrequirecalls in your init.el.- If you have no time to debug and just want a quick solution, delete all
~/.emacs.d/.local/straight/build/org-mode/*.elcfiles as a temporary measure.Hope that helps!
In my case, none of the three steps helped. The refile stopped working after I upgraded doom to Doom v2.0.9 (HEAD -> develop 1c99aed0c 2020-08-25 21:22:56 -0400). Unfortunately, I cannot remember which version of Doom I was using before.
Just had the same problem after upgrade. Step 3 worked for me.
Most helpful comment
@jackbaty Try to remove all the .elc file from org folder in .emacs.d/elpa. It worked for me. You can find more infos in here: https://github.com/syl20bnr/spacemacs/issues/11801