--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\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 8EE83431FAF\r
+ for <notmuch@notmuchmail.org>; Wed, 5 Jun 2013 00:48:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+ 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 0n2f46Jq49C7 for <notmuch@notmuchmail.org>;\r
+ Wed, 5 Jun 2013 00:48:41 -0700 (PDT)\r
+Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com\r
+ [209.85.212.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id AB6F6431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 5 Jun 2013 00:48:41 -0700 (PDT)\r
+Received: by mail-wi0-f171.google.com with SMTP id hm9so1529668wib.4\r
+ for <notmuch@notmuchmail.org>; Wed, 05 Jun 2013 00:48:39 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer;\r
+ bh=6Opny4hGdBbTAkssxN5thYSmIpZms6znsDWWw4rd258=;\r
+ b=cvdTjL7ZISU2exEPrNKkfGuOnFHwCDnWJNeYLFF+QIWGk+6hQ9AXGNbFlwR656MQGr\r
+ +pJLMJGVeOTUr42Smsf9ZVYfTy7yHl6acVg9qhu4Q/jck1YGNr0vO9FiPJuxmIwo8nv2\r
+ hLGyRIXX7Li6i+5Oxcmv1AmXWdWPI9yeoKLlAraLUQi/QmSGNHzAA58dLhOCv3ITfmj7\r
+ trnS5nhPE7eT+4kPJbs35S0XXU4H1I4hoFZ3jxOTRk7A/yssHSzPrMPC8ghRtMGQokPF\r
+ oO11wYPqUdsYtShwN+MvQMgEvOBqX2Zm/St+IzNk7mtn+6Vg+Gp5y0o8PXHSDbozlw6M\r
+ etOg==\r
+X-Received: by 10.180.210.225 with SMTP id mx1mr5286095wic.15.1370418519312;\r
+ Wed, 05 Jun 2013 00:48:39 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPSA id h8sm8463137wiz.9.2013.06.05.00.48.37\r
+ for <multiple recipients>\r
+ (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+ Wed, 05 Jun 2013 00:48:38 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org,\r
+ Jani Nikula <jani@nikula.org>\r
+Subject: [WIP PATCH] emacs: search: toggle multiline\r
+Date: Wed, 5 Jun 2013 08:48:35 +0100\r
+Message-Id: <1370418515-9845-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\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: Wed, 05 Jun 2013 07:48:50 -0000\r
+\r
+---\r
+Jani and I were chatting on irc and he mentioned it was annoying not\r
+to be able to see the whole subject in the eamcs search view (if the\r
+window is not very wide). Since Austin's search changes sometime ago\r
+allow multiline results and updating results in place we can use this\r
+to give an expanded view. In this preliminary version "e" toggles\r
+between the expanded view and normal view.\r
+\r
+It's definitely work in progress but seems to work. There are some\r
+oddities in multiline results which probably need fixin and,\r
+personally, I would like the option of a full date as well as the\r
+brief relative date.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+ emacs/notmuch.el | 30 +++++++++++++++++++++++++-----\r
+ 1 files changed, 25 insertions(+), 5 deletions(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 6a4052e..3f5ae4a 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -80,6 +80,16 @@ To enter a line break in customize, press \\[quoted-insert] C-j."\r
+ :type '(alist :key-type (string) :value-type (string))\r
+ :group 'notmuch-search)\r
+ \r
++(defcustom notmuch-search-expanded-result-format\r
++ `(("date" . "%12s ")\r
++ ("count" . "%-7s\n")\r
++ ("authors" . " Authors: %-70s")\r
++ ("subject" . "\n Subject: %s\n")\r
++ ("tags" . " Tags: (%s)\n"))\r
++ "format for expanded results"\r
++ :type '(alist :key-type (string) :value-type (string))\r
++ :group 'notmuch-search)\r
++\r
+ (defvar notmuch-query-history nil\r
+ "Variable to store minibuffer history for notmuch queries")\r
+ \r
+@@ -230,6 +240,7 @@ For a mouse binding, return nil."\r
+ (define-key map "c" 'notmuch-search-stash-map)\r
+ (define-key map "=" 'notmuch-search-refresh-view)\r
+ (define-key map "G" 'notmuch-search-poll-and-refresh-view)\r
++ (define-key map "e" 'notmuch-search-toggle-expand-result)\r
+ (define-key map "t" 'notmuch-search-filter-by-tag)\r
+ (define-key map "f" 'notmuch-search-filter)\r
+ (define-key map [mouse-1] 'notmuch-search-show-thread)\r
+@@ -611,7 +622,7 @@ This function advances the next thread when finished."\r
+ (notmuch-tag-change-list notmuch-archive-tags unarchive)))\r
+ (notmuch-search-next-thread))\r
+ \r
+-(defun notmuch-search-update-result (result &optional pos)\r
++(defun notmuch-search-update-result (result &optional pos format)\r
+ "Replace the result object of the thread at POS (or point) by\r
+ RESULT and redraw it.\r
+ \r
+@@ -626,7 +637,7 @@ of the result."\r
+ ;; Delete the current thread\r
+ (delete-region start end)\r
+ ;; Insert the updated thread\r
+- (notmuch-search-show-result result start)\r
++ (notmuch-search-show-result result start format)\r
+ ;; If point was inside the old result, make an educated guess\r
+ ;; about where to place it now. Unfortunately, this won't work\r
+ ;; with save-excursion (or any other markers that would be nice to\r
+@@ -639,6 +650,14 @@ of the result."\r
+ (min init-point (- new-end 1)))))\r
+ (goto-char new-point)))))\r
+ \r
++(defun notmuch-search-toggle-expand-result (&optional pos)\r
++ (interactive)\r
++ (let* ((result (notmuch-search-get-result pos))\r
++ (expanded (not (plist-get result :expanded)))\r
++ (new-result (plist-put result :expanded expanded))\r
++ (format (and expanded notmuch-search-expanded-result-format)))\r
++ (notmuch-search-update-result new-result pos format)))\r
++\r
+ (defun notmuch-search-process-sentinel (proc msg)\r
+ "Add a message to let user know when \"notmuch search\" exits"\r
+ (let ((buffer (process-buffer proc))\r
+@@ -801,14 +820,15 @@ non-authors is found, assume that all of the authors match."\r
+ (let ((tags (plist-get result :tags)))\r
+ (insert (format format-string (notmuch-tag-format-tags tags)))))))\r
+ \r
+-(defun notmuch-search-show-result (result &optional pos)\r
++(defun notmuch-search-show-result (result &optional pos format)\r
+ "Insert RESULT at POS or the end of the buffer if POS is null."\r
+ ;; Ignore excluded matches\r
+ (unless (= (plist-get result :matched) 0)\r
+- (let ((beg (or pos (point-max))))\r
++ (let ((beg (or pos (point-max)))\r
++ (format (or format notmuch-search-result-format)))\r
+ (save-excursion\r
+ (goto-char beg)\r
+- (dolist (spec notmuch-search-result-format)\r
++ (dolist (spec format)\r
+ (notmuch-search-insert-field (car spec) (cdr spec) result))\r
+ (insert "\n")\r
+ (notmuch-search-color-line beg (point) (plist-get result :tags))\r
+-- \r
+1.7.9.1\r
+\r