[Top][All Lists]

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

Re: [Orgmode] Integration of Org mode and mairix

From: Carsten Dominik
Subject: Re: [Orgmode] Integration of Org mode and mairix
Date: Fri, 10 Aug 2007 08:56:45 +0200

On Aug 7, 2007, at 19:54, Bastien wrote:
Here is a patch against latest org-mode 5.04 as a first attempt of
implementing custom link-types (stored in `org-link-custom-types'.)

It lets you define an alist of custom link-types. See the docstring of

Then you need to define the follow/store functions by yourself. Here are
the defuns I use (in addition to Georg's mairix.el):

I have read the discussion about extending link capabilities with
great interrest, and I do like the code that has been written.
Thanks in particular to Adam Spiers and George Greve for their
inspiring mairix hack.

Here is my take on it.

First about the mairix integration. If I understand correctly, mairix does
only the search, and you still do need to select a way how to display
the results.  In this case, wouldn't a syntax


be better?

Then I understand that mairix is only one of many possible indexing tools,
so we probably should go for a general solution.  So far I have liked
the fact that many more common Emacs packages are integrated with
Org-mode right
out of the box, and that no setup steps are needed.  However, with
this indexing stuff, it seems that the time for a general extension
mechanism has come - this will also allow many other hacks.
Bastien, I looked at your code, and I want to propose to you to modify
it in the following way - making it closer to how John Wiegley has
implemented it for planner/wiki/muse.

The basic structure of an extension could look like this:

(require 'org)

(org-add-link-type "mairix" 'org-mairix-follow-link 'org-mairix-publish-link)
(add-hook 'org-store-link-functions 'org-mairix-store-link)

(defun org-follow-mairix-link (path)
  "this will be called by org-open-at-point"
  ... )

(defun org-mairix-publish-link (path)
  "this returns something that can be used when publishing the file"
   ... )

(defun org-mairx-store-link ()
   "This function should test if it is relevant for the current buffer.
    If yes, return a link for org-store-link.  If not,
    return nil"

(provide 'org-mairix)

org-add-link-type needs to add "mairix" to the link types, and
it needs to re-make all regular expression constants that use
org-link-types, also indirectly.

org-store-link will try all functions in org-store-link-functions
in turn, maybe using run-hooks-with-args-until-success.
Only if all of them return nil, then org-mode will
check for the other, built-in link types.

So this is very similar to to what Bastien has already done, but
has the advantage the all a user needs to do is

    (require 'org-mairix)

- Carsten

reply via email to

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