qhwhc
1
org-mode管理配置时,在init.el前加如下代码:
(package-initialize)
(require 'org-install)
(require 'ob-tangle)
(org-babel-load-file (expand-file-name "xxx.org" user-emacs-directory))
报下列错(去掉上图最后一行代码就可以运行…):
Warning (initialization): An error occurred while loading ‘c:/Users/Administrator/AppData/Roaming/.emacs.d/init.el’:
Wrong type argument: stringp, nil
emacs版本26.1
1 个赞
cireu
9
emacs --debug-init
启动,把出错信息和调用栈也发上来
qhwhc
10
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
expand-file-name(nil)
load-file(nil)
org-babel-load-file("c:/Users/Administrator/AppData/Roaming/.emacs.d/lisp/custom.el")
eval-buffer(#<buffer *load*> nil "c:/Users/Administrator/AppData/Roaming/.emacs.d/init.el" nil t) ; Reading at buffer position 144
load-with-code-conversion("c:/Users/Administrator/AppData/Roaming/.emacs.d/init.el" "c:/Users/Administrator/AppData/Roaming/.emacs.d/init.el" t t)
load("c:/Users/Administrator/AppData/Roaming/.emacs.d/init" t t)
#f(compiled-function () #<bytecode 0x1000be22d>)()
command-line()
normal-top-level()
cireu
11
我没看懂你配置啊,你抄的是别人用org管理的配置的方法,你自己的配置怎么一个org文件也没有啊。
你先试一下把org-babel-load那行注释了,重启emacs看看
qhwhc
12
找到原因了…引入的org文件必须有如下代码,加上就OK了(为了测试能不能引入就没写上…)
#+BEGIN_SRC emacs-lisp
#+END_SRC
@cireu 麻烦大佬了