2012-03-07 49 views
3

的子目录我希望始终在我的主目录的“笔记”的特定子目录中调用组织模式。现在在我的.emacs文件存在是一个坏的方式解决了这个问题行:auto-mode-alist其中指定了〜

(add-to-list 'auto-mode-alist '(".*/notes/.*" . org-mode)) 

这个匹配/笔记/目录,并调用组织模式。但我不想在每个发生在我的主目录中的名为“notes”的目录中使用org-mode。答案显然不起作用:

(添加到列表“自动模式ALIST”(‘〜/笔记/.*’组织模式))

,更复杂的版本是一个位以上我的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/") ".*"))) 

回答

6

尝试

(add-to-list 'auto-mode-alist `(,(expand-file-name "~/notes/") . org-mode)) 
+0

是否有这个诀窍,我猜我需要查看什么,并在elisp中做。谢谢! – speciousfool 2012-03-07 09:39:40

+1

'M-:(info“(elisp)Backquote”)' – phils 2012-03-07 10:31:35

相关问题