notmuch-show-get-filename and maildir location
authormicah <micah@riseup.net>
Fri, 4 Feb 2011 00:15:22 +0000 (19:15 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:37:52 +0000 (09:37 -0800)
a7/649a5a613cf708456165f832b2cb14ea0d5030 [new file with mode: 0644]

diff --git a/a7/649a5a613cf708456165f832b2cb14ea0d5030 b/a7/649a5a613cf708456165f832b2cb14ea0d5030
new file mode 100644 (file)
index 0000000..ad4b2ef
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <micah@riseup.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 16CC5431FB6\r
+       for <notmuch@notmuchmail.org>; Thu,  3 Feb 2011 16:15:27 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.689\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.689 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7, T_MIME_NO_TEXT=0.01,\r
+       UNPARSEABLE_RELAY=0.001] 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 qTq1wlLt26VF for <notmuch@notmuchmail.org>;\r
+       Thu,  3 Feb 2011 16:15:26 -0800 (PST)\r
+Received: from mx1.riseup.net (mx1.riseup.net [204.13.164.18])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 9ECD5431FB5\r
+       for <notmuch@notmuchmail.org>; Thu,  3 Feb 2011 16:15:26 -0800 (PST)\r
+Received: from tern.riseup.net (tern-pn.riseup.net [10.0.1.12])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (Client CN "*.riseup.net", Issuer "Gandi Standard SSL CA" (verified OK))\r
+       by mx1.riseup.net (Postfix) with ESMTPS id D80AA25EC22\r
+       for <notmuch@notmuchmail.org>; Thu,  3 Feb 2011 16:15:23 -0800 (PST)\r
+Received: from [127.0.0.1] (localhost [127.0.0.1])\r
+       (Authenticated sender: micah@tern.riseup.net)\r
+       with ESMTPSA id DBC3114C16F\r
+Received: by algae (Postfix, from userid 1000)\r
+       id 2D752419FD; Thu,  3 Feb 2011 19:15:23 -0500 (EST)\r
+From: micah <micah@riseup.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: notmuch-show-get-filename and maildir location\r
+Date: Thu, 03 Feb 2011 19:15:22 -0500\r
+Message-ID: <874o8kk63p.fsf@algae.riseup.net>\r
+MIME-Version: 1.0\r
+Content-Type: multipart/signed; boundary="=-=-=";\r
+       micalg=pgp-sha512; protocol="application/pgp-signature"\r
+X-Virus-Scanned: clamav-milter 0.96.5 at mx1\r
+X-Virus-Status: Clean\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: Fri, 04 Feb 2011 00:15:27 -0000\r
+\r
+--=-=-=\r
+Content-Transfer-Encoding: quoted-printable\r
+\r
+\r
+I recently upgraded to the newer notmuch to test out the new folder\r
+patch (its great!) and the new decryption/signature verification (its\r
+fantastic!), and noticed something odd start happening.\r
+\r
+I think that notmuch moves a new message to the maildir cur directory,\r
+From=20the new directory when you first read it. Is that right? This is\r
+actually what I would expect with maildirs, but notmuch wasn't doing\r
+this before.\r
+\r
+The reason why I care is because if I open a message,\r
+notmuch-show-get-filename tells me that the file is located in the\r
+'new/' path, but it is actually not there at all, looking around it\r
+appears to be in the 'cur/' directory.=20\r
+\r
+This is because I made a function to let me do bayes training by putting\r
+mistaken emails in my Mistakes folder, so that they can be retrained:\r
+\r
+(defun notmuch-mark-as-mistake ()\r
+"Moves the current message into the Mistakes folder"\r
+  (interactive)\r
+(let* ((fullpath (notmuch-show-get-filename))\r
+      (filename (file-name-nondirectory fullpath)))\r
+      (save-excursion\r
+(rename-file fullpath (concat "/home/micah/Maildir/INBOX.Mistakes/new/" fil=\r
+ename)))\r
+(notmuch-show-archive-thread-then-exit)\r
+(notmuch-search-refresh-view)\r
+(hl-line-mode 1)(hl-line-mode 1)))\r
+\r
+(define-key notmuch-show-mode-map (kbd "S") 'notmuch-mark-as-mistake)\r
+\r
+if I hit the 'S' key on a message now, it complains that it cannot\r
+rename the file because it doesn't exist.\r
+\r
+Incidentally, does anyone know how I can do this without having to\r
+actually do a notmuch-show on the message? Most spam I can recognize by\r
+the subject in my inbox, and I dont need to open it to see that.\r
+\r
+micah\r
+\r
+--=-=-=\r
+Content-Type: application/pgp-signature\r
+\r
+-----BEGIN PGP SIGNATURE-----\r
+Version: GnuPG v1.4.10 (GNU/Linux)\r
+\r
+iQIcBAEBCgAGBQJNS0UaAAoJEIy/mjIoYaeQKM8P/jYB+hnpB8IHCAcPG5WYO7y5\r
+1kaDT7w+gUUknp4BaoPapWT0QJhPH+6bJ2Rdn/Nn31W2sPBr8T88Wh4op+pRPgk1\r
+pB0eVPCV+wT7ZulqiaXzt1fI45b0ywdcwbt8SxdSt90MPXmxfIwIyRODyNs9zuaj\r
+7m0o558TMKOUrc2LVgICxQquiZskk3tpEDOBSWCw7gDipiUrCRzngcWGmP/WLedC\r
+G3PMok9IdAWL3SNUgoUe3xs62xzvoGpnr36yIyMLaim7o5ijQbdhG/Md5z6zpQgY\r
+Zfa5igdrTY0HAqefC/K4Qc+wuxUPcfxMWSuUFHgQNDVbdS96Z4NfGCFiGT40lCd0\r
+3XDxab10t484WxsPob2a8m+mfnnQeCu313zIvLfUPe56OY82nqr0Te7d8B501+V4\r
+ZN2BB872MW1vC+AZJS3bDTcJa8MDjvQzMCtcNiUFIdav1CtOEBOmzQgg0Hup7V3/\r
+/ERWJk/cjFWHrr3WTuz2anqibVgWWX5yeS3QpHSVn9C6gJcm5KIvtNI8BQZkF0r2\r
+ok/HbLvybW9FdagsXcMPpSE7n/5qNoAHd7Fqh1pKaR/GFRZC9Mq+5MM06rsJE1Ip\r
+a+4Bu/DukK6loOVxQdmAe4Hhr1ZOAOPiZD94sTa4V16v5BU5wF/af37cdL0EWHZe\r
+41/KBNSsS+D7FY8khJVB\r
+=NNsh\r
+-----END PGP SIGNATURE-----\r
+--=-=-=--\r