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 2AA3C6DE1B32 for ; Sat, 25 Feb 2017 01:25:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.186 X-Spam-Level: X-Spam-Status: No, score=-0.186 tagged_above=-999 required=5 tests=[AWL=-0.166, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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 KkeKOiF2XuXF for ; Sat, 25 Feb 2017 01:25:50 -0800 (PST) Received: from mail-lf0-f68.google.com (mail-lf0-f68.google.com [209.85.215.68]) by arlo.cworth.org (Postfix) with ESMTPS id 8EC316DE1A96 for ; Sat, 25 Feb 2017 01:25:49 -0800 (PST) Received: by mail-lf0-f68.google.com with SMTP id z127so2915611lfa.2 for ; Sat, 25 Feb 2017 01:25:49 -0800 (PST) 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; bh=hL9TWHTZ8KhG3bl1eQ3PlaL97x7XV/+nzfy/U5OEQ14=; b=siK/YEw6urgIyJzBDkDcKvMsR9ONJpX4llIZ4dlXOXW1mKEXa6tlj6xHbDbpF08W1C oaluSxIDO2x9TFjUY+uRPi0Lg3IwBxYtQ7HrXkEHFPUbfdKDRjVR9msIrFWOBtnrW7lv cGCA6XiIsr0y6lUCOSs8FyG7K+An1zmu3nH0yqzQSI2uT1b7eIBSYvkJZdJTvnAg3QsB mJrvHBwz936wyKveg//9+yelD6cboGtmrMht30srKKl1i4M4n2hCwg4hJ4jgA/jHQ+Zh /On/PzYfuD2WE3e8N7WRVHT/bjMyXgQEANaMGd+l1zqgSh5mIH3Fp2B8Phz9h67Zni+3 idfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hL9TWHTZ8KhG3bl1eQ3PlaL97x7XV/+nzfy/U5OEQ14=; b=fAb5L77bTim/y8W/BaO+AZj0ta+0QhEjwa65mCgJ+jMbmkPr/9NH/6Qjr4cDWlhrkg HhBK9BquTbqJc6M0LD7p7jSHWtS7I8lwfudgl61c0GgflGMZvyBUwBUDcpyL9Mvq3ojt 9B3OO8WaaP2czn4aTk9pmAlrNg0zOSDbBIH0hTGpHIBKMWa71kuvRbb0YUmOr35FHiGG vJTbcb6jPR6LozqcnjHg3i2dy7Ac6fRdVh7Mxmq0P6QNVitWahpI6Hb6GPHVK1ClupAA nJzwnP8jDsnU63OGmeBh7+Uz7/IXKm/vRTLUOa74dKwOoD5YZ33ydbtuF0PNfVu1xuRN uIVA== X-Gm-Message-State: AMke39ksffC9spIy14PkHKQtxIqlVvwSJXMDewOvj7tiLPIcG8AYHUTRzRONxVSUwWE+YQ== X-Received: by 10.25.18.225 with SMTP id 94mr197547lfs.131.1488014744381; Sat, 25 Feb 2017 01:25:44 -0800 (PST) Received: from localhost (mobile-access-bcee80-14.dhcp.inet.fi. [188.238.128.14]) by smtp.gmail.com with ESMTPSA id 196sm1879325ljf.62.2017.02.25.01.25.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Feb 2017 01:25:43 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [PATCH 1/2] completion: complete notmuch emacs-mua Date: Sat, 25 Feb 2017 11:25:39 +0200 Message-Id: <20170225092540.13627-1-jani@nikula.org> X-Mailer: git-send-email 2.11.0 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: Sat, 25 Feb 2017 09:25:51 -0000 With subcommand handling for external commands we can easily complete 'notmuch emacs-mua' using the existing completion system. --- v3: complete --hello option --- 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 d44b2a2811f0..40012eaaffd9 100644 --- a/completion/notmuch-completion.bash +++ b/completion/notmuch-completion.bash @@ -236,6 +236,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 --hello" + + 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 @@ -496,7 +528,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.11.0