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 8B955431FBC for ; Tue, 24 Nov 2009 12:22:10 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org 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 JPQ9yYHoV0Bm for ; Tue, 24 Nov 2009 12:22:10 -0800 (PST) Received: from mail-bw0-f224.google.com (mail-bw0-f224.google.com [209.85.218.224]) by olra.theworths.org (Postfix) with ESMTP id 36367431FAE for ; Tue, 24 Nov 2009 12:22:10 -0800 (PST) Received: by bwz24 with SMTP id 24so5337101bwz.30 for ; Tue, 24 Nov 2009 12:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=3xm/PgJm4QXOP+ATfLmYjGlTPlVqPBwbaOcXPAClmiA=; b=Zy2OV+nuiyik/9bUGxwdtkdz1HRkMvQTyRutecVJ8Fo1Cb7gXQbDkvcDytxDhqtXow 4c18XsUuP7iwCbaHPsZx2mgA0HRPoc4L3AMheOEV1SICwlNOzUWG1Bqu4FW9/TchnHD6 6iPyfy4X5EnPhbEjjfy/nRL28cxp1dSHKPxMg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=Gc9rS2IQEIJX6WdVE/Krh5WRXPCaZOdLs/R+8R5NeX3Rx+TTT7o/ATpl4L9KRB7K1k McnWOtoJgvffeCtTHhVCO2zjseOC0CNOp0/KxITRv6tzWEFiR/njljnmQ7pOE+C097/3 fSpTKIP4zxY4wN2q54vHdjpcqB8giuqv9V3xA= Received: by 10.204.2.196 with SMTP id 4mr3069078bkk.7.1259094128152; Tue, 24 Nov 2009 12:22:08 -0800 (PST) Received: from localhost.localdomain (vawpc43.ethz.ch [129.132.59.11]) by mx.google.com with ESMTPS id 21sm7650256fkx.25.2009.11.24.12.22.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 24 Nov 2009 12:22:07 -0800 (PST) Sender: Jed Brown From: Jed Brown To: notmuch@notmuchmail.org Date: Tue, 24 Nov 2009 21:22:11 +0100 Message-Id: <1259094131-32405-1-git-send-email-jed@59A2.org> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: References: Subject: [notmuch] [PATCH] New function notmuch-show-kill-ring-save-message-id. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 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: Tue, 24 Nov 2009 20:22:10 -0000 Puts current message ID in the kill ring. This is useful any time you want to explicitly refer to the message, such as in the body of another message, through git format-patch, or on IRC. It is bound to "C-c i". Corrected spelling of function name in commit message, and updated to apply against HEAD after c1e16435cfe4471c3415d9f625f7230d59c8afb4 Signed-off-by: Jed Brown --- notmuch.el | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/notmuch.el b/notmuch.el index 907df2c..e3e0e06 100644 --- a/notmuch.el +++ b/notmuch.el @@ -80,6 +80,7 @@ (define-key map "?" 'describe-mode) (define-key map (kbd "TAB") 'notmuch-show-next-button) (define-key map (kbd "M-TAB") 'notmuch-show-previous-button) + (define-key map (kbd "C-c i") 'notmuch-show-kill-ring-save-message-id) map) "Keymap for \"notmuch show\" buffers.") (fset 'notmuch-show-mode-map notmuch-show-mode-map) @@ -663,6 +664,17 @@ which this thread was originally shown." (notmuch-show-markup-message))) (notmuch-show-hide-markers)) +(defun notmuch-show-kill-ring-save-message-id () + "Put the current message id in the kill ring. + +This is useful for referencing messages or running external +queries." + (interactive) + (let ((message-id (notmuch-show-get-message-id))) + (kill-new message-id) + (when (called-interactively-p 'interactive) + (message "Saved message ID: \"%s\"" message-id)))) + ;;;###autoload (defun notmuch-show-mode () "Major mode for viewing a thread with notmuch. -- 1.6.5.3