From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: zsh-workers-return-43495-ml=inbox.vuxu.org@zsh.org X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 546fa8f3 for ; Wed, 19 Sep 2018 04:53:48 +0000 (UTC) Received: (qmail 23471 invoked by alias); 19 Sep 2018 04:53:35 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 43495 Received: (qmail 2777 invoked by uid 1010); 19 Sep 2018 04:53:35 -0000 X-Qmail-Scanner-Diagnostics: from www138.your-server.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(88.198.28.7):SA:0(-2.6/5.0):. Processed in 3.335963 secs); 19 Sep 2018 04:53:35 -0000 X-Envelope-From: debts@xk2c.de X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | To: Zsh hackers list From: TS Subject: Re: PATCH: search XDG_DATA_DIRS in _setxkbmap completion Message-ID: <8b957638-8f81-f000-85cb-19aa6a05de75@xk2c.de> Date: Wed, 19 Sep 2018 06:53:22 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Authenticated-Sender: yup4hing8ed1teph9@Xk2c.de X-Virus-Scanned: Clear (ClamAV 0.100.1/24955/Wed Sep 19 06:02:18 2018) Hello > How should empty array elements in XDG_DATA_DIRS be handled? E.g., > XDG_DATA_DIRS=/foo:/bar::/baz ? how about s.th. around the lines of: tosh ~ % XDG_DATA_DIRS=/usr/lib/X11/xkb:/usr/share/X11/xkb:/usr/local/lib/X11/xkb:/usr/local/share/X11/xkb tosh ~ % typeset -aU searchdirs tosh ~ % searchdirs=(${(s.:.)XDG_DATA_DIRS} {/usr/lib,/usr/share,/usr/local/lib,/usr/local/share}/X11/xkb ${XDG_DATA_HOME} ~/.local/share/X11/xkb) tosh ~ % ev searchdirs array-unique searchdirs: 1='/usr/lib/X11/xkb' 2='/usr/share/X11/xkb' 3='/usr/local/lib/X11/xkb' 4='/usr/local/share/X11/xkb' 5='/home/heinb/.local/share/X11/xkb' tosh ~ % searchdirs+=('') << just for example tosh ~ % ev searchdirs array-unique searchdirs: 1='/usr/lib/X11/xkb' 2='/usr/share/X11/xkb' 3='/usr/local/lib/X11/xkb' 4='/usr/local/share/X11/xkb' 5='/home/heinb/.local/share/X11/xkb' 6='' <<------ empty tosh ~ % searchdirs=(${^~searchdirs}(N/)) tosh ~ % ev searchdirs array-unique searchdirs: 1='/usr/share/X11/xkb' kind regards, Thilo