[PATCH v2 1/2] emacs: `notmuch-show-get-message-id': optionally return Message-Id...
authorPieter Praet <pieter@praet.org>
Mon, 30 Jan 2012 07:12:53 +0000 (08:12 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:43:36 +0000 (09:43 -0800)
ea/eb6bdc6ddb7a506a14c065872758b75d3aa9f2 [new file with mode: 0644]

diff --git a/ea/eb6bdc6ddb7a506a14c065872758b75d3aa9f2 b/ea/eb6bdc6ddb7a506a14c065872758b75d3aa9f2
new file mode 100644 (file)
index 0000000..6983f15
--- /dev/null
@@ -0,0 +1,101 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7F02E429E4E\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 23:15:01 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id RxiPwJoOtxGI for <notmuch@notmuchmail.org>;\r
+       Sun, 29 Jan 2012 23:15:01 -0800 (PST)\r
+Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com\r
+       [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id E1C41431FBC\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 23:15:00 -0800 (PST)\r
+Received: by wibhi8 with SMTP id hi8so3322964wib.26\r
+       for <notmuch@notmuchmail.org>; Sun, 29 Jan 2012 23:14:59 -0800 (PST)\r
+Received: by 10.180.90.194 with SMTP id by2mr2148704wib.5.1327907699746;\r
+       Sun, 29 Jan 2012 23:14:59 -0800 (PST)\r
+Received: from localhost ([109.131.39.11])\r
+       by mx.google.com with ESMTPS id dr5sm49669065wib.0.2012.01.29.23.14.59\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sun, 29 Jan 2012 23:14:59 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: David Edmondson <dme@dme.org>\r
+Subject: [PATCH v2 1/2] emacs: `notmuch-show-get-message-id': optionally\r
+       return Message-Id sans prefix\r
+Date: Mon, 30 Jan 2012 08:12:53 +0100\r
+Message-Id: <1327907574-12760-1-git-send-email-pieter@praet.org>\r
+X-Mailer: git-send-email 1.7.8.1\r
+In-Reply-To: <1327397873-20596-1-git-send-email-dme@dme.org>\r
+References: <1327397873-20596-1-git-send-email-dme@dme.org>\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 30 Jan 2012 07:15:01 -0000\r
+\r
+* emacs/notmuch-show.el\r
+\r
+  (notmuch-show-get-message-id):\r
+    Add optional arg BARE.  When non-nil, return a Message-Id without\r
+    quotes and prefix, thus obviating the need to strip them off again\r
+    in various places.\r
+\r
+  (notmuch-show-stash-message-id-stripped):\r
+    Update wrt changes in `notmuch-show-get-message-id'.\r
+\r
+---\r
+ emacs/notmuch-show.el |   13 +++++++++----\r
+ 1 files changed, 9 insertions(+), 4 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 84ac624..b13d088 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1216,9 +1216,14 @@ Some useful entries are:\r
+                  (notmuch-show-get-message-properties))))\r
+     (plist-get props prop)))\r
+ \r
+-(defun notmuch-show-get-message-id ()\r
+-  "Return the message id of the current message."\r
+-  (concat "id:\"" (notmuch-show-get-prop :id) "\""))\r
++(defun notmuch-show-get-message-id (&optional bare)\r
++  "Return the Message-Id of the current message.\r
++\r
++If optional argument BARE is non-nil, return\r
++the Message-Id without prefix and quotes."\r
++  (if bare\r
++      (notmuch-show-get-prop :id)\r
++    (concat "id:\"" (notmuch-show-get-prop :id) "\"")))\r
+ \r
+ ;; dme: Would it make sense to use a macro for many of these?\r
+ \r
+@@ -1618,7 +1623,7 @@ buffer."\r
+ (defun notmuch-show-stash-message-id-stripped ()\r
+   "Copy message ID of current message (sans `id:' prefix) to kill-ring."\r
+   (interactive)\r
+-  (notmuch-common-do-stash (substring (notmuch-show-get-message-id) 4 -1)))\r
++  (notmuch-common-do-stash (notmuch-show-get-message-id t)))\r
+ \r
+ (defun notmuch-show-stash-subject ()\r
+   "Copy Subject field of current message to kill-ring."\r
+-- \r
+1.7.8.1\r
+\r