emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Spiers <orgmode@adamspiers.org>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: inserting files within remember templates
Date: Tue, 6 Nov 2007 16:36:47 +0000	[thread overview]
Message-ID: <20071106163647.GC13544@atlantic.linksys.moosehall> (raw)
In-Reply-To: <8A730AEC-45F4-4A2F-BD38-24DEBF937445@science.uva.nl>

On Tue, Nov 06, 2007 at 06:41:36AM +0100, Carsten Dominik wrote:
> Setting up remember mode runs a remember-mode-hook, you can use that.

That could be a workaround.

> I would be interested to know what kind of applications you have in mind
> when you want to include a file into a template, or execute elisp code.
> How about a few examples to persuade us that this is needed?

I want to integrate my use of mutt with org-mairix.el and remember.el.
Because mutt is an external application, I need some way of getting a
Message-Id which has been extracted from a message via a mutt helper
back into emacs.  Currently I do this by coding the helper to dump the
Message-Id into ~/.clip-mairix, and then the elisp code inserts the
contents of this file back into the org buffer.  However I would like
it to be inserted via a remember template, hence the request.  Calling
remember via emacsclient might possibly be an alternate way of
achieving the same thing, but I haven't thought about this yet.  If
one were to embed the text being passed from the mutt helper in the
CLI arguments to emacsclient, quoting might end up getting quite
hairy.  Allowing the remember template to extract the message id from
the environment via getenv might be a cleaner solution in that case.

That was the main use case, but I am sure people could think of
others.  Here is another one which is a bit silly but demonstrates the
point (and would be more conveniently invoked from within emacs than
via emacsclient): I have just started maintaining a journal of my
laptop's battery life to see whether it can be extended much by doing
full discharges more regularly.  So every day or two I want to log the
output of commands like:

  grep 'last full' /proc/acpi/battery/BAT0/info

This could easily be accomplished if remember templates allowed syntax
such as

,------
| * %T
| %(shell-command-to-string "grep 'last full' /proc/acpi/battery/BAT0/info")
`------

  reply	other threads:[~2007-11-06 16:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-05 18:17 inserting files within remember templates Adam Spiers
2007-11-05 18:27 ` Eddward DeVilla
2007-11-06  5:41 ` Carsten Dominik
2007-11-06 16:36   ` Adam Spiers [this message]
2007-11-06 22:39     ` Adam Spiers
2007-11-07  2:47       ` Bastien
2007-11-07  8:43         ` Carsten Dominik
2007-11-07  8:42       ` Carsten Dominik
2007-11-24 14:52         ` Adam Spiers
2007-11-24 16:57           ` Carsten Dominik
2007-12-09 12:19           ` Adam Spiers
2007-11-07  2:37     ` Bastien
2007-11-07  9:58       ` Adam Spiers
2007-11-07 12:46         ` Bastien
2007-11-07 12:50           ` Adam Spiers
2007-11-07 14:39             ` Bastien
2007-11-07 14:36               ` Adam Spiers
2007-11-08  4:03                 ` Bastien
  -- strict thread matches above, loose matches on Subject: below --
2007-10-13 14:52 Using org-remember to include stored link? Georg C. F. Greve
2007-10-14  2:33 ` Bastien
2007-10-14  5:11   ` Georg C. F. Greve
2007-10-14  6:14 ` Carsten Dominik
2007-10-14 12:05   ` Georg C. F. Greve
2007-10-14 14:03     ` Bastien
2007-10-14 13:48       ` Georg C. F. Greve
2007-10-14 15:33     ` Carsten Dominik
2007-11-08 11:32       ` Georg C. F. Greve
2007-11-08 13:09         ` Bastien
2007-12-08 20:08           ` inserting files within remember templates Adam Spiers

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=20071106163647.GC13544@atlantic.linksys.moosehall \
    --to=orgmode@adamspiers.org \
    --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 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).