From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Georg C. F. Greve" Subject: Re: Integration of Org mode and mairix Date: Mon, 24 Sep 2007 19:38:32 +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> <388c72288e3d9901c132aa791e9f6fbf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0018030116==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IZrtf-0001eR-3I for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 13:39:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IZrtd-0001dR-DE for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 13:39:02 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IZrtd-0001dD-8r for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 13:39:01 -0400 Received: from gadolin.fsfeurope.org ([195.176.254.152]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IZrtc-0001Fo-Pg for emacs-orgmode@gnu.org; Mon, 24 Sep 2007 13:39:01 -0400 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: Carsten Dominik Cc: emacs-orgmode@gnu.org --===============0018030116== Content-Type: multipart/signed; boundary="20070924193832+0200-217783845209202051-4142752"; micalg=pgp-sha1; protocol="application/pgp-signature" --20070924193832+0200-217783845209202051-4142752 Content-Type: multipart/mixed; boundary="20070924193832+020016980882-211363146-249388467" --20070924193832+020016980882-211363146-249388467 Content-Transfer-Encoding: quoted-printable On Sun, 23 Sep 2007 15:05:31 -0700 Carsten Dominik wrote:=20 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 --20070924193832+020016980882-211363146-249388467 Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=org-mairix-gnus.el Content-Transfer-Encoding: quoted-printable ;;; org-mairix-gnus.el - Support for hooking mairix search into Org for Gnu= s users (require 'org) (require 'gnus) (require 'gnus-sum) (defvar mairix-gnus-results-group "nnmaildir:mairix") (org-add-link-type "mairix" 'org-mairix-gnus-open) (add-hook 'org-store-link-functions 'org-mairix-store-gnus-link) (defun org-mairix-store-gnus-link () "Store a link to the current message as a Mairix search for its Message I= D." (when (memq major-mode '(gnus-summary-mode gnus-article-mode)) (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary)) (let* ((article (gnus-summary-article-number)) (header (gnus-summary-article-header article)) (from (mail-header-from header)) (message-id (mail-header-id header)) (date (mail-header-date header)) (subject (gnus-summary-subject-string))) (org-store-link-props :type "mairix" :from from :subject subject :message-id message-id ) (setq cpltxt (org-email-link-description)) (org-store-link-props :link (concat "mairix:m:" (org-remove-angle-bra= ckets message-id)) :description cpltxt)))) (defun org-mairix-gnus-result-evaluate-and-display (string) "Evaluate result of mairix to determine success and enters buffer. Inform= s user." (setq mmatches (string-to-number (substring string 7 -8))) (if (eq mmatches 0) (message "Link failed: no matches, sorry.") (message "Link returned %d matches." mmatches) (gnus-group-quick-select-group 0 mairix-gnus-results-group) (gnus-summary-reselect-current-group t t))) (defun org-mairix-gnus-open (path) "Open a mairix link in gnus." (org-mairix-gnus-result-evaluate-and-display (shell-command-to-string (concat "mairix " path)))) (provide 'org-mairix-gnus) ;;; org-man.el ends here --20070924193832+020016980882-211363146-249388467 Content-Transfer-Encoding: quoted-printable =2D-=20 Georg C. F. Greve 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) --20070924193832+020016980882-211363146-249388467-- --20070924193832+0200-217783845209202051-4142752 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iQCVAwUBRvf2GCk9sUy32wQcAQJ6MwP8DBYXW8U45wZleNJdp4rPvkLXz/x2rYjv GT6c7nGOrxxbo0lyOiP5EXeBmMZr+S/sFIXxTezOO4dpsgrpcLYqBbEOr4WT1HvY wygQEOeUXgLxLtrNiYXyWgkN4qVec+rsSCANJH4nyBN2dMGhK+ezp1LOUqyI/u3n lN1pO1TYcYs= =T7Cs -----END PGP SIGNATURE----- --20070924193832+0200-217783845209202051-4142752-- --===============0018030116== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============0018030116==--