emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] inserting files within remember templates


From: Adam Spiers
Subject: Re: [Orgmode] inserting files within remember templates
Date: Tue, 6 Nov 2007 16:36:47 +0000
User-agent: Mutt/1.5.14 (2007-02-12)

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 via email to

[Prev in Thread] Current Thread [Next in Thread]