
我嘗試在 Windows XP 電腦上安裝 org-mode 7.5,但M-x org-info
顯示了 Emacs 23.3.1 附帶的 Org 版本 6.33x 的文檔
我下載了 zip 檔案並將其解壓縮到“~/.emacs.d/org-7.5/”:
c:/Documents and Settings/myusername/Application Data/.emacs.d/org-7.5:
total used in directory 16 available 279614668
drwxrwxrwx 1 myusername Domain Users 0 04-08 09:50 .
drwxrwxrwx 1 myusername Domain Users 0 04-08 09:58 ..
-rw-rw-rw- 1 myusername Domain Users 14168 03-07 13:29 Makefile
-rw-rw-rw- 1 myusername Domain Users 1051 03-07 13:29 README
drwxrwxrwx 1 myusername Domain Users 0 04-08 09:50 contrib
drwxrwxrwx 1 myusername Domain Users 0 04-08 09:50 doc
drwxrwxrwx 1 myusername Domain Users 0 04-08 10:10 lisp
-rw-rw-rw- 1 myusername Domain Users 1007 03-07 13:29 request-assign-future.txt
在第 1.2 節“安裝”的組織手冊說明說要編輯附帶的 Makefile,然後執行make
。作為 Windows 機器,這是行不通的。
C:\Documents and Settings\myusername\Application Data\.emacs.d\org-7.5>make
make
'make' is not recognized as an internal or external command,
operable program or batch file.
那麼是什麼將以下行添加到我的~/.emacs.d/init.el
文件中:
(setq load-path (cons "~/.emacs.d/org-7.5/lisp" load-path))
重新啟動 emacs,然後對 Org 7.5 lisp 目錄進行位元組編譯:
ELISP> (version)
"GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600)\n of 2011-03-10 on 3249CTO"
ELISP> load-path
("~/.emacs.d/org-7.5/lisp" "~/.emacs.d" <snip>)
ELISP> (byte-recompile-directory "~/.emacs.d/org-7.5/lisp/" 0 t)
"Done (Total of 99 files compiled)"
然後將以下行加入 init.el 中:
(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
(global-set-key "\C-col" 'org-store-link)
(global-set-key "\C-coc" 'org-capture)
(global-set-key "\C-coa" 'org-agenda)
(global-set-key "\C-cob" 'org-iswitchb)
(setq org-log-done t)
再次重啟emacs。現在 Org 7.5 已安裝:
ELISP> org-version
"7.5"
但執行的步驟不會建立或安裝資訊文件,因此當我使用時,M-x org-info
我會得到 Org 版本 7.5 而不是 6.33x 的手冊:
File: org, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)
Org Mode Manual
***************
This manual is for Org version 6.33x.
答案1
根據需要向 .emacs 或 .emacs.d/init.el 添加一行,其中包含 Org 7.5 附帶的文檔
Info-default-directory-list
:
; Find the Org documentation
(setq Info-default-directory-list
(cons "~/.emacs.d/org-7.5/doc/" Info-default-directory-list))
這確實導致了一個奇怪的現象,即當啟動資訊模式(例如使用M-x info
或C-h i
)時,Org 模式現在是選單中的第一行,位於主要 Emacs 幫助之前。
File: dir, Node: Top This is the top of the INFO tree
<snip>
* Menu:
Emacs
* Org Mode: (org). Outline-based notes management and organizer
* Info: (info). How to use the documentation browsing system.
* Emacs: (emacs). The extensible self-documenting text editor.
* Emacs FAQ: (efaq). Frequently Asked Questions about Emacs.
* <snip>
另外,我發現org-info
在 org-mode 至少使用一次之前不可用,我添加了以下行以使其始終可用:
(require 'org-info)
筆記:這InfoPath 上的 emacs wiki 條目建議使用INFOPATH
環境變數而不是Info-default-directory-list
在非 Windows 電腦上。