all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* New %-escape for remember-templates
@ 2007-01-30 10:51 Peder O. Klingenberg
  2007-01-30 15:15 ` J. David Boyd
  2007-01-31 18:35 ` Carsten Dominik
  0 siblings, 2 replies; 7+ messages in thread
From: Peder O. Klingenberg @ 2007-01-30 10:51 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: New %-escape for remember-templates
  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-31 18:35 ` Carsten Dominik
  1 sibling, 1 reply; 7+ messages in thread
From: J. David Boyd @ 2007-01-30 15:15 UTC (permalink / raw)
  To: emacs-orgmode

peder@news.klingenberg.no (Peder O. Klingenberg) writes:

> 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.
>

Wow!  4.50?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: New %-escape for remember-templates
  2007-01-30 15:15 ` J. David Boyd
@ 2007-01-30 18:28   ` Peder O. Klingenberg
  2007-01-30 20:43     ` J. David Boyd
  0 siblings, 1 reply; 7+ messages in thread
From: Peder O. Klingenberg @ 2007-01-30 18:28 UTC (permalink / raw)
  To: emacs-orgmode

david@adboyd.com (J. David Boyd) writes:

> Wow!  4.50?

Yes, why?

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: New %-escape for remember-templates
  2007-01-30 18:28   ` Peder O. Klingenberg
@ 2007-01-30 20:43     ` J. David Boyd
  2007-01-30 22:19       ` Peder O. Klingenberg
  0 siblings, 1 reply; 7+ messages in thread
From: J. David Boyd @ 2007-01-30 20:43 UTC (permalink / raw)
  To: emacs-orgmode

peder@news.klingenberg.no (Peder O. Klingenberg) writes:

> david@adboyd.com (J. David Boyd) writes:
>
>> Wow!  4.50?
>
> Yes, why?
>

Because I've noticed that the people that use org-mode tend to keep the latest
version on hand.  The latest is version is 4.63.  I was just really surprised
that you were back so far...

Dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: New %-escape for remember-templates
  2007-01-30 20:43     ` J. David Boyd
@ 2007-01-30 22:19       ` Peder O. Klingenberg
  2007-01-31 11:28         ` J. David Boyd
  0 siblings, 1 reply; 7+ messages in thread
From: Peder O. Klingenberg @ 2007-01-30 22:19 UTC (permalink / raw)
  To: emacs-orgmode

david@adboyd.com (J. David Boyd) writes:

> Because I've noticed that the people that use org-mode tend to keep the latest
> version on hand.  The latest is version is 4.63.  I was just really surprised
> that you were back so far...

I don't follow the development of org-mode, so I wasn't aware there
was a new version available until scanned the mailinglist archive just
prior to posting the patch.  I'll have a look at the changelog and
consider upgrading when time permits, but round tuits are in short
supply. :)

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: New %-escape for remember-templates
  2007-01-30 22:19       ` Peder O. Klingenberg
@ 2007-01-31 11:28         ` J. David Boyd
  0 siblings, 0 replies; 7+ messages in thread
From: J. David Boyd @ 2007-01-31 11:28 UTC (permalink / raw)
  To: emacs-orgmode

peder@news.klingenberg.no (Peder O. Klingenberg) writes:

> david@adboyd.com (J. David Boyd) writes:
>
>> Because I've noticed that the people that use org-mode tend to keep the
>> latest version on hand.  The latest is version is 4.63.  I was just really
>> surprised that you were back so far...
>
> I don't follow the development of org-mode, so I wasn't aware there
> was a new version available until scanned the mailinglist archive just
> prior to posting the patch.  I'll have a look at the changelog and
> consider upgrading when time permits, but round tuits are in short
> supply. :)
>

Oh, I understand completely.  To explain more completely, so I don't sound
like a jerk (oops, too late), I was thinking, at the time, the people that
make patches are the 'cutting edge' people, and _always_ have the latest
version.  Of course, in retrospect, that can't be true, but that _is_ how I
was thinking.

Anyway, have a great day, and I look forward to your updated patches...

Dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: New %-escape for remember-templates
  2007-01-30 10:51 New %-escape for remember-templates Peder O. Klingenberg
  2007-01-30 15:15 ` J. David Boyd
@ 2007-01-31 18:35 ` Carsten Dominik
  1 sibling, 0 replies; 7+ messages in thread
From: Carsten Dominik @ 2007-01-31 18:35 UTC (permalink / raw)
  To: Peder O. Klingenberg; +Cc: emacs-orgmode


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-01-31 22:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.