From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9320 invoked by alias); 19 May 2016 09:28:06 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21583 Received: (qmail 9045 invoked from network); 19 May 2016 09:28:03 -0000 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 To: Zsh Users From: Paul Seyfert Subject: _gnu_generic for aliases X-Enigmail-Draft-Status: N1110 Message-ID: <573D7E67.10600@mathphys.fsk.uni-heidelberg.de> Date: Thu, 19 May 2016 10:50:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi, my situation is the following, I have aliases which are defined somewhere in /etc/zprofile (i.e. changing where and how the aliases are defined is not directly accessible to me and can affect other users). I already wrote my own completion function for them: _arguments '-c:configuration:->listconfigs' case $state in (listconfigs) local -a theconfigs # just hard coded strings I don't want to remember/type/mistype theconfigs=(x256_777_May x375_324_Jun x942_113_Feb) _describe 'config' theconfigs ;; esac such that I can call the completion with fancyalias -c This already covers most of my usages of the alias, but I'd like to improve it a little more. One of the executables is actually in the PATH so I could test that the following does what it should do for the executable in the PATH _arguments '-c:configuration:->listconfigs' ':::->whatelse' case $state in (listconfigs) local -a theconfigs # just hard coded strings I don't want to remember/type/mistype theconfigs=(x256_777_May x375_324_Jun x942_113_Feb) _describe 'config' theconfigs ;; (whatelse) _gnu_generic ;; esac i.e. not only expand -c and its arguments, but also suggests completions on -- This however does not work for the fancyalias. I crosschecked that also compdef _gnu_generic fancyalias does not result in any suggestions. My understanding is that the _gnu_generic function does not know about the fancyalias / I cannot use the fancyalias inside the _gnu_generic function. Is there a way to make _gnu_generic work for aliases? Thanks, Paul