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 65CDF41ED8F for ; Thu, 30 Jun 2011 01:20:57 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 CL7eDGPOVK+Q for ; Thu, 30 Jun 2011 01:20:56 -0700 (PDT) Received: from mail-wy0-f181.google.com (mail-wy0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 96A8641ED8E for ; Thu, 30 Jun 2011 01:20:56 -0700 (PDT) Received: by wyh22 with SMTP id 22so1529362wyh.26 for ; Thu, 30 Jun 2011 01:20:55 -0700 (PDT) Received: by 10.216.10.132 with SMTP id 4mr1536367wev.38.1309422055377; Thu, 30 Jun 2011 01:20:55 -0700 (PDT) Received: from localhost ([109.131.21.173]) by mx.google.com with ESMTPS id u38sm189024weq.13.2011.06.30.01.20.53 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 30 Jun 2011 01:20:54 -0700 (PDT) From: Pieter Praet To: notmuch@notmuchmail.org Subject: [PATCH] emacs: add keybind and function to stash Message-ID without prefix Date: Thu, 30 Jun 2011 10:20:50 +0200 Message-Id: <1309422050-23241-1-git-send-email-pieter@praet.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <877hbiep5g.fsf@SSpaeth.de> References: <877hbiep5g.fsf@SSpaeth.de> 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: Thu, 30 Jun 2011 08:20:57 -0000 Add function `notmuch-show-stash-message-id-stripped' which stashes a Message-ID after ripping off the prefix and quotes, add bind it to "I" key in `notmuch-show-stash-map'. Simplifying `notmuch-show-get-message-id' instead might seem better, but that would require concat'ing in 9 places instead of 1. Signed-off-by: Pieter Praet --- emacs/notmuch-show.el | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 6685717..a703732 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -858,6 +858,7 @@ function is used. " (define-key map "F" 'notmuch-show-stash-filename) (define-key map "f" 'notmuch-show-stash-from) (define-key map "i" 'notmuch-show-stash-message-id) + (define-key map "I" 'notmuch-show-stash-message-id-stripped) (define-key map "s" 'notmuch-show-stash-subject) (define-key map "T" 'notmuch-show-stash-tags) (define-key map "t" 'notmuch-show-stash-to) @@ -1408,6 +1409,11 @@ buffer." (interactive) (notmuch-common-do-stash (notmuch-show-get-message-id))) +(defun notmuch-show-stash-message-id-stripped () + "Copy message ID of current message (sans `id:' prefix) to kill-ring." + (interactive) + (notmuch-common-do-stash (substring (notmuch-show-get-message-id) 4 -1))) + (defun notmuch-show-stash-subject () "Copy Subject field of current message to kill-ring." (interactive) -- 1.7.4.1