【发布时间】:2012-03-07 09:05:06
【问题描述】:
我希望始终在我的主目录的一个名为“notes”的特定子目录中调用 org-mode。现在在我的 .emacs 文件中有一行以不好的方式解决了这个问题:
(add-to-list 'auto-mode-alist '(".*/notes/.*" . org-mode))
这匹配任何 /notes/ 目录并调用 org-mode。但我不希望在每个恰好被称为“notes”的目录中都有 org-mode,而只是我的主目录中的那个。显而易见的答案不起作用:
(add-to-list 'auto-mode-alist '("~/notes/.*" .org-mode))
更复杂的版本比我的 elisp 技能水平略高:
(add-to-list 'auto-mode-alist '('(concat (expand-file-name "~/notes/") ".*") . org-mode))
上面给了我和错误信息说明:
File mode specification error: (wrong-type-argument stringp (quote (concat (expand-file-name "~/notes/") ".*")))
【问题讨论】: