Currently I maintain a datetree journal capture using a template so ,---- | ("j" "journal" entry (file+datetree "journal.org") | "* %?\n\t:PROPERTIES:\n\t:DateCreated: %T\n\t:Link: %a\n\t:END:\n") `----
I also use j rockways' eproject set up that allows a hook to be run when a file is opened inside a "project". e.g ,---- | (add-hook 'web-project-file-visit-hook '(lambda () | (ignore-errors | (message "Web Project : %s" eproject-root) | ))) `---- where "web-project" is created this:- ,---- | (define-project-type web (generic) | (look-for "plan.org") | :relevant-files ("\\.php$" "\\.js$" "\\.org$" "\\.sql$" "\\.css$" "authinfo" "vhost")) `---- So whenever I open a file in a directory hierarchy which contains a plan.org matching those types then my web-project-file-visit-hook is run. What is the best emacs/elisp approach to setting a capture file destination specific to a particular project? THe main point being that the default capture template above should only be replaced if I am actually in a "project" : any capture done in a file NOT contained within a project should default to the capture template above. Is it someting to do with buffer-locals perhaps or is there a better/alternative way? e.g Perhaps "journal.org" becomes a variable and this is overwritten (or whatever the elisp jargon is) in the project hook as a buffer local? Hope was clear! regards r.