emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* capture template for .ics invitation in vm
@ 2015-12-18 21:24 prayner
  2016-01-05  9:01 ` Eric S Fraga
  0 siblings, 1 reply; 2+ messages in thread
From: prayner @ 2015-12-18 21:24 UTC (permalink / raw)
  To: emacs-orgmode

In reality probably an embarrassing emacs-lisp error on my part.

I'm trying to make a capture template for turning the very frequent
invitations I get in .ics format (I think) into org agenda items.
The basis is the ical2org awk script maintained by Eric Fraga.
My template is defined as follows:
("i" "invite" entry (file+headline "~/.org/todo.org" "Tasks")
	 "* TODO %(org-capture-vm-invite)\n" :immediate-finish t)

And org-capture-vm-invite is defined as

(defun org-capture-vm-invite ()
  (interactive)
  (with-temp-buffer
    (insert-buffer (org-capture-get :original-buffer 1))
    (shell-command-on-region (point-min) (point-max) "ical2org" nil t)
    (buffer-substring-no-properties (point-min) (point-max))))

A problem seems to be the line
    (insert-buffer (org-capture-get :original-buffer 1))
since :original-buffer doesn't seem to be defined in
org-capture-plist. I've verified that by printing it.
It's likely I'm going about this completely the wrong way so does
anyone have the right way to get information from the buffer where
capture was called during an embedded sexp?
Please reply directly as well as to the list since I'm a loong way
behind on reading.
Thanks in advance
Peter


-- 
Peter Rayner
Leader, Clean Air and Urban Landscapes NESP hub <http://www.nespurban.edu.au>
room 343 
School of Earth Sciences, University of Melbourne, 3010, Vic, Australia
tel: work: +61 (0)3 8344 9708; fax: +61 (0)3 8344 7761 
mobile +61 402 752 379, skype: petermorag 
mail-to: prayner@unimelb.edu.au TWITTER: @raynerstrings
google scholar profile <http://scholar.google.com.au/citations?user=H3up71wAAAAJ&hl=en>

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

* Re: capture template for .ics invitation in vm
  2015-12-18 21:24 capture template for .ics invitation in vm prayner
@ 2016-01-05  9:01 ` Eric S Fraga
  0 siblings, 0 replies; 2+ messages in thread
From: Eric S Fraga @ 2016-01-05  9:01 UTC (permalink / raw)
  To: prayner; +Cc: emacs-orgmode

On Saturday, 19 Dec 2015 at 08:24, prayner@unimelb.edu.au wrote:
> I'm trying to make a capture template for turning the very frequent
> invitations I get in .ics format (I think) into org agenda items.
> The basis is the ical2org awk script maintained by Eric Fraga.
> My template is defined as follows:
> ("i" "invite" entry (file+headline "~/.org/todo.org" "Tasks")
> 	 "* TODO %(org-capture-vm-invite)\n" :immediate-finish t)

Maybe have a look at the implementation of gnus-icalendar functions
which do what you want albeit for gnus and not vm?  gnus-icalendar.el
should be in your emacs distribution but, if not, it can be found in the
git version of gnus.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.2-416-g369955

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

end of thread, other threads:[~2016-01-05 11:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-18 21:24 capture template for .ics invitation in vm prayner
2016-01-05  9:01 ` Eric S Fraga

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