[PATCH] emacs: do not modify subject in search or show
authorJameson Graef Rollins <jrollins@finestructure.net>
Sun, 15 Apr 2012 00:08:27 +0000 (17:08 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:25 +0000 (09:46 -0800)
7c/1409bf80b81b57360ea3c5094d8426e804a905 [new file with mode: 0644]

diff --git a/7c/1409bf80b81b57360ea3c5094d8426e804a905 b/7c/1409bf80b81b57360ea3c5094d8426e804a905
new file mode 100644 (file)
index 0000000..bb77d77
--- /dev/null
@@ -0,0 +1,137 @@
+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 78BBE431FDB\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 17:08:43 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] 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 UPa3gD7V7mrv for <notmuch@notmuchmail.org>;\r
+       Sat, 14 Apr 2012 17:08:32 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id 176DA431FAE\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 17:08:32 -0700 (PDT)\r
+Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by fire-doxen-postvirus (Postfix) with ESMTP id B3078328032\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 17:08:29 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
+Received: from finestructure.net (unknown [76.89.193.65])\r
+       (Authenticated sender: jrollins)\r
+       by fire-doxen-submit (Postfix) with ESMTP id BC8C132802A\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Apr 2012 17:08:27 -0700 (PDT)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id 4E81F45D; Sat, 14 Apr 2012 17:08:27 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH] emacs: do not modify subject in search or show\r
+Date: Sat, 14 Apr 2012 17:08:27 -0700\r
+Message-Id: <1334448507-16877-1-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.9.5\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: Sun, 15 Apr 2012 00:08:43 -0000\r
+\r
+A previous patch [0] replaced blank subject lines with '[No Subject]'\r
+in search and show mode.  Apparently this was needed to circumvent\r
+some bug in the printing code, but there was no need for it search or\r
+show, and it is definitely not desirable, so we undo it here (a revert\r
+is no longer feasible).  We should not be modifying strings in the\r
+original message without good reason, or without a clear indication\r
+that we are doing so, neither of which apply in this case.  For\r
+further discussion see [0].\r
+\r
+[0] id:"1327918561-16245-3-git-send-email-dme@dme.org"\r
+---\r
+ emacs/notmuch-print.el |    4 ++--\r
+ emacs/notmuch-show.el  |    5 +----\r
+ emacs/notmuch.el       |    5 ++---\r
+ 3 files changed, 5 insertions(+), 9 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-print.el b/emacs/notmuch-print.el\r
+index 6653d97..81b2ef0 100644\r
+--- a/emacs/notmuch-print.el\r
++++ b/emacs/notmuch-print.el\r
+@@ -60,7 +60,7 @@ Optional OUTPUT allows passing a list of flags to muttprint."\r
\r
+ (defun notmuch-print-ps-print (msg)\r
+   "Print a message buffer using the ps-print package."\r
+-  (let ((subject (notmuch-prettify-subject\r
++  (let ((subject (notmuch-print-prettify-subject\r
+                 (plist-get (notmuch-show-get-prop :headers msg) :Subject))))\r
+     (rename-buffer subject t)\r
+     (ps-print-buffer)))\r
+@@ -68,7 +68,7 @@ Optional OUTPUT allows passing a list of flags to muttprint."\r
+ (defun notmuch-print-ps-print/evince (msg)\r
+   "Preview a message buffer using ps-print and evince."\r
+   (let ((ps-file (make-temp-file "notmuch"))\r
+-      (subject (notmuch-prettify-subject\r
++      (subject (notmuch-print-prettify-subject\r
+                 (plist-get (notmuch-show-get-prop :headers msg) :Subject))))\r
+     (rename-buffer subject t)\r
+     (ps-print-buffer ps-file)\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 30b26d1..1e55099 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -1075,7 +1075,7 @@ function is used."\r
+       (run-hooks 'notmuch-show-hook))\r
\r
+     ;; Set the header line to the subject of the first message.\r
+-    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-pretty-subject)))))\r
++    (setq header-line-format (notmuch-show-strip-re (notmuch-show-get-subject)))))\r
\r
+ (defun notmuch-show-capture-state ()\r
+   "Capture the state of the current buffer.\r
+@@ -1375,9 +1375,6 @@ current thread."\r
+ (defun notmuch-show-get-depth ()\r
+   (notmuch-show-get-prop :depth))\r
\r
+-(defun notmuch-show-get-pretty-subject ()\r
+-  (notmuch-prettify-subject (notmuch-show-get-subject)))\r
+-\r
+ (defun notmuch-show-set-tags (tags)\r
+   "Set the tags of the current message."\r
+   (notmuch-show-set-prop :tags tags)\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index ba833e6..326645d 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -507,7 +507,7 @@ Complete list of currently available key bindings:\r
+   "Display the currently selected thread."\r
+   (interactive)\r
+   (let ((thread-id (notmuch-search-find-thread-id))\r
+-      (subject (notmuch-prettify-subject (notmuch-search-find-subject))))\r
++      (subject (notmuch-search-find-subject)))\r
+     (if (> (length thread-id) 0)\r
+       (notmuch-show thread-id\r
+                     (current-buffer)\r
+@@ -877,8 +877,7 @@ non-authors is found, assume that all of the authors match."\r
+                     ;; We currently just throw away excluded matches.\r
+                     (unless (eq (aref count 1) ?0)\r
+                       (let ((beg (point)))\r
+-                        (notmuch-search-show-result date count authors\r
+-                                                    (notmuch-prettify-subject subject) tags)\r
++                        (notmuch-search-show-result date count authors subject tags)\r
+                         (notmuch-search-color-line beg (point) tag-list)\r
+                         (put-text-property beg (point) 'notmuch-search-thread-id thread-id)\r
+                         (put-text-property beg (point) 'notmuch-search-authors authors)\r
+-- \r
+1.7.9.5\r
+\r