Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2F405431FAE for ; Thu, 29 Aug 2013 09:26:48 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1cjdAex7nr5P for ; Thu, 29 Aug 2013 09:26:43 -0700 (PDT) Received: from dmz-mailsec-scanner-1.mit.edu (dmz-mailsec-scanner-1.mit.edu [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id B772C431E64 for ; Thu, 29 Aug 2013 09:26:15 -0700 (PDT) X-AuditID: 1209190c-b7fac8e000006335-6e-521f762768d1 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 1C.CE.25397.7267F125; Thu, 29 Aug 2013 12:26:15 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r7TGQ3dj025414; Thu, 29 Aug 2013 12:26:04 -0400 Received: from drake.dyndns.org (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com [216.15.114.40]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r7TGQ1aM014997 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Thu, 29 Aug 2013 12:26:02 -0400 Received: from amthrax by drake.dyndns.org with local (Exim 4.77) (envelope-from ) id 1VF52n-0007Wt-2K; Thu, 29 Aug 2013 12:26:01 -0400 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 5/9] emacs: Move `notmuch-poll' to notmuch-lib Date: Thu, 29 Aug 2013 12:25:53 -0400 Message-Id: <1377793557-28878-6-git-send-email-amdragon@mit.edu> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377793557-28878-1-git-send-email-amdragon@mit.edu> References: <1377793557-28878-1-git-send-email-amdragon@mit.edu> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6noqteJh9kcLKN3+L6zZnMDowez1bd Yg5gjOKySUnNySxLLdK3S+DKuDjpPVPBPsWKnf+tGxi3SncxcnJICJhIrNy4ghHCFpO4cG89 WxcjF4eQwD5GicdfLzFCOBsZJVb8X8QGUiUkcIdJ4sGOCojEXEaJyeeeg7WzCWhIbNu/HMwW EZCW2Hl3NmsXIwcHs4CaxJ8uFZCwsICdxOpZy5lAbBYBVYn5D9+A2bwCDhLN67tYIa5QlOh+ NgFsF6eAo0T/3bcsEHsdJP5cfMo+gZF/ASPDKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl1DvdzM Er3UlNJNjKCQ4ZTk2cH45qDSIUYBDkYlHt6OQPkgIdbEsuLK3EOMkhxMSqK8gSVAIb6k/JTK jMTijPii0pzU4kOMEhzMSiK8bzmBcrwpiZVVqUX5MClpDhYlcd6nT88GCgmkJ5akZqemFqQW wWRlODiUJHjjS4EaBYtS01Mr0jJzShDSTBycIMN5gIaXg9TwFhck5hZnpkPkTzEqSonz5oEk BEASGaV5cL2wmH7FKA70ijCvJEgVDzAdwHW/AhrMBDR4Qr4cyOCSRISUVANj2VUmi40fD9dd NOYPqCuIuf7uxu+TMbnnfgY9vWk0m2ebfMe5q/v8O7n6Xu81Z/r2aFKO4Nmd7UaNDTO97Z+W 7t3tynbvgdTn+bNnCwSdfa8/Zfknjd+L1Z5+XLzxVcdsr9qX/Mbn95XIyoak3GeJnl7qWZ0j vHaj40bbvW8PeamE+9+wKk23VGIpzkg01GIuKk4EAOBycoLEAgAA X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Thu, 29 Aug 2013 16:26:48 -0000 --- emacs/notmuch-lib.el | 38 ++++++++++++++++++++++++++++++++++++++ emacs/notmuch.el | 38 -------------------------------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 4796f17..9754e16 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -76,6 +76,33 @@ search." :type 'boolean :group 'notmuch-search) +(defcustom notmuch-poll-script nil + "An external script to incorporate new mail into the notmuch database. + +This variable controls the action invoked by +`notmuch-search-poll-and-refresh-view' and +`notmuch-hello-poll-and-update' (each have a default keybinding +of 'G') to incorporate new mail into the notmuch database. + +If set to nil (the default), new mail is processed by invoking +\"notmuch new\". Otherwise, this should be set to a string that +gives the name of an external script that processes new mail. If +set to the empty string, no command will be run. + +The external script could do any of the following depending on +the user's needs: + +1. Invoke a program to transfer mail to the local mail store +2. Invoke \"notmuch new\" to incorporate the new mail +3. Invoke one or more \"notmuch tag\" commands to classify the mail + +Note that the recommended way of achieving the same is using +\"notmuch new\" hooks." + :type '(choice (const :tag "notmuch new" nil) + (const :tag "Disabled" "") + (string :tag "Custom script")) + :group 'notmuch-external) + ;; (defvar notmuch-search-history nil @@ -161,6 +188,17 @@ Otherwise the output will be returned" "Return the user.other_email value (as a list) from the notmuch configuration." (split-string (notmuch-config-get "user.other_email") "\n")) +(defun notmuch-poll () + "Run \"notmuch new\" or an external script to import mail. + +Invokes `notmuch-poll-script', \"notmuch new\", or does nothing +depending on the value of `notmuch-poll-script'." + (interactive) + (if (stringp notmuch-poll-script) + (unless (string= notmuch-poll-script "") + (call-process notmuch-poll-script nil nil)) + (call-process notmuch-command nil nil nil "new"))) + (defun notmuch-kill-this-buffer () "Kill the current buffer." (interactive) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 00cf271..82cece8 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -959,44 +959,6 @@ same relative position within the new buffer." (notmuch-search query oldest-first target-thread target-line) (goto-char (point-min)))) -(defcustom notmuch-poll-script nil - "An external script to incorporate new mail into the notmuch database. - -This variable controls the action invoked by -`notmuch-search-poll-and-refresh-view' and -`notmuch-hello-poll-and-update' (each have a default keybinding -of 'G') to incorporate new mail into the notmuch database. - -If set to nil (the default), new mail is processed by invoking -\"notmuch new\". Otherwise, this should be set to a string that -gives the name of an external script that processes new mail. If -set to the empty string, no command will be run. - -The external script could do any of the following depending on -the user's needs: - -1. Invoke a program to transfer mail to the local mail store -2. Invoke \"notmuch new\" to incorporate the new mail -3. Invoke one or more \"notmuch tag\" commands to classify the mail - -Note that the recommended way of achieving the same is using -\"notmuch new\" hooks." - :type '(choice (const :tag "notmuch new" nil) - (const :tag "Disabled" "") - (string :tag "Custom script")) - :group 'notmuch-external) - -(defun notmuch-poll () - "Run \"notmuch new\" or an external script to import mail. - -Invokes `notmuch-poll-script', \"notmuch new\", or does nothing -depending on the value of `notmuch-poll-script'." - (interactive) - (if (stringp notmuch-poll-script) - (unless (string= notmuch-poll-script "") - (call-process notmuch-poll-script nil nil)) - (call-process notmuch-command nil nil nil "new"))) - (defun notmuch-search-poll-and-refresh-view () "Invoke `notmuch-poll' to import mail, then refresh the current view." (interactive) -- 1.7.10.4