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 EEDDD6DE0C3A for ; Sun, 20 Nov 2016 08:50:41 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.064 X-Spam-Level: X-Spam-Status: No, score=0.064 tagged_above=-999 required=5 tests=[AWL=-0.066, 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_NONE=-0.0001, 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 8DO38X0IWVgh for ; Sun, 20 Nov 2016 08:50:41 -0800 (PST) Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id 1BC836DE0C71 for ; Sun, 20 Nov 2016 08:50:41 -0800 (PST) Received: by mail-wm0-f67.google.com with SMTP id g23so20395593wme.1 for ; Sun, 20 Nov 2016 08:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mgP3zstKEPNjs7yCB9ZM40TzT5xeO/Jb2cBwDn6H4NM=; b=oaZvtsrkwvxvaiK32/Yg6Y1PWXPxR0m67BMih4D9c9hPrGw1vdID6mLl4iyJ9XtSIr XsfpKHl5cFDEXA1rntptvS8gTX4gM3MGAnMQwHQQ3c9KDQB+7hxGEBvbQYuycWAHIZb7 hD5KeyVOLdUKkjdtvobID+pYvHUO2jfvAgtcKBNR/2PdFdFSgt6KPKFTHGK/ey6FJW5G HNS7S6ugpS1W90AdGf1TxkSMGECUO+duPL54T+JWpayN6wNqvj3BlkjtjQrs9o6qSVNS dvTnrVB8i3+B0ND3WyhArLDN0JoNwz4i7sAv3CPHTW6tLGOBXMlBBNztQsWUP7uc4rIQ BnzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=mgP3zstKEPNjs7yCB9ZM40TzT5xeO/Jb2cBwDn6H4NM=; b=jBiZYavwW7CW29OBlVE+TAQwtthp3wrWLYuJLYB3YydRpvFx70nXIlcrPjKFRLEvWh F0+ED3DdNoEWDjulfVOScIJSNzzwDxYMQl1gXHlU/okKk3CmMTBAhjUd4LsTMpMBqups AXAKUhsp4Z1KIlhQcdFG4VJsBXzM3XXUvChpbFwg0gOvuerkYYxH8IgYHa4Y+qP5SXch VsEBTa+g9Yy1kPpD5SeKB3cyXgmMEmNsVaytT+mnm41z2hYkN6MR2U4ayQU4qxFP7eXr jUQhQl70+OgAGV4ERLEfK2ALsLpuoLdp2Tx3uVcJazY6dVH8lACcfcHUthPsmO09OU6x KZJg== X-Gm-Message-State: AKaTC01DNz6lDRDZDIoczgC/w1898ANcupIOua7nVisChEwJYbgMQGI0USqpBMqhEQzMaw== X-Received: by 10.28.68.195 with SMTP id r186mr9000125wma.105.1479660639331; Sun, 20 Nov 2016 08:50:39 -0800 (PST) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id f134sm14752456wmf.19.2016.11.20.08.50.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Nov 2016 08:50:38 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 1/2] emacs: address: move address-full-harvest-finished to a function Date: Sun, 20 Nov 2016 16:50:33 +0000 Message-Id: <1479660634-17956-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1479660634-17956-1-git-send-email-markwalters1009@gmail.com> References: <1479660634-17956-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, 20 Nov 2016 16:50:42 -0000 This makes the code access notmuch-address-full-harvest-finished via a helper function, notmuch-address--harvest-ready. Later we will use this to check whether we can load the harvest instead of regenerating it. --- emacs/notmuch-address.el | 8 ++++++-- emacs/notmuch-company.el | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/emacs/notmuch-address.el b/emacs/notmuch-address.el index b3c56cf..2eaca79 100644 --- a/emacs/notmuch-address.el +++ b/emacs/notmuch-address.el @@ -37,7 +37,11 @@ (defvar notmuch-address-full-harvest-finished nil "t indicates that full completion address harvesting has been -finished") +finished. Use notmuch-address--harvest-ready to access.") + +(defun notmuch-address--harvest-ready () + "Return t if there is a full address hash available." + notmuch-address-full-harvest-finished) (defcustom notmuch-address-command 'internal "Determines how address completion candidates are generated. @@ -170,7 +174,7 @@ elisp-based implementation or older implementation requiring external commands." (cond ((eq notmuch-address-command 'internal) - (when (not notmuch-address-full-harvest-finished) + (unless (notmuch-address--harvest-ready) ;; First, run quick synchronous harvest based on what the user ;; entered so far (notmuch-address-harvest original t)) diff --git a/emacs/notmuch-company.el b/emacs/notmuch-company.el index ebe2c08..dca6471 100644 --- a/emacs/notmuch-company.el +++ b/emacs/notmuch-company.el @@ -41,7 +41,7 @@ (declare-function notmuch-address-harvest "notmuch-address") (declare-function notmuch-address-harvest-trigger "notmuch-address") (declare-function notmuch-address-matching "notmuch-address") -(defvar notmuch-address-full-harvest-finished) +(declare-function notmuch-address--harvest-ready "notmuch-address") (defvar notmuch-address-completion-headers-regexp) ;;;###autoload @@ -70,7 +70,7 @@ (line-beginning-position)) (setq notmuch-company-last-prefix (company-grab "[:,][ \t]*\\(.*\\)" 1 (point-at-bol))))) (candidates (cond - (notmuch-address-full-harvest-finished + ((notmuch-address--harvest-ready) ;; Update harvested addressed from time to time (notmuch-address-harvest-trigger) (notmuch-address-matching arg)) -- 2.1.4