all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Maus <dmaus@ictsoc.de>
To: Buck Brody <buckbrody@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: create new files from capture
Date: Mon, 04 Apr 2011 21:12:50 +0200	[thread overview]
Message-ID: <87pqp1q18t.wl%dmaus@ictsoc.de> (raw)
In-Reply-To: <1696133DB0E548409327158967872500@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1701 bytes --]

At Fri, 1 Apr 2011 13:43:06 -0400,
Buck Brody wrote:
> Is there a way to use capture to create new files?  Can I fill out
> the name of the file, and add a date stamp, from within the capture
> template?

Prompting in the templates happens after the template is placed in the
target buffer.  So AFAIK there is no way to achive this without a
little bit hacking: You could specify a target function

target       Specification of where the captured item should be placed.
             In Org-mode files, targets usually define a node.  Entries will
             become children of this node, other types will be added to the
             table or list in the body of this node.

             Most target specifications contain a file name.  If that file
             name is the empty string, it defaults to `org-default-notes-file'.
             A file can also be given as a variable, function, or Emacs Lisp
             form.

	     ...

             (function function-finding-location)
                Most general way, write your own function to find both
                file and location

That could read the target file name with a prompt.

> I also considered creating a new headline and then exporting the
> subtree.  The problem is that I need to have the title of the new
> file automatically created based upon the headline, and I can't
> figure out how to do this.

Same here. The function `org-heading-components' (C-h f
org-heading-components RET) will get you the title of the headline
which you would have to transform to a valid file name
(i.e. `replace-regexp-in-string').

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #2: Type: application/pgp-signature, Size: 230 bytes --]

  reply	other threads:[~2011-04-04 19:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 17:43 create new files from capture Buck Brody
2011-04-04 19:12 ` David Maus [this message]
2011-04-04 19:49   ` Matthew Sauer
2011-04-20 19:00   ` Bill Wishon
2011-04-20 19:22     ` Bill Wishon
2011-04-20 19:44       ` Nick Dokos

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=87pqp1q18t.wl%dmaus@ictsoc.de \
    --to=dmaus@ictsoc.de \
    --cc=buckbrody@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.