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 AB49B6DE1346 for ; Sun, 9 Oct 2016 13:33:59 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.019 X-Spam-Level: X-Spam-Status: No, score=0.019 tagged_above=-999 required=5 tests=[AWL=-0.111, 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 5Dy2xHt_QfYw for ; Sun, 9 Oct 2016 13:33:59 -0700 (PDT) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by arlo.cworth.org (Postfix) with ESMTPS id 4BE8B6DE1372 for ; Sun, 9 Oct 2016 13:33:54 -0700 (PDT) Received: by mail-lf0-f67.google.com with SMTP id p80so6771624lfp.1 for ; Sun, 09 Oct 2016 13:33:54 -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=AtYcFTcMEAq766WhvLXLKtJ3GfybjGdGGd9bd4Zj3iQ=; b=Weyp5+5mkm6zmQcKrC57bCqvIvqnql2fJfVo58t59DHTH7IxdqardcXrXiueD63cas vhox8acxiQkdcHHr++tvzRsYfAJELOfgVKBhWBUmp9ng9BAtCuvB4XtBWUXpJGdWJ5RN PjVKJtQZsVWhrLCymqWol29xvzVrd20W5RJ4rCnHjHxj1uaWhsikJ/BJeneNkKu7zP1C ll6Tq12EjvcjRIUgXJb6fRgvZk57yt1YMAN7ETr5B5l6u/qRaE7uOOA0S3eugQlLt0ik SV4LZhzCQIUbq0tRxsxdtADUMqC/on1woAcF4sfB9uDm3eOedc8Q3xrEa3BTfe4vuRDP C/bg== 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=AtYcFTcMEAq766WhvLXLKtJ3GfybjGdGGd9bd4Zj3iQ=; b=iI8CSoEzwLBPKSyytvGm1fkd0Qq6yizbNgzD0oFdSa592FqQp3TRsBHbL/aSHGffZ3 IosLCGL9SYLlmnnA07daXFV0q/GPb80XHCU9Tkbcz2xlqq0+GDItJ6PMDW/4i6AC8GWb 0oXCf6DgPAJxo0B5mdoFOSFqATFgvnqZf9HJHfR0ZPgIk9VdPF41EPM6DbbYn7EL4RZM lAtiPGgdDUpv2ZespvNsITWXZHdW2YhR7rouKt+OQTPkANkNaSgGBxQmZGcEZwxl3Hwh 4d1oBu+qSuTvWe466jUeUDnMVMLqYs2id7gCQPfhtIt5CwQGg9AmUDzaYsZ+3OqqtRN3 rFAg== X-Gm-Message-State: AA6/9RmzgN92k/a8yid7xg3YWeqnn3dJsslY0JmM46JVGw6vZ72mKxPKtZVDFIVtqG8Bdw== X-Received: by 10.194.235.165 with SMTP id un5mr25649838wjc.200.1476045232574; Sun, 09 Oct 2016 13:33:52 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id qo8sm33661447wjc.46.2016.10.09.13.33.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Oct 2016 13:33:52 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org, adi@adirat.com Subject: [PATCH v5 4/7] emacs: notmuch-search: add no-display functionality Date: Sun, 9 Oct 2016 21:33:40 +0100 Message-Id: <1476045223-5238-5-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:33:59 -0000 From: Ioan-Adrian Ratiu If no-display is non-nil when calling notmuch-search then do not force the search buffer to be displayed. Signed-off-by: Ioan-Adrian Ratiu --- emacs/notmuch.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 673811c..8f0053c 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -926,7 +926,7 @@ PROMPT is the string to prompt with." ;;;###autoload (put 'notmuch-search 'notmuch-doc "Search for messages.") -(defun notmuch-search (&optional query oldest-first target-thread target-line) +(defun notmuch-search (&optional query oldest-first target-thread target-line no-display) "Display threads matching QUERY in a notmuch-search buffer. If QUERY is nil, it is read interactively from the minibuffer. @@ -937,6 +937,9 @@ Other optional parameters are used as follows: current if it appears in the search results. TARGET-LINE: The line number to move to if the target thread does not appear in the search results. + NO-DISPLAY: Do not try to foreground the search results buffer. If it is + already foregrounded i.e. displayed in a window, this has no + effect, meaning the buffer will remain visible. When called interactively, this will prompt for a query and use the configured default sort order." @@ -950,7 +953,9 @@ the configured default sort order." (let* ((query (or query (notmuch-read-query "Notmuch search: "))) (buffer (get-buffer-create (notmuch-search-buffer-title query)))) - (switch-to-buffer buffer) + (if no-display + (set-buffer buffer) + (switch-to-buffer buffer)) (notmuch-search-mode) ;; Don't track undo information for this buffer (set 'buffer-undo-list t) -- 2.1.4