From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Integration of Org mode and mairix Date: Fri, 10 Aug 2007 08:56:45 +0200 Message-ID: References: <87r6n6ni2j.fsf@bzg.ath.cx> <20070720160833.GD28297@atlantic.linksys.moosehall> <87k5spsw81.fsf@bzg.ath.cx> <87ejip7ud8.fsf@bzg.ath.cx> <876440tsul.fsf@presario.homelinux.org> <87k5sgpg6o.fsf@bzg.ath.cx> <87lkcqlppr.fsf@presario.homelinux.org> <87ps1z5iyk.fsf@bzg.ath.cx> Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IJOnW-0008F0-Hc for emacs-orgmode@gnu.org; Fri, 10 Aug 2007 03:20:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IJOnV-0008EU-D7 for emacs-orgmode@gnu.org; Fri, 10 Aug 2007 03:20:38 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJOnV-0008EJ-4M for emacs-orgmode@gnu.org; Fri, 10 Aug 2007 03:20:37 -0400 Received: from korteweg.uva.nl ([146.50.98.70]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IJOnU-00056h-PF for emacs-orgmode@gnu.org; Fri, 10 Aug 2007 03:20:36 -0400 In-Reply-To: <87ps1z5iyk.fsf@bzg.ath.cx> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org 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 > `org-link-custom-types'. > > 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 gnus:mairix:..... vm:mairix:..... 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