Re: [Orgmode] Integration of Org mode with Mairix: org-mairix.el

2008-02-10 Thread Bastien Guerry
Hi Adam,

Adam Spiers [EMAIL PROTECTED] writes:

 but I was hoping to get some feedback from the (apparently tiny?)
 user-base first.  Is there anyone other than myself and Austin
 currently reading the list who uses org-mairix.el, or who might be
 interested in using it?

I'm not using org-mairix.el anymore because org-nnml.el suits my needs.
But I like mairix and I'm using it a lot (with Gnus.)

If you solve the issues you mentionned then I will give it another try,
for sure!

-- 
Bastien


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode with Mairix: org-mairix.el

2008-02-10 Thread Gijs Hillenius
On 10 Feb 2008, Bastien Guerry wrote:

 Adam Spiers [EMAIL PROTECTED] writes:

 but I was hoping to get some feedback from the (apparently tiny?)
 user-base first.  Is there anyone other than myself and Austin
 currently reading the list who uses org-mairix.el, or who might be
 interested in using it?

(snip)

 If you solve the issues you mentionned then I will give it another try,
 for sure!

Me too.

Gijs
-- 
Insanity is considered a ground for divorce, though by the very same
token it is the shortest detour to marriage.
-- Wilson Mizner


___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode with Mairix: org-mairix.el

2007-09-26 Thread Bastien
Georg C. F. Greve [EMAIL PROTECTED] writes:

 I've taken a little bit of time to clean up the integration of Mairix
 with Org.

Great!

 The weakest point right now is the selection of the Gnus group upon
 matching, as I am still looking for a way to do this in Gnus that will
 not generate zombies.

Please have a look at the patch below and tell me if it solves the issue
above. Look for the small FIXME: (bzg) cookies in the patch.

 But overall I'm quite happy now: By default, this will pull an entire
 thread into the search group and automatically select the mail that
 was linked to.

BTW, this might be just personal taste, but I would prefer a shorter
syntax for thread searches (like mairix:t).  

Right now  --thread in the link is converted as %20--thread and this
is not parsed by the (split-string ...  ) part of your code.

 Please test, help debug and extend. I don't have the time to maintain
 this actively, but would be happy if people found it useful.

This *is* definitely very useful!

diff -u /home/guerry/elisp/testing/org-mairix.el /home/guerry/elisp/testing/bzg/org-mairix.el
--- /home/guerry/elisp/testing/org-mairix.el	2007-09-26 16:45:30.0 +0200
+++ /home/guerry/elisp/testing/bzg/org-mairix.el	2007-09-26 16:43:03.0 +0200
@@ -35,31 +35,31 @@
 
 (defcustom org-mairix-threaded-links t
   Should new links be created as threaded links?
-   If t, links will be stored as threaded searches.
-   If nil, links will be stored as non-threaded searches.
+If t, links will be stored as threaded searches.
+If nil, links will be stored as non-threaded searches.
   :group 'org-mairix
   :type 'boolean)
 
 (defcustom org-mairix-augmented-links nil
   Should new links be created as augmenting searches?
-   If t, links will be stored as augmenting searches.
-   If nil, links will be stored as normal searches.
+If t, links will be stored as augmenting searches.
+If nil, links will be stored as normal searches.
 
-   Attention: When activating this option, you will need
-   to remove old articles from your mairix results group
-   in some other way, mairix will not do it for you.
+Attention: When activating this option, you will need
+to remove old articles from your mairix results group
+in some other way, mairix will not do it for you.
   :group 'org-mairix
   :type 'boolean)
 
 (defcustom org-mairix-display-hook 'org-mairix-gnus-display-results
   Hook to call to display the results of a successful mairix search.
-   Defaults to Gnus, feel free to add your own MUAs or methods.
+Defaults to Gnus, feel free to add your own MUAs or methods.
   :group 'org-mairix
   :type 'hook)
 
 (defcustom org-mairix-executable mairix
   The mairix executable to call. If your paths are set up
-   correctly, you should not need to change this.
+correctly, you should not need to change this.
   :group 'org-mairix
   :type 'string)
 
@@ -70,8 +70,8 @@
 
 (defcustom org-mairix-gnus-results-group nnmaildir:mairix
   The group that is configured to hold the mairix search results,
-   which needs to be setup independently of the org-mairix integration,
-   along with general mairix configuration.
+which needs to be setup independently of the org-mairix integration,
+along with general mairix configuration.
   :group 'org-mairix-gnus
   :type 'string)
 
@@ -85,7 +85,8 @@
 ;;; Generic org-mairix functions
 
 (defun org-mairix-store-link ()
-  Store a link to the current message as a Mairix search for its Message ID.
+  Store a link to the current message as a Mairix search for its
+Message ID.
 
   ;; gnus integration
   (when (memq major-mode '(gnus-summary-mode gnus-article-mode))
@@ -94,10 +95,11 @@
 	   (header (gnus-summary-article-header article))
 	   (from (mail-header-from header))
 	   (message-id (mail-header-id header))
-	   (date (mail-header-date header))
+	   ;; FIXME: (bzg) we don't need the date
+	   (date (mail-header-date header)) 
 	   (subject (gnus-summary-subject-string)))
   (org-store-link-props :type mairix :from from :subject subject
-			:message-id message-id )
+			:message-id message-id)
   (setq cpltxt (org-email-link-description))
   (org-store-link-props :link (concat mairix: (org-remove-angle-brackets message-id)
 	  (if org-mairix-threaded-links  --thread)
@@ -107,11 +109,12 @@
 (defun org-mairix-open (path)
   Function to open mairix link.
 
-   We first need to split it into its individual parts, and then extract the
-   message-id to be passed on to the display function before call mairix, evaluate
-   the number of matches returned, and make sure to only call display of mairix
-   succeeded in matching.
-
+We first need to split it into its individual parts, and then
+extract the message-id to be passed on to the display function
+before call mairix, evaluate the number of matches returned, and
+make sure to only call display of mairix succeeded in matching.
+  ;; FIXME (bzg) mhh... better use let* construct for arguments,
+  ;; message-id and cmdline.
   (setq 

Re: [Orgmode] Integration of Org mode with Mairix: org-mairix.el

2007-09-26 Thread Georg C. F. Greve
On Wed, 26 Sep 2007 16:50:42 +0200
Bastien [EMAIL PROTECTED] wrote: 

 b Please have a look at the patch below and tell me if it solves the
 b issue above. Look for the small FIXME: (bzg) cookies in the patch.

Thanks a lot for your help.

The zombie issue is still present, and I've tried to address the FIXME:
issues as well as possible, or ask for clarification on the point.


 b BTW, this might be just personal taste, but I would prefer a shorter
 b syntax for thread searches (like mairix:t).  Right now  --thread
 b in the link is converted as %20--thread and this is not parsed by
 b the (split-string ...  ) part of your code.

Strange, it worked when I first tested it, and now does no more.

I agree shorter is nicer, so changed the syntax accordingly.

Version 0.2 attached below.

Please test, comment, improve...

Best rgeards,
Georg




org-mairix.el
Description: application/emacs-lisp

-- 
Georg C. F. Greve [EMAIL PROTECTED]
Free Software Foundation Europe  (http://fsfeurope.org)
Join the Fellowship and protect your freedom! (http://www.fsfe.org)
What everyone should know about DRM   (http://DRM.info)


pgpmYZuYmBd5O.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-09-25 Thread Carsten Dominik


On Sep 24, 2007, at 10:38, Georg C. F. Greve wrote:

I now created org-mairix-gnus.el to hook mairix into Org mode using 
Gnus

as the MUA. This is essentially the same functionality (minus threading
capabilities) so it can be used instead of the patch. A simple

(require 'org-mairix-gnus)

in your .gnus should do the job.

Prerequisites are that mairix is set up, and that the variable

  mairix-gnus-results-group

is set to whatever you're using to display mairix search results.

I'd still like to clean up the code, however, and am wondering about
potential threaded search. Would it be possible to

 a) give additional arguments to the function to open the link?

or

 b) have different functions to follow the link?

It strikes me that a might be much easier than b, though.


It is entirely up to you to define the syntax for this and
process arguments.  The function org-mairix-gnus-open will
be called with whatever was after the mairix: tag in the
link.  Just define your own syntax for passing arguments, like

   [[mairix:message-id -thread -verbose -new-frame]]

and process it in org-mairix-gnus-open.

- Carsten




___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-09-25 Thread Georg C. F. Greve
On Tue, 25 Sep 2007 07:41:13 -0700
Carsten Dominik [EMAIL PROTECTED] wrote: 

 cd It is entirely up to you to define the syntax for this and process
 cd arguments.  The function org-mairix-gnus-open will be called with
 cd whatever was after the mairix: tag in the link.  Just define your
 cd own syntax for passing arguments, like

 cd[[mairix:message-id -thread -verbose -new-frame]]

 cd and process it in org-mairix-gnus-open.

Yes, but this would be link based, instead of per search which is what
I was considering. But maybe that is actually not necessary. I'll give
this one a little more thought.

Regards,
Georg

-- 
Georg C. F. Greve [EMAIL PROTECTED]
Free Software Foundation Europe  (http://fsfeurope.org)
Join the Fellowship and protect your freedom! (http://www.fsfe.org)
What everyone should know about DRM   (http://DRM.info)


pgphynWsm6Ekw.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-09-24 Thread Georg C. F. Greve
On Sun, 23 Sep 2007 15:05:31 -0700
Carsten Dominik [EMAIL PROTECTED] wrote: 

 cd http://orgmode.org/org.html#Adding-hyperlink-types

Thanks a lot.

I now created org-mairix-gnus.el to hook mairix into Org mode using Gnus
as the MUA. This is essentially the same functionality (minus threading
capabilities) so it can be used instead of the patch. A simple

(require 'org-mairix-gnus)

in your .gnus should do the job.

Prerequisites are that mairix is set up, and that the variable

  mairix-gnus-results-group

is set to whatever you're using to display mairix search results.

I'd still like to clean up the code, however, and am wondering about
potential threaded search. Would it be possible to

 a) give additional arguments to the function to open the link?

or

 b) have different functions to follow the link?

It strikes me that a might be much easier than b, though.

Regards,
Georg




org-mairix-gnus.el
Description: application/emacs-lisp

-- 
Georg C. F. Greve [EMAIL PROTECTED]
Free Software Foundation Europe  (http://fsfeurope.org)
Join the Fellowship and protect your freedom! (http://www.fsfe.org)
What everyone should know about DRM   (http://DRM.info)


pgphOx2FtzYH5.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-09-23 Thread Carsten Dominik


On Sep 23, 2007, at 10:44, Georg C. F. Greve wrote:


Hi all,

did this thread come to a conclusion? I just checked out 5.09 and could
not find any of the patches applied to it, so would assume that it is
still hanging in mid-air.


Well, there are now all the hooks in org-mode to introduce new link 
types.

So from my side, this have come to some kind of a conclusion - I just
hope that mairix and other link types will pop up eventually.

- Carsten




Based on a few months of experience with my patches, here is my take:

On Fri, 10 Aug 2007 08:56:45 +0200
Carsten Dominik [EMAIL PROTECTED] wrote:

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

 cd   gnus:mairix:.
 cd   vm:mairix:.

 cd be better?

Not necessarily, it would make the link dependent on the MUA, which
would otherwise not be the case. People probably don't switch back and
forth all the time, but still it might be better to not code this into
the system.

A kind of generic org-visit-search-results that can be set to 
whatever

method is being used with sane defaults might be a cleaner solution.

Having a generic link-creation and link-visiting structure into which
one can hook the different backends should be the way to go, I guess.

Initially I also had a mairix with thread and mairix without thread
link type, but now find myself thinking that it would be better to only
have a mairix link and decide during search whether or not to use
threads or influence other search parameters.


 cd The basic structure of an extension could look like this:

Yeah, I think this would work.

Is there already a patch out there? Can someone supply a clean patch
for this that will make it into Org-Mode? I'm willing to have another
look at this, but would prefer to work against a proper target.

Regards,
Georg

--
Georg C. F. Greve [EMAIL PROTECTED]
Free Software Foundation Europe  (http://fsfeurope.org)
Join the Fellowship and protect your freedom! (http://www.fsfe.org)
What everyone should know about DRM   (http://DRM.info)



--
Carsten Dominik
Sterrenkundig Instituut Anton Pannekoek
Universiteit van Amsterdam
Kruislaan 403
NL-1098SJ Amsterdam
phone: +31 20 525 7477



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-09-23 Thread Carsten Dominik


On Sep 23, 2007, at 14:50, Georg C. F. Greve wrote:


On Sun, 23 Sep 2007 11:12:09 -0700
Carsten Dominik [EMAIL PROTECTED] wrote:

 cd Well, there are now all the hooks in org-mode to introduce new 
link

 cd types.  So from my side, this have come to some kind of a
 cd conclusion - I just hope that mairix and other link types will pop
 cd up eventually.

I've looked for the function names that you suggested in your mails, 
but

did not see them. A quick glance also did not seem to make it obvious
where to hook this in.

Could you maybe give me a hint where to look?


http://orgmode.org/org.html#Adding-hyperlink-types


- Carsten



___
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-15 Thread Carsten Dominik


On Aug 14, 2007, at 13:29, Adam Spiers wrote:

In this case, wouldn't a syntax

  gnus:mairix:.
  vm:mairix:.

be better?


Possibly - that depends on whether any user would ever want to create
links which fired up more than one MUA


With the possible exception that you'd like GNUS for usenet messages
and some mailing application for your mail?


I can't think of a use case for the
former, and the latter seems cleaner (and means that if you change MUA
you don't have to do a search/replace on all your links),


This is a good point.


Personal plea: please bear in mind those of us who use MUAs not based
in emacs!  For example, my preferred action when following a mairix
link is to pop up a fresh xterm with `mutt -f $mairix_folder' running
inside it.


Yes, this should be made possible.


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.


This leads to the other point I wanted to make, although its scope is
possibly too great for this list: I would greatly prefer any such
solution to allow hyperlinking from within other modes - muse in
particular.  Perhaps this could be done via orgstruct, or maybe the
org and muse camps could get together and agree to standardize on a
single syntax for hyperlinking, e.g. implemented via a shared minor
mode.



What are the differences?  The basic structure

[[link][description]]

is already the same.  So I guess you are referring to things like
how the message-id is attached to the link, and how targets are 
specified?


It is certainly possible to write a command that would correctly open
an Org-mode style link in any buffer.  Could even be a separate minor
mode, just for this one command.  I'll take a look.


- Carsten



___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-14 Thread Adam Spiers
Carsten Dominik ([EMAIL PROTECTED]) wrote:
 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.

My pleasure :-)

 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?

Possibly - that depends on whether any user would ever want to create
links which fired up more than one MUA; otherwise the choice of MUA
could be set with a defcustom.  I can't think of a use case for the
former, and the latter seems cleaner (and means that if you change MUA
you don't have to do a search/replace on all your links), but no doubt
someone will think of an opposing argument.

Personal plea: please bear in mind those of us who use MUAs not based
in emacs!  For example, my preferred action when following a mairix
link is to pop up a fresh xterm with `mutt -f $mairix_folder' running
inside it.

 Then I understand that mairix is only one of many possible indexing
 tools, so we probably should go for a general solution.

Agreed.

 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.

This leads to the other point I wanted to make, although its scope is
possibly too great for this list: I would greatly prefer any such
solution to allow hyperlinking from within other modes - muse in
particular.  Perhaps this could be done via orgstruct, or maybe the
org and muse camps could get together and agree to standardize on a
single syntax for hyperlinking, e.g. implemented via a shared minor
mode.  Wishful thinking?  I don't know, but it does strike me that
there is some duplication of effort across not just org and muse,
but also browse-url.el and possibly others.  

Incidentally, I think it's great that org-mode already uses URL-like
locators for external links.  This would be a good foundation for a
unification project.


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-10 Thread Carsten Dominik


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



___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-07 Thread Bastien
Georg C. F. Greve [EMAIL PROTECTED] writes:

 On Sat, 04 Aug 2007 21:44:48 -0400
 Xiao-Yong Jin [EMAIL PROTECTED] wrote: 

  xj Perhaps we should actually suggest Carsten build nnir support in
  xj org-mode and at the same time persuade the maintainer of nnir.el to
  xj support mairix?  ;-)

 I think this could be a clean solution to the problem.

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

diff --git a/org.el b/org.el
index 1fc081e..c139be1 100644
--- a/org.el
+++ b/org.el
@@ -968,6 +968,23 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line.
 The value of this is taken from the #+LINK lines.)
 (make-variable-buffer-local 'org-link-abbrev-alist-local)
 
+(defcustom org-link-custom-types nil
+  Alist of recognized link types.  
+This types are appended to `org-link-types'.
+Each cell is of the form 
+
+  \(\type\ \(follow-function store-function major-mode\)\)
+
+where \type\ is the string defining the type, follow-function
+is the function that Org will call to follow these links,
+store-function the function that Org will use to store these link
+and major-mode the major mode where it's active.
+  :group 'org-link
+  :type '(repeat (list (string :tag Type (string)   )
+		   (function :tag Follow function )
+		   (function :tag Store function  )
+		   (function :tag Active in major mode
+
 (defcustom org-link-abbrev-alist nil
   Alist of link abbreviations.
 The car of each element is a string, to be replaced at the start of a link.
@@ -4140,8 +4157,11 @@ that will be added to PLIST.  Returns the string that was modified.
 (require 'font-lock)
 
 (defconst org-non-link-chars ]\t\n\r)
-(defconst org-link-types '(http https ftp mailto file news bbdb vm
-			   wl mhe rmail gnus shell info elisp))
+(defconst org-link-types 
+  (append (list http https ftp mailto file news bbdb vm
+		wl mhe rmail gnus shell info elisp)
+	  (delq nil (mapcar (lambda(x) (car x)) org-link-custom-types
+
 (defconst org-link-re-with-space
   (concat
?\\( (mapconcat 'identity org-link-types \\|) \\):
@@ -10410,9 +10430,13 @@ For links to usenet articles, arg negates `org-usenet-links-prefer-google'.
 For file links, arg negates `org-context-in-file-links'.
   (interactive P)
   (setq org-store-link-plist nil)  ; reset
-  (let (link cpltxt desc description search txt)
+  (let (link cpltxt desc description search txt cus)
 (cond
 
+ ((setq cus (assq major-mode (mapcar '(lambda(e) (reverse e)) 
+	 org-link-custom-types)))
+  (funcall (nth 1 cus)))
+
  ((eq major-mode 'bbdb-mode)
   (let ((name (bbdb-record-name (bbdb-current-record)))
 	(company (bbdb-record-getprop (bbdb-current-record) 'company)))
@@ -11006,7 +11030,7 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file.
   (org-remove-occur-highlights nil nil t)
   (if (org-at-timestamp-p t)
   (org-follow-timestamp-link)
-(let (type path link line search (pos (point)))
+(let (type path link line search (pos (point)) cus)
   (catch 'match
 	(save-excursion
 	  (skip-chars-forward ^]\n\r)
@@ -11177,7 +11201,10 @@ optional argument IN-EMACS is non-nil, Emacs will visit the file.
   (message %s = %s cmd (eval (read cmd)))
 	(error Abort
 
-   (t
+   ((setq cus (assoc type org-link-custom-types))
+	(funcall (nth 1 cus) path))
+
+   (t 
 	(browse-url-at-point)
   (move-marker org-open-link-marker nil))
 

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



org-mairix.el
Description: application/emacs-lisp

I think the nnir.el support could be provided via custom link types,
instead of being hardcoded within org.el.

Please test it and give me feedback! 

PS: i started to have a look at nnir.el to make it aware of mairix. But
i'm not sure i'll have time for this till the end of the week.

-- 
Bastien
___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-05 Thread Georg C. F. Greve
On Sat, 04 Aug 2007 21:44:48 -0400
Xiao-Yong Jin [EMAIL PROTECTED] wrote: 

 xj Perhaps we should actually suggest Carsten build nnir support in
 xj org-mode and at the same time persuade the maintainer of nnir.el to
 xj support mairix?  ;-)

I think this could be a clean solution to the problem.

Unfortunately my time to spend on persuasion is extremely limited, but
if you CC me on the emails sent to the maintainers, I'll add my I think
this would be a great idea bit to it. ;)

Regards,
Georg

-- 
Georg C. F. Greve [EMAIL PROTECTED]
Free Software Foundation Europe  (http://fsfeurope.org)
Join the Fellowship and protect your freedom! (http://www.fsfe.org)
What everyone should know about DRM   (http://DRM.info)


pgpQGTbKsiWnA.pgp
Description: PGP signature
___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-04 Thread Xiao-Yong Jin
[EMAIL PROTECTED] (Jason F. McBrayer) writes:

 Bastien [EMAIL PROTECTED] writes:

 Xiao-Yong Jin [EMAIL PROTECTED] writes:

 Probably it's the time for us to think of a universal way to support
 system dependent 3rd party index tools. Mairix may not be the only
 search tool people want to use with org-mode, though it is my
 favourite and only index tool I use for now.

 Please see (and comment) my suggestion here:

   http://article.gmane.org/gmane.emacs.orgmode/2563

 I think that's basically right, though in the case of email search,
 probably the best thing would be making nnir work right (and provide
 nnir with a mairix backend).  nnir is supposed to provide a layer of
 indirection between mail indexers and gnus, which should be enough for
 org-mode needs.


Perhaps we should actually suggest Carsten build nnir
support in org-mode and at the same time persuade the
maintainer of nnir.el to support mairix?  ;-)

 -- 
 +---+
 | Jason F. McBrayer[EMAIL PROTECTED]  |
 | If someone conquers a thousand times a thousand others in |
 | battle, and someone else conquers himself, the latter one |
 | is the greatest of all conquerors.  --- The Dhammapada|


 ___
 Emacs-orgmode mailing list
 Emacs-orgmode@gnu.org
 http://lists.gnu.org/mailman/listinfo/emacs-orgmode



-- 
c/*__o/*
\ * (__
*/\  


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-01 Thread Jason F. McBrayer
Bastien [EMAIL PROTECTED] writes:

 Xiao-Yong Jin [EMAIL PROTECTED] writes:

 Probably it's the time for us to think of a universal way to support
 system dependent 3rd party index tools. Mairix may not be the only
 search tool people want to use with org-mode, though it is my
 favourite and only index tool I use for now.

 Please see (and comment) my suggestion here:

   http://article.gmane.org/gmane.emacs.orgmode/2563

I think that's basically right, though in the case of email search,
probably the best thing would be making nnir work right (and provide
nnir with a mairix backend).  nnir is supposed to provide a layer of
indirection between mail indexers and gnus, which should be enough for
org-mode needs.

-- 
+---+
| Jason F. McBrayer[EMAIL PROTECTED]  |
| If someone conquers a thousand times a thousand others in |
| battle, and someone else conquers himself, the latter one |
| is the greatest of all conquerors.  --- The Dhammapada|


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-08-01 Thread Bastien
[EMAIL PROTECTED] (Jason F. McBrayer) writes:

 Please see (and comment) my suggestion here:

   http://article.gmane.org/gmane.emacs.orgmode/2563

 I think that's basically right, though in the case of email search,
 probably the best thing would be making nnir work right (and provide
 nnir with a mairix backend).  

Yes, that would be even better. Although I think we could have both: a
org-gnus-links-prefer-nnir option (and mairix or namazu or swish-e ...
being called by nnir.el) *and* a org-custom-link-types (if one want to
store links from within, say, a man page.)

-- 
Bastien


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-07-31 Thread Jason F. McBrayer
Bastien [EMAIL PROTECTED] writes:

 So if you do [[mairixt:m:xyz]] it will pull out the entire thread in
 which that message id is present, so you have the full context, which I
 find very useful.

 Yes, i also like the fast intexing. Other people playing with it around?

TBH, I haven't messed with mairix or the associated patches posted here,
even though I do need such a solution, because it doesn't look like any
of the posted solutions work with IMAP mailstores, only local mailstores
like nnml and nnmaildir.

-- 
+---+
| Jason F. McBrayer[EMAIL PROTECTED]  |
| If someone conquers a thousand times a thousand others in |
| battle, and someone else conquers himself, the latter one |
| is the greatest of all conquerors.  --- The Dhammapada|


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-07-31 Thread Xiao-Yong Jin
Hi, it seems I have almost missed the best thing in
this list.

Bastien [EMAIL PROTECTED] writes:

 Hi George,

 Georg C. F. Greve [EMAIL PROTECTED] writes:

 Do you think there is any chance it would make it into the Org
 package? I would greatly prefer not having to maintain a patch for a
 longer period of time.

 I can understand that.  Carsten, what do you think?

I would really appreciate it.

 On the one hand, mairix is unlikely to be heavily in use among Org users
 (unless we continue praising it!), so there is no *strong* necessity of
 making Org natively interact with it. On the other hand, you cannot
 maintain mairix integration through an external library since it depends
 on `org-link-types', `org-store-link' and `org-open-at-point'.

 I would say it worth keeping it into Org. One request though: could we
 spare the cost of a new specific type for threaded searches? For example
 we could have `org-gnus-links-prefer-mairix' being either nil, 'threaded
 or t, so that you can handle the thread option as an argument, even in
 mairix-search.

Probably it's the time for us to think of a universal way to
support system dependent 3rd party index tools.  Mairix may
not be the only search tool people want to use with
org-mode, though it is my favourite and only index tool I
use for now.

 So if you do [[mairixt:m:xyz]] it will pull out the entire thread in
 which that message id is present, so you have the full context, which I
 find very useful.

 Yes, i also like the fast intexing. Other people playing with it around?

Sorry, but I missed the thread.  Where can I grab the code
for support in org-mode?

Xiao-Yong
-- 
c/*__o/*
\ * (__
*/\  


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-07-31 Thread Georg C. F. Greve
On Tue, 31 Jul 2007 12:56:18 -0400
Xiao-Yong Jin [EMAIL PROTECTED] wrote: 

 xj Sorry, but I missed the thread.  Where can I grab the code for
 xj support in org-mode?

Since there were small changes, allow me to repost.

This is a patch against org.el that incorporates mairix into org.el:
--- org.el.orig	2007-07-22 13:52:40.0 +0200
+++ org.el	2007-07-30 15:45:10.0 +0200
@@ -1100,6 +1100,18 @@ negates this setting for the duration of
   :group 'org-link-store
   :type 'boolean)
 
+(defcustom org-gnus-links-prefer-mairix nil
+  Non-nil means, `org-store-link' will create links to Mairix searches for gnus.
+When nil, traditional Gnus links (group  article) will be used for such links.
+  :group 'org-link-store
+  :type 'boolean)
+
+(defcustom org-mairix-links-prefer-threaded nil
+  Non-nil means, that links to Mairix searches will be stored as thread searches.
+   When nil, the links to Mairix searches will be stored as single message searches.
+  :group 'org-link-store
+  :type 'boolean)
+
 (defgroup org-link-follow nil
   Options concerning following links in Org-mode
   :tag Org Follow Link
@@ -4141,7 +4153,7 @@ that will be added to PLIST.  Returns th
 
 (defconst org-non-link-chars ]\t\n\r)
 (defconst org-link-types '(http https ftp mailto file news bbdb vm
-			   wl mhe rmail gnus shell info elisp))
+			   wl mhe rmail mairix mairixt gnus shell info elisp))
 (defconst org-link-re-with-space
   (concat
?\\( (mapconcat 'identity org-link-types \\|) \\):
@@ -10537,14 +10549,18 @@ For file links, arg negates `org-context
 	(org-store-link-props :type gnus :from from :subject subject
 			  :message-id message-id :group group)
 	(setq cpltxt (org-email-link-description))
-	(if (org-xor arg org-usenet-links-prefer-google)
-	(setq link
-		  (concat
-		   cpltxt \n  
-		   (format http://groups.google.com/groups?as_umsgid=%s;
-			   (org-fixup-message-id-for-http message-id
-	  (setq link (org-make-link gnus: group
-# (number-to-string article))
+	(if org-gnus-links-prefer-mairix
+	(if org-mairix-links-prefer-threaded
+		(setq link (org-make-link mairixt:m: (substring message-id 1 -1)))
+	  (setq link (org-make-link mairix:m: (substring message-id 1 -1
+	  (if (org-xor arg org-usenet-links-prefer-google)
+	  (setq link
+		(concat
+		 cpltxt \n  
+		 (format http://groups.google.com/groups?as_umsgid=%s;
+			 (org-fixup-message-id-for-http message-id
+	(setq link (org-make-link gnus: group
+# (number-to-string article)))
 
  ((eq major-mode 'w3-mode)
   (setq cpltxt (url-view-url t)
@@ -11105,6 +11121,12 @@ optional argument IN-EMACS is non-nil, E
((string= type news)
 	(org-follow-gnus-link path))
 
+   ((string= type mairix)
+	(org-follow-mairix-link path))
+
+   ((string= type mairixt)
+	(org-follow-mairix-link-thread path))
+
((string= type bbdb)
 	(org-follow-bbdb-link path))
 
@@ -11473,6 +11495,23 @@ onto the ring.
   (Info-find-node (match-string 1 name) Top)))
 (message (concat Could not open:  name
 
+; the following two org-follow-mairix functions should be generalised 
+; to deal with the different mail readers, right now they simply hook
+; into some primitive gnus glue
+(defun org-follow-mairix-link (string)
+  Follow a Mairix link to its string.
+  (require 'gnus)
+  (funcall (cdr (assq 'gnus org-link-frame-setup)))
+  (if gnus-other-frame-object (select-frame gnus-other-frame-object))
+  (mairix-search string))
+
+(defun org-follow-mairix-link-thread (string)
+  Follow a Mairix link to its string.
+  (require 'gnus)
+  (funcall (cdr (assq 'gnus org-link-frame-setup)))
+  (if gnus-other-frame-object (select-frame gnus-other-frame-object))
+  (mairix-search-thread string))
+
 (defun org-follow-gnus-link (optional group article)
   Follow a Gnus link to GROUP and ARTICLE.
   (require 'gnus)

The patch should be safe to apply in that it should not break anything.

For it to make sense you'll need to glue it into gnus with additional
code, here is the code I use:



binV0gzkkFMAK.bin
Description: application/emacs-lisp

Beware: This part is a cludge. It works for me, but YMMV.

It allows me to store links the normal way (C-c l) as mairix links and
insert them into my Org files normally (C-c C-l). I can also always
insert the latest SENT mail into my Org files by doing (C-c C-S-l).

Please consider all my stuff under GNU GPL v2 or later (v3 explicitly
allowed) so if someone wants to grab this and turn it into a clean
solution, that would be greatly appreciated.

Regards,
Georg


P.S. For completeness, and to make your life easier in trying this, this
is my .mairixrc file:
base=/home/greve
mbox=Archive/Mail/Auto/incoming/-??:Archive/Mail/Auto/outgoing/-??
database=/home/greve/Tools/Gnus/MairixDB
mformat=maildir
mfolder=.nnmaildir/mairix

P.P.S. In theory you can also use other backends to access mairix search
results, but I found nnmaildir to be the 

Re: [Orgmode] Integration of Org mode and mairix

2007-07-31 Thread Bastien
Xiao-Yong Jin [EMAIL PROTECTED] writes:

 Probably it's the time for us to think of a universal way to support
 system dependent 3rd party index tools. Mairix may not be the only
 search tool people want to use with org-mode, though it is my
 favourite and only index tool I use for now.

Please see (and comment) my suggestion here:

  http://article.gmane.org/gmane.emacs.orgmode/2563

-- 
Bastien


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-07-30 Thread Bastien
Hi George,

Georg C. F. Greve [EMAIL PROTECTED] writes:

 Do you think there is any chance it would make it into the Org
 package? I would greatly prefer not having to maintain a patch for a
 longer period of time.

I can understand that.  Carsten, what do you think?

On the one hand, mairix is unlikely to be heavily in use among Org users
(unless we continue praising it!), so there is no *strong* necessity of
making Org natively interact with it. On the other hand, you cannot
maintain mairix integration through an external library since it depends
on `org-link-types', `org-store-link' and `org-open-at-point'.

I would say it worth keeping it into Org. One request though: could we
spare the cost of a new specific type for threaded searches? For example
we could have `org-gnus-links-prefer-mairix' being either nil, 'threaded
or t, so that you can handle the thread option as an argument, even in
mairix-search.

 So if you do [[mairixt:m:xyz]] it will pull out the entire thread in
 which that message id is present, so you have the full context, which I
 find very useful.

Yes, i also like the fast intexing. Other people playing with it around?

-- 
Bastien


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-07-24 Thread Bastien
Hi Georg and list,

Georg C. F. Greve [EMAIL PROTECTED] writes:

 On Fri, 20 Jul 2007 17:08:33 +0100
 Adam Spiers [EMAIL PROTECTED] wrote: 

  as Funnily enough, I implemented exactly this idea about 15 months
  as ago, except that my implementation uses mairix (the mail indexer),
  as and is mode-agnostic.

 Thanks a lot, this is most interesting and put me on the right track.

 Combining your work with that of Guy Hillenius, which he blogged at
 http://www.hillenius.net/node/44 I integrated Gnus, Mairix  Org now.

Thanks for pointing on mairix and providing an integrated solution for
org/Gnus/mairix. I tried your patch and the mairix-related elisp code,
it works fine here.

One little fix though: if Gnus is not loaded when following a mairix
link, it returns an error. Please make `org-follow-mairix-link' and
`org-follow-mairix-link-thread' (re)loading Gnus with something like:

  (require 'gnus)
  (funcall (cdr (assq 'gnus org-link-frame-setup)))
  (if gnus-other-frame-object (select-frame gnus-other-frame-object))


The mairix solution is especially elegant because it does not only
handle the case where you need to find a particular email, but it also
comes with lots of useful search options.

For example, if you need to check all message explicitely sent to you in
the last three days, just add a link like:

  [[mairix:d:3d- t:me]]

If you need to find mails from Carsten with Org in their subjects:

  [[mairix:s:Org f:Carsten]]

Caveat: for those who want to use mairix with the `nnml' Gnus backend,
install mairix 0.17.1. Debian(-based) systems will only install 0.17
and your `nnml' folders won't be indexed.

-- 
Bastien


___
Emacs-orgmode mailing list
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Integration of Org mode and mairix

2007-07-22 Thread Georg C. F. Greve
On Fri, 20 Jul 2007 17:08:33 +0100
Adam Spiers [EMAIL PROTECTED] wrote: 

 as Funnily enough, I implemented exactly this idea about 15 months
 as ago, except that my implementation uses mairix (the mail indexer),
 as and is mode-agnostic.

Thanks a lot, this is most interesting and put me on the right track.

Combining your work with that of Guy Hillenius, which he blogged at
http://www.hillenius.net/node/44 I integrated Gnus, Mairix  Org now.

The core is a patch for org.el -- this patch is still somewhat
primitive, but should not break anything and unless the new variables
are changed will not change standard behaviour:

--- org.el.orig	2007-07-22 13:52:40.0 +0200
+++ org.el	2007-07-22 17:44:51.0 +0200
@@ -1100,6 +1100,18 @@ negates this setting for the duration of
   :group 'org-link-store
   :type 'boolean)
 
+(defcustom org-gnus-links-prefer-mairix nil
+  Non-nil means, `org-store-link' will create links to Mairix searches for gnus.
+When nil, traditional Gnus links (group  article) will be used for such links.
+  :group 'org-link-store
+  :type 'boolean)
+
+(defcustom org-mairix-links-prefer-threaded nil
+  Non-nil means, that links to Mairix searches will be stored as thread searches.
+   When nil, the links to Mairix searches will be stored as single message searches.
+  :group 'org-link-store
+  :type 'boolean)
+
 (defgroup org-link-follow nil
   Options concerning following links in Org-mode
   :tag Org Follow Link
@@ -4141,7 +4153,7 @@ that will be added to PLIST.  Returns th
 
 (defconst org-non-link-chars ]\t\n\r)
 (defconst org-link-types '(http https ftp mailto file news bbdb vm
-			   wl mhe rmail gnus shell info elisp))
+			   wl mhe rmail mairix mairixt gnus shell info elisp))
 (defconst org-link-re-with-space
   (concat
?\\( (mapconcat 'identity org-link-types \\|) \\):
@@ -10537,14 +10549,18 @@ For file links, arg negates `org-context
 	(org-store-link-props :type gnus :from from :subject subject
 			  :message-id message-id :group group)
 	(setq cpltxt (org-email-link-description))
-	(if (org-xor arg org-usenet-links-prefer-google)
-	(setq link
-		  (concat
-		   cpltxt \n  
-		   (format http://groups.google.com/groups?as_umsgid=%s;
-			   (org-fixup-message-id-for-http message-id
-	  (setq link (org-make-link gnus: group
-# (number-to-string article))
+	(if org-gnus-links-prefer-mairix
+	(if org-mairix-links-prefer-threaded
+		(setq link (org-make-link mairixt:m: (substring message-id 1 -1)))
+	  (setq link (org-make-link mairix:m: (substring message-id 1 -1
+	  (if (org-xor arg org-usenet-links-prefer-google)
+	  (setq link
+		(concat
+		 cpltxt \n  
+		 (format http://groups.google.com/groups?as_umsgid=%s;
+			 (org-fixup-message-id-for-http message-id
+	(setq link (org-make-link gnus: group
+# (number-to-string article)))
 
  ((eq major-mode 'w3-mode)
   (setq cpltxt (url-view-url t)
@@ -11105,6 +11121,12 @@ optional argument IN-EMACS is non-nil, E
((string= type news)
 	(org-follow-gnus-link path))
 
+   ((string= type mairix)
+	(org-follow-mairix-link path))
+
+   ((string= type mairixt)
+	(org-follow-mairix-link-thread path))
+
((string= type bbdb)
 	(org-follow-bbdb-link path))
 
@@ -11473,6 +11495,17 @@ onto the ring.
   (Info-find-node (match-string 1 name) Top)))
 (message (concat Could not open:  name
 
+; the following two org-follow-mairix functions should be generalised 
+; to deal with the different mail readers, right now they simply hook
+; into some primitive gnus glue
+(defun org-follow-mairix-link (string)
+  Follow a Mairix link to its string.
+  (mairix-search string))
+
+(defun org-follow-mairix-link-thread (string)
+  Follow a Mairix link to its string.
+  (mairix-search-thread string))
+
 (defun org-follow-gnus-link (optional group article)
   Follow a Gnus link to GROUP and ARTICLE.
   (require 'gnus)

But if someone feels like improving this so it can go into mainstream
org.el, that would be great.

Right now it needs some glue in your .gnus.el



binOBpAvi4mNQ.bin
Description: application/emacs-lisp

and you should configure .mairixrc to store its search results where
Gnus stores its nnmaildir data. Mine looks like this:

base=/home/greve
mbox=Archive/Mail/Auto/incoming/-??:Archive/Mail/Auto/outgoing/-??
mformat=maildir
mfolder=.nnmaildir/mairix
database=/home/greve/Tools/Gnus/MairixDB

With this you can store Org links as mairix links, including the
possibility to store links to emails that will pull the entire thread
that contains this message into the temporary buffer -- so you'll only
need to link to one and always get the entire thread.

For convenience it also makes sense to define some key bindings.

This gives as much functionality as normal Gnus integration otherwise,
although now it is no longer needed to know WHERE things are stored, as
mairix will find it regardless of final location.

So this