[Top][All Lists]

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

[Orgmode] Feature Request - Active and inactive links.

From: Tim O'Callaghan
Subject: [Orgmode] Feature Request - Active and inactive links.
Date: Mon, 10 Dec 2007 01:52:10 +0100

On 10/12/2007, Bastien <address@hidden> wrote:
> Hi Tim,
> "Tim O'Callaghan" <address@hidden> writes:
> > Currently Org mode supports links like:
> >      http://www.astro.uva.nl/~dominik
> >      file:/home/dominik/images/jupiter.jpg
> >      news:comp.emacs
> >      etc....
> >
> > I would like to propose the concept of 'Active' links, based on
> > the above. The idea being that some links are marked such that
> > when Org is building an agenda, it includes these links as if they
> > were in the org-agenda-files list.
> It's been a while since you posted this message... I think I
> don't really understand the core idea here.  Can you elaborate a
> bit more?  What kind of information do you want to attach to
> links?  what for?  in what context should this information be
> displayed?  processed?
> Thanks for providing further details!

Sorry if i was unclear, I thought my examples would it explain most of
it, my bad.

Here it is in more detail. :)

The core idea - Active links - is a link that specifies a
resource (usually remote) that will be included (and possibly
preprocessed) when you compile an agenda. They should look and
act like normal links, but be handled differently when an agenda
is compiled.

Where this idea came from.

I have a hacked together function that i use (see my rusty elisp
below) that creates org-files from ical URLs. I use this to
include my google calendar and other published events in my

With the addition of org-add-link-type (described in Appendix
A-2 in the org manual), i could create a link type that would
convert an ical link to an org file on opening. This is great,
but i could not then auto-include that in buffed file in my
agenda without saving it and adding it to org-agenda-files.

What would be needed would be some kind of flag or indicator
that the link should be processed when creating an agenda
buffer. It would need to be assumed that the link is, or will be
preprocessed into, an org file.

This led me to consider the consequences of an 'Active Link' and
how to make it a more general and flexible concept.

* The Agenda is not passive, it modifies its source files.
= This could be mitigated using meta-tagging of read only
resources. Another more finicky method could be a file of
negative or modification assertions that change or remove a read
only link before inclusion in the Agenda. Possibly a table of
specific org node search links that replace the target with the stored org node.

* The Agenda only processes the org-agenda-files list.
= Let org build the list recursively from active links with one
org-file as the head of the tree. This would have the benefit of
letting you build different agendas based on the first org file
referenced. Note - might need to force read only active links to
be leaf nodes (i.e not recurse into them).

* The Active Link referenced is no longer an agenda item.
= If you remove the org file or its link from the within agenda,
you change the Active Link to an inactive link globally. That
is, in all of the linked files in the current org-agenda files

* What if you open an active link from an org-mode buffer?
= Undecided possibly configurable? I would say open the link in
its natural state.

* What use is a an active link to a remote read-only org file?
= Collaboration. I can think of many scenarios, but the one i
like is where my wife can just update a text file or blog post
or whatever to update my agenda.

* How would you represent an active link so it is obvious?
= An active link could be prefixed by a + sign, possibly with
embedded meta information for the agenda.

Some possible examples:
- read/write remote org file for collaboration (efs/angeftp)
- read only remote org file for collaboration in category work
- read only remote ical file of local whats-on information.

The +category+ link prefix idea is because + can be part of a URL.

* Where could you go from here?
= The concept could be extended to allow further integration to
other tools using to-org and from-org pre and post
processing. Using my ical hack for an example, it could possibly
be extended to a read/write WEBDAV link. Say for Outlook or
Sunbird integration.

So thats the idea in more detail, hope it clarifies the idea further...


-- Google Calendar hack --
(setq google-ical-org-list
  ; removed personal links, but left a working public ical link.
  ; each ical link consists of:
  ;("ical link"
  ; "ical link download target file"
  ; "org file created - must be in org-agenda-files")

(defun toc:goggle-to-org ()
  "get a google calendar and convert it into org dates"
    ;; initialise calendar handling
    (let* ((glist google-ical-org-list))
      ;; iterate through list
      (while (setq entry (pop glist))
        (setq google-ical-url (car entry) local-ical-file
              (nth 1 entry) local-date-file (nth 2 entry))
        ;; Delete the diary local files
        (if (file-exists-p local-ical-file) (delete-file local-ical-file))
        (if (file-exists-p local-date-file) (delete-file local-date-file))
        ;; Get ical file
        (w3-download-url google-ical-url (expand-file-name local-ical-file))
        ;; create an empty ical to process
        (if (not (file-exists-p local-ical-file))
            ((set-buffer (find-file local-ical-file))
             (save-buffer local-ical-file)))
        ;; convert to diary without leading &
        (icalendar-import-file local-ical-file local-date-file t)
        ;; create an empty org file if needed
        (if (not (find-buffer-visiting local-date-file))
            ((set-buffer (file-find local-date-file))
             (save-buffer local-date-file)))
        ;; iCalendar leaves the buffers open
        (if (find-buffer-visiting local-date-file)
              (kill-buffer (find-buffer-visiting local-date-file)))
        (if (find-buffer-visiting local-ical-file)
              (kill-buffer (find-buffer-visiting local-ical-file)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]