如何在Mac上编译org-mode?

最近尝试从spacemacs转到自己写init.el,用submodule管理包。添加org-mode时遇到了一些问题。

org-mode看README需要编译后使用,make doc的时候报错:

/Library/Developer/CommandLineTools/usr/bin/make -C doc info
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
fatal: No names found, cannot describe anything.
makeinfo --no-split org.texi -o org
org.texi:6: warning: unrecognized encoding name `UTF-8'.
org.texi:833: Unknown command `arrow'.
org.texi:833: Misplaced {.
org.texi:833: Misplaced }.
org.texi:833: Unknown command `arrow'.
org.texi:833: Misplaced {.
org.texi:833: Misplaced }.
org.texi:844: Unknown command `arrow'.
org.texi:844: Misplaced {.
org.texi:844: Misplaced }.
org.texi:2646: Unknown command `arrow'.
org.texi:2646: Misplaced {.
org.texi:2646: Misplaced }.
org.texi:2648: Unknown command `arrow'.
org.texi:2648: Misplaced {.
org.texi:2648: Misplaced }.
org.texi:3534: Unknown command `arrow'.
org.texi:3534: Misplaced {.
org.texi:3534: Misplaced }.
org.texi:3534: Unknown command `arrow'.
org.texi:3534: Misplaced {.
org.texi:3534: Misplaced }.
makeinfo: Removing output file `org' due to errors; use --force to preserve.
make[1]: *** [org] Error 1
make: *** [info] Error 2

看了下https://orgmode.org/worg/dev/org-build-system.html,需要的组件应该都装了,不太确定版本有没有问题。不知道有没有大佬在mac上编译过org-mode,遇到过同样的问题。

另外我直接把org-mode下的lisp文件夹加到load-path里了,然后(require 'org-mode),但是看describe-package,用的还是内置的org-mode。正确替代内置的org-mode的方法是什么呢?

macOS 自带的 texinfo 太老了,连 Unicode 都不支持,要装新版本的

你 org 相关的配置在 package.el 完成启动之前执行了就会这样。要是搞不定直接把自带的删了也行

1 个赞

应该是你的 org 的 load-path 在内置的 path 后面。

add-to-list 添加的会放到 load-path 头部,手动管理如果用 normal-top-level-add-subdirs-to-load-path 会放到尾部。

可以看一下 load-path 的值是怎样的。

1 个赞

确实。刚看了一下,brew装的最新的包,被mac自带的shallow了,自带的还是2004年的 :sweat_smile:

init.el开始就调了package-initialize,好像也没用。完全把package.el相关注释掉也不行,难道真的只能全部删掉了。。

(“~/.emacs.d/packages/transient.el/lisp” “~/.emacs.d/packages/magit/lisp” “~/.emacs.d/packages/org-mode/contrib” “~/.emacs.d/packages/org-mode/lisp” “~/.emacs.d/packages/with-editor” “~/.emacs.d/packages/undo-fu” “~/.emacs.d/packages/transient.el” “~/.emacs.d/packages/swiper” “~/.emacs.d/packages/smex” “~/.emacs.d/packages/shrink-path.el” “~/.emacs.d/packages/s.el” “~/.emacs.d/packages/posframe” “~/.emacs.d/packages/org-roam” “~/.emacs.d/packages/org-mode” “~/.emacs.d/packages/org-download” “~/.emacs.d/packages/magit” “~/.emacs.d/packages/ivy-posframe” “~/.emacs.d/packages/f.el” “~/.emacs.d/packages/exec-path-from-shell” “~/.emacs.d/packages/evil-leader” “~/.emacs.d/packages/evil-escape” “~/.emacs.d/packages/evil-collection” “~/.emacs.d/packages/evil” “~/.emacs.d/packages/emacsql-sqlite3” “~/.emacs.d/packages/emacsql” “~/.emacs.d/packages/emacs-which-key” “~/.emacs.d/packages/emacs-memoize” “~/.emacs.d/packages/emacs-doom-themes” “~/.emacs.d/packages/emacs-async” “~/.emacs.d/packages/doom-modeline” “~/.emacs.d/packages/dash.el” “~/.emacs.d/packages/company-mode” “~/.emacs.d/packages/annalist.el” “~/.emacs.d/packages/all-the-icons.el” “/Users/ruibin/.emacs.d/elpa/org-plus-contrib-20201123” “/usr/local/share/emacs/site-lisp” “/usr/local/share/emacs/site-lisp/autoconf” “/usr/local/share/emacs/site-lisp/gettext” “/usr/local/share/emacs/site-lisp/git” “/usr/local/share/emacs/site-lisp/mu” “/usr/local/share/emacs/site-lisp/mu/mu4e” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/vc” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/url” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/textmodes” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/progmodes” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/play” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/org” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/nxml” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/net” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/mh-e” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/mail” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/leim” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/language” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/international” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/image” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/gnus” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/eshell” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/erc” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/emulation” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/emacs-lisp” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/cedet” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/calendar” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/calc” “/usr/local/Cellar/emacs-plus@27/27.1/share/emacs/27.1/lisp/obsolete”)

load-path如下,看起来是没什么问题。

破案了,describe-package不准确,describe-function看了一下org,确实是从我自己的包里load的。。