[Top][All Lists]

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

Re: [Orgmode] New %-escape for remember-templates

From: Carsten Dominik
Subject: Re: [Orgmode] New %-escape for remember-templates
Date: Wed, 31 Jan 2007 19:35:50 +0100

On Jan 30, 2007, at 11:51, Peder O. Klingenberg wrote:


I frequently want to stuff the subject of an email into a heading and
have a link to the mail in the text.  For this, I use remember
templates.  However, none of the standard templates to quite what I
wish.  I want to edit as little as possible when remembering things,
so I made a new %-escape: %s

I can see how this can be useful, so I will add a generalized version
of your patch to the next version.


- Carsten

In case others find it useful, here's a patch.  My org.el is version

--- org.el.~1.1.~       2006-09-25 10:43:26.000000000 +0200
+++ org.el      2007-01-30 11:47:53.000000000 +0100
@@ -1212,6 +1212,7 @@
   %a  annotation, normally the link created with org-store-link
   %i  initial content, the region when remember is called with C-u.
If %i is indented, the entire inserted text will be indented as well. + %s If the annotation is a link to an email, the subject of that email.
   %?  This will be removed, and the cursor placed at this position."
   :group 'org-remember
   :type '(repeat :tag "enabled"
@@ -10817,10 +10818,11 @@
             (v-a annotation)   ; defined in `remember-mode'
             (v-i initial)      ; defined in `remember-mode'
             (v-n user-full-name)
-            )
+            (v-s (progn (string-match "on: \\([^]]*\\)" annotation)
+                        (match-string 1 annotation))))
        (unless tpl (setq tpl "")       (message "No template") (ding))
        (insert tpl) (goto-char (point-min))
-       (while (re-search-forward "%\\([tTuTai]\\)" nil t)
+       (while (re-search-forward "%\\([tTuUais]\\)" nil t)
          (when (and initial (equal (match-string 0) "%i"))
              (let* ((lead (buffer-substring

I wish a new life awaited _me_ in some off-world colony.

Emacs-orgmode mailing list

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]