Re: [PATCH v4 7/8] emacs: Fix navigation of multi-line search result formats
authorJani Nikula <jani@nikula.org>
Thu, 2 Aug 2012 06:51:19 +0000 (08:51 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:48:43 +0000 (09:48 -0800)
72/84d188b5af63484deb1232eeb4b986946b70b7 [new file with mode: 0644]

diff --git a/72/84d188b5af63484deb1232eeb4b986946b70b7 b/72/84d188b5af63484deb1232eeb4b986946b70b7
new file mode 100644 (file)
index 0000000..b1e6fe1
--- /dev/null
@@ -0,0 +1,136 @@
+Return-Path: <jani@nikula.org>\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 C4EA3431FAF\r
+       for <notmuch@notmuchmail.org>; Wed,  1 Aug 2012 23:51:27 -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 3ff89FoTiecm for <notmuch@notmuchmail.org>;\r
+       Wed,  1 Aug 2012 23:51:25 -0700 (PDT)\r
+Received: from mail-gh0-f181.google.com (mail-gh0-f181.google.com\r
+       [209.85.160.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id C0814431FAE\r
+       for <notmuch@notmuchmail.org>; Wed,  1 Aug 2012 23:51:25 -0700 (PDT)\r
+Received: by ghbz13 with SMTP id z13so10091945ghb.26\r
+       for <notmuch@notmuchmail.org>; Wed, 01 Aug 2012 23:51:25 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:cc:subject:in-reply-to:references:user-agent:date\r
+       :message-id:mime-version:content-type:x-gm-message-state;\r
+       bh=wj9IaBXD21l2qSjDBSvM4onXeJzOG3EpcFJpylIM9m4=;\r
+       b=PVxfvuDNlTi2XEA0STA8b4Y6tExiBXq4TxVBqCGtkyD/rdCxSvl+Cgs9PAkvCJGMyJ\r
+       6cZ834B7SI34bR0Ab05IrqZvu5q2QBkwQCYoP1o8TrJZYkD6hXE7WhusyLyYGzIOknTw\r
+       RLKYgt+ssh9tokZjY1YM7VhsBQDfQWXKsN8Ck2oQHgUBpY/7OxltJwbi5b5pgRy7Z/GX\r
+       bChRGZ85luFb2XJ3F5uU2FhQfdqH3T6afUPNzsCCmnYK2m0rEldhSDwp2lH/fMxSGz9D\r
+       FmLO6tdUhR8H24K5UBtPekmlaVLsPMcpEiPY9S3mvUAqtMZihJnfS3mwecVJZiMTtzC1\r
+       tt0g==\r
+Received: by 10.236.140.67 with SMTP id d43mr12026684yhj.19.1343890284856;\r
+       Wed, 01 Aug 2012 23:51:24 -0700 (PDT)\r
+Received: from localhost ([2001:4b98:dc0:43:216:3eff:fe1b:25f3])\r
+       by mx.google.com with ESMTPS id a4sm9565811yhj.11.2012.08.01.23.51.22\r
+       (version=SSLv3 cipher=OTHER); Wed, 01 Aug 2012 23:51:24 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v4 7/8] emacs: Fix navigation of multi-line search result\r
+       formats\r
+In-Reply-To: <1342892232-5659-8-git-send-email-amdragon@mit.edu>\r
+References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
+       <1342892232-5659-1-git-send-email-amdragon@mit.edu>\r
+       <1342892232-5659-8-git-send-email-amdragon@mit.edu>\r
+User-Agent: Notmuch/0.13.2+106~gb810aee (http://notmuchmail.org) Emacs/23.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Thu, 02 Aug 2012 08:51:19 +0200\r
+Message-ID: <87mx2dais8.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Gm-Message-State:\r
+ ALoCoQlES6nznbAMo+8h8s2OvKDCHPAr9Hjo6MPNYiIHlvdYKZpk3dWD1r09ql2HlsP5aVjItZeW\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: Thu, 02 Aug 2012 06:51:27 -0000\r
+\r
+On Sat, 21 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 changes the behavior of notmuch-search-previous-thread slightly\r
+> so that if point isn't at the beginning of a result, it first moves\r
+> point to the beginning of the result.\r
+\r
+Hi Austin, bisecting suggests this patch (committed as 5d0883e) breaks\r
+notmuch-show-archive-thread-then-next and subsequently\r
+notmuch-show-advance-and-archive for me. When showing the last thread in\r
+the search results, notmuch-show-archive-thread-then-next used to exit\r
+to the end of the search buffer. Now it redisplays the current\r
+thread. When I hit SPC to cruise through mails, there's no indication\r
+that I've reached the end of search results, other than the same thread\r
+being displayed over and over.\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+> ---\r
+>  emacs/notmuch.el |   13 ++++++++++---\r
+>  1 file changed, 10 insertions(+), 3 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+> index d092528..fd1836f 100644\r
+> --- a/emacs/notmuch.el\r
+> +++ b/emacs/notmuch.el\r
+> @@ -293,18 +293,25 @@ 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
+> +  (let ((beg (notmuch-search-result-beginning)))\r
+> +    (when beg (goto-char beg))))\r
+>  \r
+>  (defun notmuch-search-first-thread ()\r
+>    "Select the first thread in the search results."\r
+> -- \r
+> 1.7.10\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r