From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 9689B6DE1372 for ; Sun, 9 Oct 2016 13:34:00 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.331 X-Spam-Level: X-Spam-Status: No, score=-0.331 tagged_above=-999 required=5 tests=[AWL=0.239, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1apAiMi6deMO for ; Sun, 9 Oct 2016 13:33:59 -0700 (PDT) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by arlo.cworth.org (Postfix) with ESMTPS id 77E5B6DE1374 for ; Sun, 9 Oct 2016 13:33:55 -0700 (PDT) Received: by mail-lf0-f50.google.com with SMTP id b81so90355124lfe.1 for ; Sun, 09 Oct 2016 13:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=eBaXovAlZiV1eDaajNiYgZDsL+AjGLP7zPAtwwWSiHM=; b=UdifOOWMEijMR1VkIn/WMYEkmupF5I6VstY4PXnjfDv/OXzgmULD3mMUbIIKYZRssw yHvJIQ5p98h8m53P4q44Judo29fAV2xbEEXxHRtnM/neeihF1gDRCcHtlkHa3YAukmmg U2SuPExQyaJU9csMzsRwiSGI+CJFaY9Wc8llk8YzCsnj6RqU8qrNkR55SjCnk0HGMMNB V9k4/FOWBDgQoAChaCaKZuqlnCLgMeDo96SH94J2B78opgY1TRJFhTebG+7rycGu+4DV 7XJdcs/K3fYTNexj25/rqk4QIUAlH2O5Gw/w17/BEQz3Hx4AHMFEi4m/AFTILhx47Rxs NzLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=eBaXovAlZiV1eDaajNiYgZDsL+AjGLP7zPAtwwWSiHM=; b=MVWzAOaB+SXHmn6FPoL1oJ6ERoJ5Y5rhbw9u24P0mSDvQbR5aEvrFg9p6T3VCVv9Cc EGb/3wLOLq2ZoZAQ88k6gvk1MwTGP7AcFZOYvagBgVsRymhn5W54h/A3smcw0K1V7wfA Cf1Cjaisl1QwFtO2aLrXMrbsKF1uRcwrhXpuIL77Dj/h/+eznH91tS+ar4uhJN05ODzx TjGkZtdIlfJzvi5D1zpLG4QsyCymfAVo8bdMF4cB26N3C2s//hUm3fOCpX5hOfwUVrUY 6aYHEhCwt1B85tGwXJKM/prFNbnQr7VCW5l8XJ0xQ5gKtH9KTUBKclkRhEmNHNCMlTIM 9tGw== X-Gm-Message-State: AA6/9Rn6LGhF6bycbV0QkC5Ka4ColsS8PamXADxXYZxES8QUB1jgt0SioQM00Nqmkh5hKQ== X-Received: by 10.194.150.206 with SMTP id uk14mr25804942wjb.139.1476045233767; Sun, 09 Oct 2016 13:33:53 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id q8sm33572730wjj.7.2016.10.09.13.33.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Oct 2016 13:33:53 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org, adi@adirat.com Subject: [PATCH v5 5/7] emacs: notmuch-search-refresh-view: reuse buffer Date: Sun, 9 Oct 2016 21:33:41 +0100 Message-Id: <1476045223-5238-6-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1476045223-5238-1-git-send-email-markwalters1009@gmail.com> References: <1476045223-5238-1-git-send-email-markwalters1009@gmail.com> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Oct 2016 20:34:00 -0000 From: Ioan-Adrian Ratiu There's no reason to completely kill a buffer while refreshing its search results because the buffer name is constant between refreshes (based on the search query), only its contents may change and notmuch search kills all local variables, so it's safe to reuse. Reusing the same buffer also makes it possible to do things like refreshing a buffer which is not focused or even not shown in any window - this will be used in the next commits to add auto-refresh capabilities to all existing notmuch buffers + a function to call after syncing mail to refresh everything. Signed-off-by: Ioan-Adrian Ratiu --- emacs/notmuch.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 8f0053c..079a3d1 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -991,7 +991,7 @@ the configured default sort order." (defun notmuch-search-refresh-view () "Refresh the current view. -Kills the current buffer and runs a new search with the same +Erases the current buffer and runs a new search with the same query string as the current search. If the current thread is in the new search results, then point will be placed on the same thread. Otherwise, point will be moved to attempt to be in the @@ -1001,8 +1001,8 @@ same relative position within the new buffer." (oldest-first notmuch-search-oldest-first) (target-thread (notmuch-search-find-thread-id 'bare)) (query notmuch-search-query-string)) - (notmuch-bury-or-kill-this-buffer) - (notmuch-search query oldest-first target-thread target-line) + ;; notmuch-search erases the current buffer. + (notmuch-search query oldest-first target-thread target-line t) (goto-char (point-min)))) (defun notmuch-search-toggle-order () -- 2.1.4