From ef219acd45897ff16e6aef404301fc7a1796071d Mon Sep 17 00:00:00 2001 From: Pieter Praet Date: Sun, 19 Feb 2012 21:50:25 +0100 Subject: [PATCH] [PATCH v6 1/3] emacs: `notmuch-show-get-message-id': optionally return Message-Id sans prefix --- 14/5cac84a902b472a66a0689c04f6a7bc5a17261 | 122 ++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 14/5cac84a902b472a66a0689c04f6a7bc5a17261 diff --git a/14/5cac84a902b472a66a0689c04f6a7bc5a17261 b/14/5cac84a902b472a66a0689c04f6a7bc5a17261 new file mode 100644 index 000000000..d3a0a94fb --- /dev/null +++ b/14/5cac84a902b472a66a0689c04f6a7bc5a17261 @@ -0,0 +1,122 @@ +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 78812431FCF + for ; Sun, 19 Feb 2012 12:52:48 -0800 (PST) +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 pZUZHLvKWsRy for ; + Sun, 19 Feb 2012 12:52:47 -0800 (PST) +Received: from mail-we0-f181.google.com (mail-we0-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 25D66431FAF + for ; Sun, 19 Feb 2012 12:52:47 -0800 (PST) +Received: by werp13 with SMTP id p13so3518419wer.26 + for ; Sun, 19 Feb 2012 12:52:45 -0800 (PST) +Received-SPF: pass (google.com: domain of pieter@praet.org designates + 10.216.134.157 as permitted sender) client-ip=10.216.134.157; +Authentication-Results: mr.google.com; + spf=pass (google.com: domain of pieter@praet.org + designates 10.216.134.157 as permitted sender) + smtp.mail=pieter@praet.org +Received: from mr.google.com ([10.216.134.157]) + by 10.216.134.157 with SMTP id s29mr3143375wei.1.1329684765872 + (num_hops = 1); Sun, 19 Feb 2012 12:52:45 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=gamma; + h=mime-version:from:to:cc:subject:date:message-id:x-mailer + :in-reply-to:references:x-gm-message-state; + bh=9S8DuL5mSSDlPJQAovbnpcyKJzu/vNDbN79bl7urdEs=; + b=qttsxHsLoBL9c2xajggAW2EIGCMnqwFGwGBDoKIG5xwnP2KUAFfSH6pILw+ccGoFaU + uNftMcFD3o6OOq9TazbItFoHzu5oTMr3vaOEkPho6+NwnY2cZX5VkYYdbzDPN0+1t7Xt + 6gelxtrePBtgHsNV7KBHhmLOf6wh1DvDgw1MQ= +MIME-Version: 1.0 +Received: by 10.216.134.157 with SMTP id s29mr2627341wei.1.1329684765794; + Sun, 19 Feb 2012 12:52:45 -0800 (PST) +Received: from localhost (104.218-242-81.adsl-dyn.isp.belgacom.be. + [81.242.218.104]) + by mx.google.com with ESMTPS id ec3sm11466948wib.1.2012.02.19.12.52.45 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 19 Feb 2012 12:52:45 -0800 (PST) +From: Pieter Praet +To: David Edmondson +Subject: [PATCH v6 1/3] emacs: `notmuch-show-get-message-id': optionally + return Message-Id sans prefix +Date: Sun, 19 Feb 2012 21:50:25 +0100 +Message-Id: <1329684627-10708-2-git-send-email-pieter@praet.org> +X-Mailer: git-send-email 1.7.8.1 +In-Reply-To: <1329684627-10708-1-git-send-email-pieter@praet.org> +References: <1327397873-20596-1-git-send-email-dme@dme.org> + <1329684627-10708-1-git-send-email-pieter@praet.org> +X-Gm-Message-State: + ALoCoQkAMV4YiuoTNWaTDraCa82iDGdJ4aghgn2+1PFwSeSFHQWyqgmuENRCMMAARAydTunUYuiQ +Cc: Notmuch Mail +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: Sun, 19 Feb 2012 20:52:48 -0000 + +* emacs/notmuch-show.el + + (notmuch-show-get-message-id): + Add optional arg BARE. When non-nil, return a Message-Id without + quotes and prefix, thus obviating the need to strip them off again + in various places. + + (notmuch-show-stash-message-id-stripped): + Update wrt changes in `notmuch-show-get-message-id'. +--- + emacs/notmuch-show.el | 13 +++++++++---- + 1 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index aa9ccee..cefad11 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -1329,9 +1329,14 @@ (defun notmuch-show-get-prop (prop &optional props) + (notmuch-show-get-message-properties)))) + (plist-get props prop))) + +-(defun notmuch-show-get-message-id () +- "Return the message id of the current message." +- (concat "id:\"" (notmuch-show-get-prop :id) "\"")) ++(defun notmuch-show-get-message-id (&optional bare) ++ "Return the Message-Id of the current message. ++ ++If optional argument BARE is non-nil, return ++the Message-Id without prefix and quotes." ++ (if bare ++ (notmuch-show-get-prop :id) ++ (concat "id:\"" (notmuch-show-get-prop :id) "\""))) + + (defun notmuch-show-get-messages-ids () + "Return all message ids of messages in the current thread." +@@ -1789,7 +1794,7 @@ (defun notmuch-show-stash-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))) ++ (notmuch-common-do-stash (notmuch-show-get-message-id t))) + + (defun notmuch-show-stash-subject () + "Copy Subject field of current message to kill-ring." +-- +1.7.8.1 + -- 2.26.2