[Top][All Lists]

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

[Emacs-orgmode] Remember templates and time stamp rounding.

From: Carsten Dominik
Subject: [Emacs-orgmode] Remember templates and time stamp rounding.
Date: Fri, 17 Mar 2006 08:28:51 +0100

I have put a new test version of org.el onto my site, version 4.11a:


This contains only org.el, no further documentation.

In this test version, I have incorporates Alex' time rounding patch
(in a modified version).  Also there is support for templates for

Time-stamp rounding

The default is no rounding of time stamps.

I originally thought that every place in the code using times should
honor the rounding variable, but with some more thinking I now agree
with Alex that it is enough to do that in the few commands that
actually insert a time corresponding to the current time.  That means
that you can still modify times either by entering them at the
time/date prompt, or by using the S-cursor keys, and these
modifications will not be modified by the rounding setting.  One
change I added is that if you use a double C-u for a time stamp
command, then the default time is exact, not rounded.  In this way you
can use rounded times most of the time, but still get an exact time if
you need it.  Thanks to Alex for the patch (and also for the bug fix
in org-read-date, in the string-replacement...).

Remember templates

To activate the templates you need, in addition to the other remember
configuration, this line in .emacs:

    (add-hook 'remember-mode-hook 'org-remember-apply-template)

If you don't set any templates, then the only change you will notice
with the new code is that the remember buffer is now in org-mode, so
that you can use all the org-mode commands.  You need to exit with C-c
C-c.  Normally remember also allows C-x C-s, but this is not possible
anymore in my version, for technical reasons.

There is a new variable, org-remember-templates, which can be set to a
list of templates to use.  If you only specify a single template, it
will always be used.  If you specify several templates, then each time
you use remember you need to hit one additional character to select a
template.  That is why you need to specify a selection character for
each template.

In the template you can use several % escape sequences to insert
information like a time stamp, this annotation link to the original
file etc, please check the documentation string of
`org-remember-templates' for the full list.

Following the discussion here, I am providing 2 examples:

;; Template for Charles Cave's journal file.
(setq org-remember-templates
      '((?j . "* Topic: %T %?\n")))

;; Templates for Philip Rooke, journal and TODO with a deadline of today
(setq org-remember-templates
      '((?j . "* %U %?\n  %i\n\n  %a")
        (?t . "* TODO %?\n  DEADLINE: %T\n   %i\n\n   %a")))

I think this might be a flexible way to set things up.  Give it a try
and let us know what additional % escapes and/or other
changes you think would be useful.

- Carsten

Carsten Dominik
Sterrenkundig Instituut "Anton Pannekoek"
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477

reply via email to

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