From mboxrd@z Thu Jan 1 00:00:00 1970 From: peder@news.klingenberg.no (Peder O. Klingenberg) Subject: New %-escape for remember-templates Date: Tue, 30 Jan 2007 11:51:45 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HBqid-00083i-SY for emacs-orgmode@gnu.org; Tue, 30 Jan 2007 06:00:07 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HBqic-00082d-N4 for emacs-orgmode@gnu.org; Tue, 30 Jan 2007 06:00:07 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HBqic-00082N-Cm for emacs-orgmode@gnu.org; Tue, 30 Jan 2007 06:00:06 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HBqib-0002G0-R2 for emacs-orgmode@gnu.org; Tue, 30 Jan 2007 06:00:06 -0500 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1HBqiZ-0007db-1V for emacs-orgmode@gnu.org; Tue, 30 Jan 2007 12:00:03 +0100 Received: from beto.netfonds.no ([80.91.225.74]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jan 2007 12:00:03 +0100 Received: from peder by beto.netfonds.no with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 30 Jan 2007 12:00:03 +0100 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi. 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 In case others find it useful, here's a patch. My org.el is version 4.50. --- 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")) (save-match-data (let* ((lead (buffer-substring ...Peder... -- I wish a new life awaited _me_ in some off-world colony.