emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Best way to implement project specific captures
@ 2012-08-22  3:00 Richard Riley
  2012-08-22 11:48 ` Sylvain Rousseau
  0 siblings, 1 reply; 20+ messages in thread
From: Richard Riley @ 2012-08-22  3:00 UTC (permalink / raw)
  To: emacs-orgmode


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.
 

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2012-08-26  6:18 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-22  3:00 Best way to implement project specific captures Richard Riley
2012-08-22 11:48 ` Sylvain Rousseau
2012-08-22 14:37   ` Bastien
2012-08-22 14:38     ` Bastien
2012-08-22 18:04       ` Sylvain Rousseau
2012-08-23  9:13         ` Bastien
2012-08-23 10:36           ` Carsten Dominik
2012-08-23 11:09             ` Jambunathan K
2012-08-23 15:08             ` Bastien
2012-08-23 17:16             ` Sylvain Rousseau
2012-08-22 21:12   ` Richard Riley
2012-08-22 22:04   ` Richard Riley
2012-08-22 22:54     ` Richard Riley
2012-08-23  8:52       ` Sylvain Rousseau
2012-08-23 17:52         ` Richard Riley
2012-08-24 12:25           ` Bastien
2012-08-24 19:38             ` Richard Riley
2012-08-24 20:00               ` Bastien
2012-08-24 20:01               ` Bastien
2012-08-26  6:18                 ` Richard Riley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).