From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Patterson Subject: Re: keeping track of sent emails in org? Date: Tue, 28 Oct 2008 11:46:27 -0700 Message-ID: <87zlkoeews.fsf@transitory.lefae.org> References: <871vy3tg9x.fsf@wolfram.com> <0127F599-13B2-4907-AF1C-5637B84367FF@uva.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kutdp-0008GO-6y for emacs-orgmode@gnu.org; Tue, 28 Oct 2008 14:50:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kutdn-0008G5-LH for emacs-orgmode@gnu.org; Tue, 28 Oct 2008 14:50:08 -0400 Received: from [199.232.76.173] (port=35374 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kutdn-0008G2-FZ for emacs-orgmode@gnu.org; Tue, 28 Oct 2008 14:50:07 -0400 Received: from main.gmane.org ([80.91.229.2]:45465 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Kutdm-0008RG-KS for emacs-orgmode@gnu.org; Tue, 28 Oct 2008 14:50:07 -0400 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1Kutdi-0008Mp-VS for emacs-orgmode@gnu.org; Tue, 28 Oct 2008 18:50:03 +0000 Received: from rpatterson.net ([69.12.174.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Oct 2008 18:50:02 +0000 Received: from me by rpatterson.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 28 Oct 2008 18:50:02 +0000 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: emacs-orgmode@gnu.org --=-=-= Carsten Dominik writes: > I think there are interesting ideas coming up in this tasks, in > particular the question if message IDs can be used to find articles in > gnus, even if they have been moved around. I am not sure if this > questions has been fully answered, but I have not read the thread > carefully enough yet, and certainly not tried Michaels code. Just to comment on this little bit, I have local modifications that make org links use the Messags-Id instead of the article number since article numbers changes often in my setup. I've been meaning to blog about it but since I haven't gotten to it, here's the file containing the necessary code just in case its useful to anyone. Ross --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=rpatterson-org.el (require 'org-gnus) (defun org-gnus-store-link () "Store a link to a Gnus folder or message. Modified to store message IDs." (cond ((eq major-mode 'gnus-group-mode) (let ((group (cond ((fboundp 'gnus-group-group-name) ; depending on Gnus (gnus-group-group-name)) ; version ((fboundp 'gnus-group-name) (gnus-group-name)) (t "???"))) desc link) (unless group (error "Not on a group")) (org-store-link-props :type "gnus" :group group) (setq desc (concat (if (org-xor current-prefix-arg org-usenet-links-prefer-google) "http://groups.google.com/groups?group=" "gnus:") group) link (org-make-link desc)) (org-add-link-props :link link :description desc) link)) ((memq major-mode '(gnus-summary-mode gnus-article-mode)) (and (eq major-mode 'gnus-article-mode) (gnus-article-show-summary)) (let* ((group gnus-newsgroup-name) (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)) desc link) (org-store-link-props :type "gnus" :from from :subject subject :message-id message-id :group group) (setq desc (org-email-link-description)) (if (org-xor current-prefix-arg org-usenet-links-prefer-google) (setq link (concat desc "\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 "#" message-id))) (org-add-link-props :link link :description desc) link)))) (defun org-gnus-follow-link (&optional group article) "Follow a Gnus link to GROUP and ARTICLE." (require 'gnus) (funcall (cdr (assq 'gnus org-link-frame-setup))) (if gnus-other-frame-object (select-frame gnus-other-frame-object)) (cond ((and group article) (gnus-group-read-group 1 nil group) (gnus-summary-goto-article article nil t)) (group (gnus-group-jump-to-group group)))) (defun rpatterson/gnus-no-new-news () "Like `M-x gnus' but doesn't check for new news." (if (not (gnus-alive-p)) (gnus))) (defun rpatterson/org-patch-link-frame-setup () "Add rpatterson/gnus-no-new-news to the choices for gnus links" (dolist (elt (cdr (get 'org-link-frame-setup 'custom-type))) (if (eq (cadadr elt) 'gnus) (let ((choices (cdaddr elt))) (nconc choices '((const rpatterson/gnus-no-new-news))))))) (provide 'rpatterson-org) --=-=-= 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 --=-=-=--