Re: [PATCH 7/7] emacs: Fix navigation of multi-line search result formats
authorAustin Clements <amdragon@MIT.EDU>
Fri, 13 Jul 2012 17:53:52 +0000 (13:53 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:15 +0000 (09:48 -0800)
ba/726922c282e03f15e9f33c6e361254fb63563a [new file with mode: 0644]

diff --git a/ba/726922c282e03f15e9f33c6e361254fb63563a b/ba/726922c282e03f15e9f33c6e361254fb63563a
new file mode 100644 (file)
index 0000000..5b4f4d9
--- /dev/null
@@ -0,0 +1,146 @@
+Return-Path: <amdragon@mit.edu>\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 D3CCE431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Jul 2012 10:53:56 -0700 (PDT)\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 Fq57R2QbM9S6 for <notmuch@notmuchmail.org>;\r
+       Fri, 13 Jul 2012 10:53:56 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
+       [18.7.68.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 371BC431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Jul 2012 10:53:56 -0700 (PDT)\r
+X-AuditID: 12074422-b7f1f6d00000090b-b9-500060b3768b\r
+Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])\r
+       by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id AC.E1.02315.3B060005; Fri, 13 Jul 2012 13:53:55 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q6DHrswJ000707; \r
+       Fri, 13 Jul 2012 13:53:55 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q6DHrr8D009890\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Fri, 13 Jul 2012 13:53:54 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1Spk3s-000866-Uu; Fri, 13 Jul 2012 13:53:53 -0400\r
+Date: Fri, 13 Jul 2012 13:53:52 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH 7/7] emacs: Fix navigation of multi-line search result\r
+       formats\r
+Message-ID: <20120713175352.GN7332@mit.edu>\r
+References: <1342140319-19859-1-git-send-email-amdragon@mit.edu>\r
+       <1342140319-19859-8-git-send-email-amdragon@mit.edu>\r
+       <871ukfshjd.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <871ukfshjd.fsf@qmul.ac.uk>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFupjleLIzCtJLcpLzFFi42IRYrdT192cwBBgsGqOisXquTwW12/OZHZg\r
+       8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mjo2fmcueCRaseXtfOYGxn7BLkZODgkBE4n5\r
+       /04xQthiEhfurWcDsYUE9jFKXFsl0cXIBWRvYJS41NHKDOGcZJLYu3UBlLOEUaLlwRlmkBYW\r
+       AVWJLTNWsIPYbAIaEtv2LwcbKyKgI3H70AKwOLOAtMS3381MXYwcHMICIRIrbnKDhHkFtCXW\r
+       HfnNCjFzKqPElw6QGpCEoMTJmU9YIHq1JG78ewnWCzJn+T8OkDAn0Kp5vyaClYsKqEhMObmN\r
+       bQKj0Cwk3bOQdM9C6F7AyLyKUTYlt0o3NzEzpzg1Wbc4OTEvL7VI11QvN7NELzWldBMjOKhd\r
+       lHYw/jyodIhRgINRiYc32Z8hQIg1say4MvcQoyQHk5Ior2Y8UIgvKT+lMiOxOCO+qDQntfgQ\r
+       owQHs5IIr44xUI43JbGyKrUoHyYlzcGiJM57LeWmv5BAemJJanZqakFqEUxWhoNDSYJXBhi9\r
+       QoJFqempFWmZOSUIaSYOTpDhPEDDuUBqeIsLEnOLM9Mh8qcYdTmuPbx1i1GIJS8/L1VKnJcF\r
+       pEgApCijNA9uDiwZvWIUB3pLmFcYpIoHmMjgJr0CWsIEtGTWz3/+QEtKEhFSUg2MVXuC6mPN\r
+       eu/f8fFO1IiYfkbFzXeZk+29DzkmP/VNDu9Odn6wfubF7fs8l0eL35bt7/Ax2yNcMCH52J82\r
+       bdu9Txe4FS1P/B4mu+fr6RNRsRmPJuxVanksHak2ffYdrUqdf2VteW+d7ZUtrSefNQ/tddlr\r
+       vzJYfP3//HWzXv1b8nOBWUrhlPmeSizFGYmGWsxFxYkA6TFYVyEDAAA=\r
+Cc: 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: Fri, 13 Jul 2012 17:53:57 -0000\r
+\r
+Quoth Mark Walters on Jul 13 at  6:21 pm:\r
+> On Fri, 13 Jul 2012, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> > At this point, the only remaining functions that don't support\r
+> > multi-line search result formats are the thread navigation functions.\r
+> > This patch fixes that by rewriting them in terms of\r
+> > notmuch-search-result-{beginning,end}.\r
+> \r
+> This seems to subtly change the behaviour in the normal case of a single\r
+> line result. If point is not at the start of a search result then\r
+> notmuch-search-previous-thread moves to the start of the current thread\r
+> rather than the previous thread. Is that deliberate?\r
+> \r
+> As far as I can see show uses p to move to the start of the previous\r
+> message so this behaviour is different from there as well. \r
+> \r
+> I think your choice may be the nicest one (and actually even more so in\r
+> show) but thought I would mention it anyway.\r
+\r
+Oh, yes, that's true.  I suppose that choice was deliberate in the\r
+sense that I wrote notmuch-search-previous-thread the way I thought it\r
+should work without thinking very hard about how it originally worked.\r
+\r
+I could rework it to keep the original behavior, or keep it this way\r
+and document it in the commit message (and maybe NEWS).  Personally I\r
+would prefer to keep it this way and update show's p binding to behave\r
+similarly since I've always found show's p to be confusing.\r
+\r
+> Best wishes \r
+> \r
+> Mark\r
+> \r
+> > ---\r
+> >  emacs/notmuch.el |   12 +++++++++---\r
+> >  1 file changed, 9 insertions(+), 3 deletions(-)\r
+> >\r
+> > diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> > index f32cfb0..2ece97d 100644\r
+> > --- a/emacs/notmuch.el\r
+> > +++ b/emacs/notmuch.el\r
+> > @@ -287,18 +287,24 @@ For a mouse binding, return nil."\r
+> >  (defun notmuch-search-next-thread ()\r
+> >    "Select the next thread in the search results."\r
+> >    (interactive)\r
+> > -  (forward-line 1))\r
+> > +  (when (notmuch-search-get-result (notmuch-search-result-end))\r
+> > +    (goto-char (notmuch-search-result-end))))\r
+> >  \r
+> >  (defun notmuch-search-previous-thread ()\r
+> >    "Select the previous thread in the search results."\r
+> >    (interactive)\r
+> > -  (forward-line -1))\r
+> > +  (if (notmuch-search-get-result)\r
+> > +      (unless (bobp)\r
+> > +  (goto-char (notmuch-search-result-beginning (- (point) 1))))\r
+> > +    ;; We must be past the end; jump to the last result\r
+> > +    (notmuch-search-last-thread)))\r
+> >  \r
+> >  (defun notmuch-search-last-thread ()\r
+> >    "Select the last thread in the search results."\r
+> >    (interactive)\r
+> >    (goto-char (point-max))\r
+> > -  (forward-line -2))\r
+> > +  (forward-line -2)\r
+> > +  (goto-char (notmuch-search-result-beginning)))\r
+> >  \r
+> >  (defun notmuch-search-first-thread ()\r
+> >    "Select the first thread in the search results."\r