Doom-emacs: When refiling: Invalid function: org-preserve-local-variables

Created on 14 Jan 2019  路  9Comments  路  Source: hlissner/doom-emacs

Observed behavior

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

Expected behavior

Running org-refile should refile the subtree

Steps to reproduce

  1. With point on a heading, run C-c C-w (org-refile)
  2. Error "Invalid function: org-preserve-local-variables" is displayed in minibuffer and the subtree remains unmoved.

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.

System information


Click to expand

  • OS: darwin (x86_64-apple-darwin14.5.0)
  • Emacs: 26.1 (May 30, 2018)
  • Doom: 2.0.9 (develop 4b2dbe42a5a472d5836293727eebc672b54e5f1a)
  • Graphic display: t (daemon: nil)
  • System features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS
  • Details:
    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/)

:lang org bug packages resolved

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

All 9 comments

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

  • OS: Ubuntu (18.10)
  • Emacs 25.2.2
  • Org 9.2 20181230

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 :plugins to 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:

  1. Run doom build to recompile all your packages' byte-code. This seems to have fixed it for most folks.
  2. Failing that, it's possible you are manually loading 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.
  3. If you have no time to debug and just want a quick solution, delete all ~/.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:

  1. Run doom build to recompile all your packages' byte-code. This seems to have fixed it for most folks.
  2. Failing that, it's possible you are manually loading 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.
  3. If you have no time to debug and just want a quick solution, delete all ~/.emacs.d/.local/straight/build/org-mode/*.elc files 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.

Was this page helpful?
4 / 5 - 1 ratings

Related issues

laishulu picture laishulu  路  3Comments

benjaminbauer picture benjaminbauer  路  3Comments

luisenrike picture luisenrike  路  3Comments

idoo picture idoo  路  3Comments

pieterdd picture pieterdd  路  3Comments