From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH] emacs: Add shell completions for 'guix refresh --type'. Date: Wed, 28 Oct 2015 21:55:00 +0300 Message-ID: <87io5qygaj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrVsG-00021X-SY for guix-devel@gnu.org; Wed, 28 Oct 2015 14:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrVsB-0001NV-Rz for guix-devel@gnu.org; Wed, 28 Oct 2015 14:55:04 -0400 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]:35389) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrVsB-0001NC-Ks for guix-devel@gnu.org; Wed, 28 Oct 2015 14:54:59 -0400 Received: by lfbn126 with SMTP id n126so8276865lfb.2 for ; Wed, 28 Oct 2015 11:54:59 -0700 (PDT) Received: from leviafan ([217.107.192.146]) by smtp.gmail.com with ESMTPSA id a143sm4149596lfe.21.2015.10.28.11.54.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2015 11:54:58 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain This is for completions in "M-x shell". --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-emacs-Add-shell-completions-for-guix-refresh-type.patch >From 5c2294db69811395650db151d14d548495002cfb Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Wed, 28 Oct 2015 20:48:45 +0300 Subject: [PATCH] emacs: Add shell completions for 'guix refresh --type'. * emacs/guix-pcomplete.el (guix-pcomplete-refresh-updaters): New function. (guix-pcomplete-complete-option-arg): Complete '-t/--type' option for 'guix refresh' command. --- emacs/guix-pcomplete.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/emacs/guix-pcomplete.el b/emacs/guix-pcomplete.el index 98f8efd..3074dc8 100644 --- a/emacs/guix-pcomplete.el +++ b/emacs/guix-pcomplete.el @@ -128,6 +128,13 @@ subcommands, actions, etc. for this guix COMMAND." guix-help-parse-regexp-group "graph" "--list-types")) +(guix-memoized-defun guix-pcomplete-refresh-updaters () + "Return a list of all available refresh updater types." + (guix-pcomplete-run-guix-and-search + guix-help-parse-list-regexp + guix-help-parse-regexp-group + "refresh" "--list-updaters")) + ;;; Completing @@ -287,9 +294,12 @@ INPUT is the current partially completed string." (option? "-u" "--user")) (complete* (pcmpl-unix-user-names))) - ((and (command? "refresh") - (option? "-s" "--select")) - (complete* guix-help-refresh-subsets)) + ((command? "refresh") + (cond + ((option? "-s" "--select") + (complete* guix-help-refresh-subsets)) + ((option? "-t" "--type") + (complete* (guix-pcomplete-refresh-updaters))))) ((and (command? "size") (option? "-m" "--map-file")) -- 2.5.0 --=-=-=--