[PATCH 1/2] emacs: mv notmuch-{show,common}-do-stash
authorJameson Rollins <jrollins@finestructure.net>
Sat, 18 Sep 2010 19:48:21 +0000 (15:48 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:13 +0000 (09:37 -0800)
98/3b9697c9171822e014dedefe6c80a54c5e7d24 [new file with mode: 0644]

diff --git a/98/3b9697c9171822e014dedefe6c80a54c5e7d24 b/98/3b9697c9171822e014dedefe6c80a54c5e7d24
new file mode 100644 (file)
index 0000000..8d763b1
--- /dev/null
@@ -0,0 +1,147 @@
+Return-Path: <jrollins@finestructure.net>\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 DE34840BFD5\r
+       for <notmuch@notmuchmail.org>; Sat, 18 Sep 2010 12:49:05 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -4.2\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
+       tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=ham\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 yZxN4hpOiCb5 for <notmuch@notmuchmail.org>;\r
+       Sat, 18 Sep 2010 12:48:53 -0700 (PDT)\r
+Received: from brinza.cc.columbia.edu (brinza.cc.columbia.edu [128.59.29.8])\r
+       by olra.theworths.org (Postfix) with ESMTP id EC24340BFD3\r
+       for <notmuch@notmuchmail.org>; Sat, 18 Sep 2010 12:48:52 -0700 (PDT)\r
+Received: from servo.finestructure.net (cpe-67-243-144-42.nyc.res.rr.com\r
+       [67.243.144.42])\r
+       (user=jgr2110 author=jrollins@finestructure.net mech=PLAIN bits=0)\r
+       by brinza.cc.columbia.edu (8.14.4/8.14.3) with ESMTP id o8IJmoHi001538\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)\r
+       for <notmuch@notmuchmail.org>; Sat, 18 Sep 2010 15:48:52 -0400 (EDT)\r
+Received: from jrollins by servo.finestructure.net with local (Exim 4.72)\r
+       (envelope-from <jrollins@finestructure.net>)\r
+       id 1Ox3P0-00080G-6w; Sat, 18 Sep 2010 15:48:50 -0400\r
+From: Jameson Rollins <jrollins@finestructure.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] emacs: mv notmuch-{show,common}-do-stash\r
+Date: Sat, 18 Sep 2010 15:48:21 -0400\r
+Message-Id: <1284839302-30583-1-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.1\r
+X-No-Spam-Score: Local\r
+X-Scanned-By: MIMEDefang 2.68 on 128.59.29.8\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: Sat, 18 Sep 2010 19:49:06 -0000\r
+\r
+Here we move the notmuch-show/notmuch-show-do-stash function to\r
+notmuch-lib/notmuch-common-do-stash.  Nothing in this function is\r
+notmuch-show mode specific, so this move will make it cleaner to be\r
+used by other modes (such as notmuch-search).\r
+---\r
+ emacs/notmuch-lib.el  |    8 ++++++++\r
+ emacs/notmuch-show.el |   20 ++++++++------------\r
+ 2 files changed, 16 insertions(+), 12 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index f30bcb4..9fb15ca 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -70,6 +70,13 @@ the user hasn't set this variable with the old or new value."\r
\r
+ ;;\r
\r
++(defun notmuch-common-do-stash (text)\r
++  "Common function to stash text in kill ring, and display in minibuffer."\r
++  (kill-new text)\r
++  (message "Stashed: %s" text))\r
++\r
++;;\r
++\r
+ ;; XXX: This should be a generic function in emacs somewhere, not\r
+ ;; here.\r
+ (defun point-invisible-p ()\r
+@@ -86,3 +93,4 @@ within the current window."\r
+         (assq prop buffer-invisibility-spec)))))\r
\r
+ (provide 'notmuch-lib)\r
++\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index b0c1f63..b88267d 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1012,49 +1012,45 @@ buffer."\r
+   (interactive)\r
+   (notmuch-show-archive-thread-internal nil))\r
\r
+-(defun notmuch-show-do-stash (text)\r
+-  (kill-new text)\r
+-  (message "Saved: %s" text))\r
+-\r
+ (defun notmuch-show-stash-cc ()\r
+   "Copy CC field of current message to kill-ring."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (notmuch-show-get-cc)))\r
++  (notmuch-common-do-stash (notmuch-show-get-cc)))\r
\r
+ (defun notmuch-show-stash-date ()\r
+   "Copy date of current message to kill-ring."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (notmuch-show-get-date)))\r
++  (notmuch-common-do-stash (notmuch-show-get-date)))\r
\r
+ (defun notmuch-show-stash-filename ()\r
+   "Copy filename of current message to kill-ring."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (notmuch-show-get-filename)))\r
++  (notmuch-common-do-stash (notmuch-show-get-filename)))\r
\r
+ (defun notmuch-show-stash-from ()\r
+   "Copy From address of current message to kill-ring."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (notmuch-show-get-from)))\r
++  (notmuch-common-do-stash (notmuch-show-get-from)))\r
\r
+ (defun notmuch-show-stash-message-id ()\r
+   "Copy message ID of current message to kill-ring."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (notmuch-show-get-message-id)))\r
++  (notmuch-common-do-stash (notmuch-show-get-message-id)))\r
\r
+ (defun notmuch-show-stash-subject ()\r
+   "Copy Subject field of current message to kill-ring."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (notmuch-show-get-subject)))\r
++  (notmuch-common-do-stash (notmuch-show-get-subject)))\r
\r
+ (defun notmuch-show-stash-tags ()\r
+   "Copy tags of current message to kill-ring as a comma separated list."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))\r
++  (notmuch-common-do-stash (mapconcat 'identity (notmuch-show-get-tags) ",")))\r
\r
+ (defun notmuch-show-stash-to ()\r
+   "Copy To address of current message to kill-ring."\r
+   (interactive)\r
+-  (notmuch-show-do-stash (notmuch-show-get-to)))\r
++  (notmuch-common-do-stash (notmuch-show-get-to)))\r
\r
+ ;; Commands typically bound to buttons.\r
\r
+-- \r
+1.7.1\r
+\r