emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@science.uva.nl>
To: "Peder O. Klingenberg" <peder@news.klingenberg.no>
Cc: emacs-orgmode@gnu.org
Subject: Re: New %-escape for remember-templates
Date: Wed, 31 Jan 2007 19:35:50 +0100	[thread overview]
Message-ID: <d554a670ae239b2ea41aa96b1e583b5f@science.uva.nl> (raw)
In-Reply-To: <ksveiowzwe.fsf@beto.netfonds.no>


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

> 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

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

Thanks.

- Carsten


>
> 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.
>
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

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

      parent reply	other threads:[~2007-01-31 22:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-30 10:51 New %-escape for remember-templates Peder O. Klingenberg
2007-01-30 15:15 ` J. David Boyd
2007-01-30 18:28   ` Peder O. Klingenberg
2007-01-30 20:43     ` J. David Boyd
2007-01-30 22:19       ` Peder O. Klingenberg
2007-01-31 11:28         ` J. David Boyd
2007-01-31 18:35 ` Carsten Dominik [this message]

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=d554a670ae239b2ea41aa96b1e583b5f@science.uva.nl \
    --to=dominik@science.uva.nl \
    --cc=emacs-orgmode@gnu.org \
    --cc=peder@news.klingenberg.no \
    /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).