all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Riley <rileyrg@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Best way to implement project specific captures
Date: Wed, 22 Aug 2012 04:00:17 +0100	[thread overview]
Message-ID: <ollih7hbr2.fsf@news.eternal-september.org> (raw)


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.
 

             reply	other threads:[~2012-08-22  3:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-22  3:00 Richard Riley [this message]
2012-08-22 11:48 ` Best way to implement project specific captures 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ollih7hbr2.fsf@news.eternal-september.org \
    --to=rileyrg@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.