From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: Capturing outgoing gnus e-mail Date: Sat, 14 Jun 2014 11:05:18 +0200 Message-ID: <87mwdfg8tt.fsf@bzg.ath.cx> References: <8761k3rivi.fsf@kanis.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wvjtx-0001K6-0f for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 05:05:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wvjtq-0002JL-NT for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 05:05:28 -0400 Received: from mail-s76.mailgun.info ([184.173.153.204]:43749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wvjtq-0002J9-HI for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 05:05:22 -0400 In-Reply-To: <8761k3rivi.fsf@kanis.fr> (Ivan Kanis's message of "Sat, 14 Jun 2014 10:32:49 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ivan Kanis Cc: org mode , Gnus General Hi Ivan, this is what I use : ======================================================================== ;; Hack to store Org links upon sending Gnus messages (defun bzg-message-send-and-org-gnus-store-link (&optional arg) "Send message with `message-send-and-exit' and store org link to message copy. If multiple groups appear in the Gcc header, the link refers to the copy in the last group." (interactive "P") (save-excursion (save-restriction (message-narrow-to-headers) (let ((gcc (car (last (message-unquote-tokens (message-tokenize-header (mail-fetch-field "gcc" nil t) " ,"))))) (buf (current-buffer)) (message-kill-buffer-on-exit nil) id to from subject desc link newsgroup xarchive) (message-send-and-exit arg) (or ;; gcc group found ... (and gcc (save-current-buffer (progn (set-buffer buf) (setq id (org-remove-angle-brackets (mail-fetch-field "Message-ID"))) (setq to (mail-fetch-field "To")) (setq from (mail-fetch-field "From")) (setq subject (mail-fetch-field "Subject")))) (org-store-link-props :type "gnus" :from from :subject subject :message-id id :group gcc :to to) (setq desc (org-email-link-description)) (setq link (org-gnus-article-link gcc newsgroup id xarchive)) (setq org-stored-links (cons (list link desc) org-stored-links))) ;; no gcc group found ... (message "Can not create Org link: No Gcc header found.")))))) (define-key message-mode-map [(control c) (control meta c)] 'bzg-message-send-and-org-gnus-store-link) ======================================================================== Then, in a message, I use C-c C-M-c instead of C-c C-c to send the message and create a link to it that I can reinsert later one. This is not really capturing, but it's good enough for my needs. HTH, -- Bastien