Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 17409431FAF for ; Fri, 24 May 2013 04:39:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HFmjtrhIJcuT for ; Fri, 24 May 2013 04:39:06 -0700 (PDT) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6E843431FAE for ; Fri, 24 May 2013 04:39:06 -0700 (PDT) Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id r4OBd09g031715; Fri, 24 May 2013 08:39:01 -0300 Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net ([156.34.82.78] helo=zancas.localnet) by tesseract.cs.unb.ca with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1UfqKq-0005k0-0s; Fri, 24 May 2013 08:39:00 -0300 Received: from bremner by zancas.localnet with local (Exim 4.80) (envelope-from ) id 1UfqKk-0001Wn-Br; Fri, 24 May 2013 08:38:54 -0300 From: David Bremner To: David Belohrad , notmuch Subject: Re: converting notmuch email to 'TODO' entry in org-mode In-Reply-To: References: User-Agent: Notmuch/0.15.2+114~g3b2344e (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Fri, 24 May 2013 08:38:54 -0300 Message-ID: <87li74obe9.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-Spam_bar: - X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 May 2013 11:39:14 -0000 David Belohrad writes: > > is there any way how to get 'current email' (not current thread) > contents into kill ring so I could write a small script to paste it into > org-mode template? Here is what I came up with by canibalizing existing functions. Probably there is a more elegant way to do this. (defun notmuch-show-stash-body () (interactive) (let ((all (buffer-substring (notmuch-show-message-top) (notmuch-show-message-bottom)))) (with-temp-buffer (insert all) ;; Remove the original header. (goto-char (point-min)) (re-search-forward "^$" (point-max) nil) (delete-region (point-min) (point)) (notmuch-common-do-stash (buffer-string)))))