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 6E22B6DE00D3 for ; Thu, 3 Nov 2016 13:39:58 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.217 X-Spam-Level: X-Spam-Status: No, score=-0.217 tagged_above=-999 required=5 tests=[AWL=-0.197, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 LLJ5FXOraAfx for ; Thu, 3 Nov 2016 13:39:58 -0700 (PDT) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by arlo.cworth.org (Postfix) with ESMTPS id 906D66DE0173 for ; Thu, 3 Nov 2016 13:39:57 -0700 (PDT) Received: by mail-lf0-f65.google.com with SMTP id o20so3431523lfg.3 for ; Thu, 03 Nov 2016 13:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=oMLGYYbwsNdIEovdYXw+LPOc4liEI6COOmXs9uKR3Zw=; b=KmARq+vpbbV7+9b+CLZm5J2Oic0oe1KlZGfcigk3Y+w0Vgh6GVjGafW0goXU+EwR5i P0s+wIvIavOnJLl6sP+mR4B5Cp+eaxLHnZ8amQC0f7Ydy44vWYAylHWYW6lHlRbFenZD xT1z88TOz0jZYKhHHF4wHaK/DlIOE9Rfo5ZMmRgPVXYGtuxcdN48Y4XbxZY22L8nwsf1 iJjm0YXw0JaH/V4dGN7VcOCS6I7YqBmnQmdWpsMQYX3DX2zQKlY5NSsndWi2+yqkPMnz YwuZjmjwGSMS3Ic9tP3HXw9llzK5I7A/mxPW1SvqU+8eUI/dTBP/sTmS0rwD0+e8o/rP CmNA== 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:in-reply-to:references; bh=oMLGYYbwsNdIEovdYXw+LPOc4liEI6COOmXs9uKR3Zw=; b=mpYSZa1CbR6KM09j1k+JQoQip9hUi7rcw79diImI39mSJjziKoxRrvAG6rLMaU46Je eXfn9f0uWqTxdcdFcNt16AuKoTiIhQUG2vdM/OU+cTseQTGRVZDDNNa2RDsbEhVF70qh OXNn5ydFaMv5BBa2qkU2InkTd9INUrDMLv/B4yGCU2l2+5RT49lb2Do9Ycfvme2BZ2zL Unz276RKpGjmFVogGtMCWvjEs8aeShrXUdsVfJSHP/iFS9BI34KS5X6JTBm57uYc/GuS ttYxCXVE2ylWZQi1qBg6Rszcvy8TV5toG5verT9EYG2lcIrRHhaViMpeAkTZEoFAS2gJ Ldgg== X-Gm-Message-State: ABUngveKjpYYKIrBEH41xebFiRfKGtz3RK4zIoCnkV2wi9ezcZk1onK0d0/Wa73mkaBVUg== X-Received: by 10.25.168.1 with SMTP id r1mr4425737lfe.72.1478205595818; Thu, 03 Nov 2016 13:39:55 -0700 (PDT) Received: from localhost (mobile-access-bcee98-78.dhcp.inet.fi. [188.238.152.78]) by smtp.gmail.com with ESMTPSA id e94sm1718686lji.40.2016.11.03.13.39.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Nov 2016 13:39:55 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 1/8] completion: complete notmuch emacs-mua Date: Thu, 3 Nov 2016 22:37:54 +0200 Message-Id: <9bac5b368e394a2437e325564bf91db8a8f9a00d.1478205331.git.jani@nikula.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: 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: Thu, 03 Nov 2016 20:39:58 -0000 With subcommand handling for external commands we can easily complete 'notmuch emacs-mua' using the existing completion system. --- completion/notmuch-completion.bash | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash index 78047b5f424d..9e1f7bb74bbf 100644 --- a/completion/notmuch-completion.bash +++ b/completion/notmuch-completion.bash @@ -204,6 +204,38 @@ _notmuch_dump() esac } +_notmuch_emacs_mua() +{ + local cur prev words cword split + _init_completion -s || return + + $split && + case "${prev}" in + --to|--cc|--bcc) + COMPREPLY=( $(compgen -W "`_notmuch_email to:${cur}`" -- ${cur}) ) + return + ;; + --body) + _filedir + return + ;; + esac + + ! $split && + case "${cur}" in + -*) + local options="--subject= --to= --cc= --bcc= --body= --no-window-system --client --auto-daemon --create-frame --print --help" + + compopt -o nospace + COMPREPLY=( $(compgen -W "$options" -- ${cur}) ) + ;; + *) + COMPREPLY=( $(compgen -W "`_notmuch_email to:${cur}`" -- ${cur}) ) + return + ;; + esac +} + _notmuch_insert() { local cur prev words cword split @@ -464,7 +496,7 @@ _notmuch_tag() _notmuch() { - local _notmuch_commands="compact config count dump help insert new reply restore search address setup show tag" + local _notmuch_commands="compact config count dump help insert new reply restore search address setup show tag emacs-mua" local arg cur prev words cword split # require bash-completion with _init_completion -- 2.1.4