我是 Emacs 新手,完成了 Emacs 和基本的 org-mode 教程。现在我想安装 org-drill。以下是我在 Emacs 上安装 org-drill 的失败尝试。
来自http://orgmode.org/worg/org-contrib/org-drill.html
安装
最简单的方法是自定义变量“org-modules”(Mx customize-variables RET org-modules)并确保勾选“drill”。
我打开 spanish.org 文件并在 Emacs 中输入“Meta-x customize-variables”,回显区域显示:
M-x customize-variables [No match]
所以我尝试“Meta-x customize-variable”单数:
M-x customize-variable <RET> org-modules
自定义菜单对组织模块开放。因此,“Mx customize-variables”末尾的“s”是说明中的错字,或者我做错了。
在自定义菜单中,我选中“钻取”并单击“应用并保存”按钮。
退出并重新启动 Emacs。
打开 spanish.org 文件。
在 Emacs 中输入“Mx org-drill”,回显区显示:
M-x org-drill-table-
为什么没有“org-drill”?我输入:
M-x customize-variable <RET> org-modules
“钻头”仍处于选中状态。
所以我尝试了手动安装说明:
对于手动安装,请将以下内容放入您的 .emacs 中。您还需要确保 Org 的“contrib/lisp”目录位于 emacs 加载路径中。
(需要'org-drill)
我从http://orgmode.org/cgit.cgi/org-mode.git/tree/contrib/lisp/org-drill.el下载了 org-drill.el 并将其复制到 ~/emacsLoad/org-drill.el ,然后将这些行添加到我的 .emacs 文件中:
(add-to-list 'load-path "~/emacsLoad/")
(require 'org-drill)
重新启动 Emacs 和 *Warnings* 窗口显示:
Warning (initialization): An error occurred while loading `/home/wolfv/.emacs':
Symbol's function definition is void: copy-list
所以我用 `--debug-init' 选项启动 Emacs 来查看完整的错误回溯。*Backtrace* 窗口显示:
Debugger entered--Lisp error: (void-function copy-list)
copy-list((1 (quote org-drill-visible-cloze-face) nil))
org-drill--compute-cloze-keywords()
(defvar org-drill-cloze-keywords (org-drill--compute-cloze-keywords) nil)
require(org-drill)
eval-buffer(#<buffer *load*> nil "/home/wolfv/.emacs" nil t) ; Reading at buffer position 1727
load-with-code-conversion("/home/wolfv/.emacs" "/home/wolfv/.emacs" t t)
load("~/.emacs" t t)
#[0 "\205\262
这是什么意思?我不知道 Lisp。
我输入:
M-x customize-variable <RET> org-modules
“钻头”不再被选中。
我难住了。如何在 Emacs 上安装 Drill-org?
我在 buildvm-10.phx2.fedoraproject.org 上使用 2015 年 9 月 14 日的 GNU Emacs 24.5.1(x86_64-redhat-linux-gnu,GTK+ 版本 3.16.6)
这是我的 .emacs 文件:
;; load the built-in package manager
(require 'package)
;; add Emacs package repositories to the list of available repositories
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/"))
(add-to-list 'load-path "~/emacsLoad/")
;; disable automatic package loading
(setq package-enable-at-startup nil)
;; from http://stackoverflow.com/a/10095853/580206 > RNA
(defun ensure-package-installed (&rest packages)
"Assure every package is installed, ask for installation if it’s not.
Return a list of installed packages or nil for every skipped package."
(mapcar
(lambda (package)
(if (package-installed-p package)
nil
(if (y-or-n-p (format "Package %s is missing. Install it? " package))
(package-install package)
package)))
packages))
;; make sure to have downloaded archive description
(or (file-exists-p package-user-dir)
(package-refresh-contents))
;; load installed packages
(package-initialize)
;; make sure these packages are installed
(ensure-package-installed 'evil)
;;(ensure-package-installed 'evil 'org-drill)
;; load the package into memory and call the main mode function
(require 'evil)
(evil-mode t)
(require 'org-drill)
;;(org-drill t)
;; display cursor's (row,col) position in mode line
(setq column-number-mode t)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-modules
(quote
(org-bbdb org-bibtex org-docview org-gnus org-info org-irc org-mhe org-rmail org-w3m org-drill))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)