spacemacs 使用org-mode 的 org-refile 不能用

Description org-refile does not work.

使用org-refile时 出现下面的信息
Getting targets…done
Copied: Subtree(s) with 22 characters
org-copy-subtree: Invalid function: org-preserve-local-variables

Expected behaviour: :heart::smile:
refile could be used

System Info :computer:

  • OS: darwin
  • Emacs: 25.3.1
  • Spacemacs: 0.200.13
  • Spacemacs branch: master (rev. c7a103a)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers: ‘‘‘elisp (markdown (ibuffer :variables ibuffer-group-buffers-by ’projects) (chinese :variables chinese-enable-youdao-dict t) auto-completion emacs-lisp (python :variables python-sort-imports-on-save t python-enable-yapf-format-on-save t) django org syntax-checking) ‘‘‘

my org config:

(with-eval-after-load 'org

  (setq org-agenda-files '("~/org/gtd/inbox.org"
                          "~/org/gtd/gtd.org"
                          "~/org/gtd/tickler.org"))

  (setq org-capture-templates '(("t" "Todo [inbox]" entry
                                (file+headline "~/org/gtd/inbox.org" "Tasks")
                                "* TODO %i%?")
                                ("T" "Tickler" entry
                                (file+headline "~/org/gtd/tickler.org" "Tickler")
                                "* %i%? \n %U")))


  (setq org-refile-targets
          '((nil :maxlevel . 3)
          (org-agenda-files :maxlevel . 3)))

  (setq org-refile-use-outline-path 'file)

  (setq org-outline-path-complete-in-steps nil)

  (setq org-todo-keywords '((sequence "TODO(t)" "WAITING(w)" "|" "DONE(d)" "CANCELLED(c)")))
  1. 在github上已经有了相关的Issue, #11788 #11801

  2. 解决方案如下:

cd ~/.emacs.d/elpa/
find org*/*.elc -print0 | xargs -0 rm

然后到spacemacs中执行spacemacs/recompile-elpa.

  1. 除了org-refile,org-archive-subtree也会同样报错,我试了一下上面的解决方案,可以解决我的问题了.
3赞

谢谢回复,我也解决了这个问题。

spacemacs中执行 spacemacs/recompile-elpa 的报错:

Leaving directory ‘/Users/wangkun/.emacs.d/elpa/develop/’

Compiling file /Users/wangkun/.emacs.d/elpa/develop/org-plus-contrib-20190805/ob-arduino.el at Thu Aug 22 12:16:59 2019
Entering directory ‘/Users/wangkun/.emacs.d/elpa/develop/org-plus-contrib-20190805/’
ob-arduino.el:36:1:Error: Cannot open load file: No such file or directory, arduino-mode

Compiling file /Users/wangkun/.emacs.d/elpa/develop/org-plus-contrib-20190805/ob-clojure-literate.el at Thu Aug 22 12:16:59 2019
ob-clojure-literate.el:23:1:Error: Cannot open load file: No such file or directory, cider

Compiling file /Users/wangkun/.emacs.d/elpa/develop/org-plus-contrib-20190805/ob-sclang.el at Thu Aug 22 12:16:59 2019
ob-sclang.el:63:1:Error: Cannot open load file: No such file or directory, sclang

这些个el mode 都是干嘛的。。还是有这个错误Invalid function: org-preserve-local-variables

cd ~/.emacs.d && git pull --rebase;

就好了:roll_eyes: