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 92F7D6DE1370 for ; Sun, 9 Oct 2016 13:34:07 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.021 X-Spam-Level: X-Spam-Status: No, score=0.021 tagged_above=-999 required=5 tests=[AWL=-0.109, 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_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 uWcLzsloX6U4 for ; Sun, 9 Oct 2016 13:34:07 -0700 (PDT) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by arlo.cworth.org (Postfix) with ESMTPS id B64896DE1393 for ; Sun, 9 Oct 2016 13:33:58 -0700 (PDT) Received: by mail-lf0-f68.google.com with SMTP id l131so6749722lfl.0 for ; Sun, 09 Oct 2016 13:33:58 -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=EH/b6RGG0pNlUvIOmqg0xi78KLRpdaVtZ34Z3qYsF60=; b=cI0Pkq/+BjXK4tJRK0Lb81Oo2P9lewNNE8niuN1cKWE81+Xh+3ekhStN+x3Y30UO+c 1V8uHeKmhO48+mWnulY0bcIi24AO1QVIL5snJNk2EGXiFJYqNAdSgk1b1pj2X3A5ekLN mdyB369N2ekSX8KYR8k6MxOQHrbgQU4eUHCdjTcLW+smumxkAqdvTsfllNwK0qtX4fcM 5BsdgE5atjIhp//yTkT4pqRQJ6OTph1w9QDJB4h4kLNXoF2POv1Wn/+PuNi6Bkq/euRX d9YaWdqZWR9YyTx+NAareTHzc824N0cqTJE08LiH5WACT9ZXW0VCvQ+o2VeoWWsaBJSk +rXA== 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=EH/b6RGG0pNlUvIOmqg0xi78KLRpdaVtZ34Z3qYsF60=; b=mCSn9HEBLXxECumDi6EKR7LVRkMjpSBUpzd2zou4FkjWeiSyVjTWxnaVmCIAZCIAvu MdFe9pgALxXMtxgztUqLUTCBa0Hnvsa7e1X2Y9ccKGwyMR7o3VaghK0abR6mk2Hy1stQ 6XmEguaWgNiPN3TjI/wf7zk40tUH15DLtPh/gq3OuKRMoZ5MTDcnmNqy/2Xiv3dQeX18 7w1eDBj5mWhXavKCgW6dBXllI4NtF39MeizsIerQoTWChP6DvwxP1i0g+xnmissHgTw1 ADPZceUI8BN9IV/75/zxAXf9iLat2PUQHNBefAO4dDxatbcrdVOlnnTI1Tv9cop/VY6K NWTA== X-Gm-Message-State: AA6/9RmESP60qSjkuWtdq9xjgv+0bpk2rGVUY5xL7BpFMQW4keDLUeV+ZOJPHhEoZFW52g== X-Received: by 10.194.112.131 with SMTP id iq3mr25949204wjb.123.1476045236840; Sun, 09 Oct 2016 13:33:56 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id va3sm33692782wjb.18.2016.10.09.13.33.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Oct 2016 13:33:56 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org, adi@adirat.com Subject: [PATCH v5 7/7] emacs: notmuch-lib: add refresh all buffers function Date: Sun, 9 Oct 2016 21:33:43 +0100 Message-Id: <1476045223-5238-8-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:07 -0000 From: Ioan-Adrian Ratiu notmuch-refresh-all-buffers calls each buffer's major mode specific refresh function using the generic notmuch-refresh-this-buffer function. Since the earlier changesets have stopped the refresh functions from forcing the buffers to be redisplayed this can refresh buffers that are not currently displayed without disturbing the user. This is very useful for silent async background updating the emacs display when new mail is fetched. Signed-off-by: Ioan-Adrian Ratiu --- emacs/notmuch-lib.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 8b55ca7..85c2237 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -427,6 +427,20 @@ of its command symbol." (notmuch-poll) (notmuch-refresh-this-buffer)) +(defun notmuch-refresh-all-buffers () + "Invoke `notmuch-refresh-this-buffer' on all notmuch major-mode buffers. + +The buffers are silently refreshed, i.e. they are not forced to +be displayed." + (dolist (buffer (buffer-list)) + (let ((buffer-mode (buffer-local-value 'major-mode buffer))) + (when (memq buffer-mode '(notmuch-show-mode + notmuch-tree-mode + notmuch-search-mode + notmuch-hello-mode)) + (with-current-buffer buffer + (notmuch-refresh-this-buffer)))))) + (defun notmuch-prettify-subject (subject) ;; This function is used by `notmuch-search-process-filter' which ;; requires that we not disrupt its' matching state. -- 2.1.4