emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <dominik@science.uva.nl>
To: Bastien <bzg@altern.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Integration of Org mode and mairix
Date: Fri, 10 Aug 2007 08:56:45 +0200	[thread overview]
Message-ID: <c0f8cb5aa0f82c16ef52601d54d71f5d@science.uva.nl> (raw)
In-Reply-To: <87ps1z5iyk.fsf@bzg.ath.cx>


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'.)
>
> <org.el_07082007.patch>
> 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

  reply	other threads:[~2007-08-10  7:20 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-17 19:22 Integration of Org mode and Gnus Georg C. F. Greve
2007-07-18  0:22 ` Jason F. McBrayer
2007-07-18  8:03   ` Georg C. F. Greve
2007-07-18 10:04     ` Bastien
2007-07-18 10:29       ` Georg C. F. Greve
2007-07-20 16:08         ` Integration of Org mode and mairix (was: ... and Gnus) Adam Spiers
2007-07-22 23:15           ` Integration of Org mode and mairix Georg C. F. Greve
2007-07-23  2:24             ` Is it any function similar to appoinment alert in the planner mode? brianjiang
2007-07-23 12:38               ` Bernt Hansen
2007-07-25 19:15               ` Bastien Guerry
2007-07-26  7:23                 ` Bastien
2007-07-27  5:17                   ` brianjiang
2007-08-07  0:05                   ` Bastien
2007-08-07 17:13                     ` Bastien
2007-08-21  2:37                     ` william
2007-07-24 14:38             ` Integration of Org mode and mairix Bastien
2007-07-30 14:02               ` Georg C. F. Greve
2007-07-30 16:02                 ` Bastien
2007-07-30 16:31                   ` Leo
2007-07-30 17:26                     ` Bastien
2007-08-05  1:32                       ` Xiao-Yong Jin
2007-07-31 15:52                   ` Jason F. McBrayer
2007-07-31 16:56                   ` Xiao-Yong Jin
2007-07-31 17:19                     ` Georg C. F. Greve
2007-08-05  1:40                       ` Xiao-Yong Jin
2007-07-31 18:43                     ` Bastien
2007-08-01 14:52                       ` Jason F. McBrayer
2007-08-01 16:59                         ` Bastien
2007-08-05  1:44                         ` Xiao-Yong Jin
2007-08-05 10:20                           ` Georg C. F. Greve
2007-08-07 17:54                             ` Bastien
2007-08-10  6:56                               ` Carsten Dominik [this message]
2007-08-14 11:29                                 ` Adam Spiers
2007-08-15 17:46                                   ` Carsten Dominik
2007-08-21 12:38                                   ` Carsten Dominik
2007-08-14 22:54                                 ` Steven Lumos
2007-08-15 17:46                                   ` Carsten Dominik
2007-08-16 18:48                                     ` Steven Lumos
2007-09-23 15:44                                 ` Georg C. F. Greve
2007-09-23 18:12                                   ` Carsten Dominik
2007-09-23 21:50                                     ` Georg C. F. Greve
2007-09-23 22:05                                       ` Carsten Dominik
2007-09-24 17:38                                         ` Georg C. F. Greve
2007-09-25 14:41                                           ` Carsten Dominik
2007-09-25 22:25                                             ` Georg C. F. Greve
2007-09-25 22:38                                               ` Carsten Dominik
2007-07-18 11:04       ` Integration of Org mode and Gnus Jason F. McBrayer
2007-07-18 12:01         ` Bastien
2007-07-18 12:57           ` Jason F. McBrayer
2007-07-18 13:08           ` Georg C. F. Greve
2007-07-18 15:39             ` Bastien
2007-07-18 19:39               ` Georg C. F. Greve
2007-07-18 22:06                 ` Bastien
2007-07-19 15:29                   ` Georg C. F. Greve
2007-07-18 21:54               ` Carsten Dominik
2007-07-19 15:41                 ` Bastien
2007-07-18 10:20     ` Tassilo Horn
2007-07-18 10:35       ` Georg C. F. Greve
2007-07-18 11:55         ` Tassilo Horn
2007-07-18 12:25           ` Georg C. F. Greve
2007-07-18 12:54             ` Tassilo Horn
2007-07-18 13:18               ` Georg C. F. Greve
2007-07-18 13:32                 ` Tassilo Horn
2007-07-18  0:55 ` Bastien
2007-07-18  7:53   ` Georg C. F. Greve

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0f8cb5aa0f82c16ef52601d54d71f5d@science.uva.nl \
    --to=dominik@science.uva.nl \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).