I’d like to always invoke org-mode in a particular sub-directory called “notes” of my home directory. Right now in my .emacs file there is a line which solves this problem in a bad way:
(add-to-list 'auto-mode-alist '(".*/notes/.*" . org-mode))
This matches any /notes/ directory and invokes org-mode. But I don’t want org-mode in every directory that happens to be called “notes” just the one in my home directory. The obvious answer doesn’t work:
(add-to-list ‘auto-mode-alist ‘(“~/notes/.*” . org-mode))
And more complicated versions are a bit above my elisp skill level:
(add-to-list 'auto-mode-alist '('(concat (expand-file-name "~/notes/") ".*") . org-mode))
The above gives me and error message stating:
File mode specification error: (wrong-type-argument stringp (quote (concat (expand-file-name "~/notes/") ".*")))
Try