Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au
X-Spam-Level: 
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham
	autolearn_force=no version=3.4.1
X-Virus-Scanned: Debian amavisd-new at mfilter46-d.gandi.net
X-Originating-IP: 192.81.128.95
Date: Sat, 2 Jul 2016 14:18:10 -0700
From: arno <arno@renevier.net>
To: zsh-workers@zsh.org
Subject: [PATCH] _setxbmap: fix variants
Message-ID: <20160702211810.GA25575@gandi.net>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="UlVJffcvxoiEqYs2"
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Seq: zsh-workers 38780

--UlVJffcvxoiEqYs2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

In _setxkbmap_variant, the script looks for the pattern *xkb_symbols*\"([[:alnum:]])

This prevent variants containing non alphanumeric symbols to be included in the completion. For example,
$ setxkbmap us <Tab>
fails to suggest altgr-intl, classmate-intl, cz_sk_de, dvorak-classic, dvorak-r, intl-unicode, workman-intl, alt-intl, classmate-altgr-intl, dvorak-intl, sun_type6, alt-intl-
unicode, classmate-alt-intl, dvorak-alt-intl  and dvorak-l variants                                                                                                           

This patch fixes this issue by looking for pattern *xkb_symbols*\"([^\"])

It also replaces # compdef setxkbmap by #compdef setxkbmap. The spurious space prevented the completion to be loaded in the first place.

--UlVJffcvxoiEqYs2
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="setxkbmap.patch"

diff --git a/Completion/X/Command/_setxkbmap b/Completion/X/Command/_setxkbmap
index c490a9d..d192cc1 100644
--- a/Completion/X/Command/_setxkbmap
+++ b/Completion/X/Command/_setxkbmap
@@ -1,4 +1,4 @@
-# compdef setxkbmap
+#compdef setxkbmap
 
 # TODO:
 # model, option, symbols and types suggestions
@@ -90,7 +90,7 @@ _setxkbmap_variant () {
     fi
 
     lines=("${(f)$(< ${file})}")
-    variants=(${${${(M)lines:#*xkb_symbols*\"([[:alnum:]])##\"*}##*xkb_symbols([^\"])##\"}%%\"*})
+    variants=(${${${(M)lines:#*xkb_symbols*\"([^\"])##\"*}##*xkb_symbols([^\"])##\"}%%\"*})
     
     _wanted variant expl 'variant' compadd -a variants
 

--UlVJffcvxoiEqYs2--

