From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12615 invoked by alias); 2 Sep 2016 22:03:45 -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: X-Seq: 39164 Received: (qmail 18794 invoked from network); 2 Sep 2016 22:03:45 -0000 X-Qmail-Scanner-Diagnostics: from mail-wm0-f48.google.com 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(74.125.82.48):SA:0(0.0/5.0):. Processed in 0.478026 secs); 02 Sep 2016 22:03:45 -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=0.0 required=5.0 tests=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: m0viefreak.cm@googlemail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 74.125.82.48 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=68FrQhO8u0yxCU+ISDJf9G+EsjOqqbhDJkuvalTkoHc=; b=lGjVrGe1tl//Rj0OVmIa3cIDxHgPhGZRunM1HCUvl1BPpXnYLkfPK4tyE5DU+UFtQ5 uqwgNQSj5Rl157uuqtn4DRk8qz5lMhcMaVTg5ScL6BnyeTjqTqxKFVVyANPE0yEB2O+l Xf8vyjfrAkIn3L1eAbWwmunlX3hOWZ6lmPB7mt4ZvGhajKulY4iqyrWDH62XUmTbbxNi Ath+exmB2m6GqixNURCKjcWFbl55R5HQatxel7aK+t0rme/2Bd0HU3EBizWadh4w2Pz0 eNUfpRkhjVGlTP0dXWq1+D1K5407n3NFOFf6ofsuSqR7/bxZdtNKEFh6yE2XsvH//WtB jEcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=68FrQhO8u0yxCU+ISDJf9G+EsjOqqbhDJkuvalTkoHc=; b=ee3g1b7G92w10O2SurwrHzLgUmq16WD9nKKGITkLMKFxp3q8AgM2nxsOSTAaR0feA3 M7JnYBa8fA93EwKG70anBcsT0/Q9cMX/Af72IGDeqt93RgKlf2WTp5qus4sPlnK2jXcs I6mAVBcWhokzGPup+pFLinbP99MIVM8OqxswqSUx6w2EeshY1Lbd8vLyIhCfQ8WOwrc7 g5B+Sm6iFZnywDezcoMI/KmukUrNy5bDR7d8K6d9Ed0YSXkUdcOA4WxIAUauOzE87LSI gKTyknmtV9MHl6/C5p+hs6crWhSX+j6MCk2USdXpUpVqFoR5PvErX7UQdUXV7t6gCY9P /3Fg== X-Gm-Message-State: AE9vXwNDZlgEp15HypE4eQycxYktseZz1Uf3fUd7WQZffqmyvqKAKVlgkr3OWx9ZfFkJrA== X-Received: by 10.28.149.137 with SMTP id x131mr1337139wmd.79.1472850178487; Fri, 02 Sep 2016 14:02:58 -0700 (PDT) Subject: Re: buggy configure completion - when both --enable-foo and --disable-foo are listed To: zsh-workers@zsh.org References: <20160830232332.GA23779@zira.vinc17.org> <20160831030055.GC30557@fujitsu.shahaf.local2> <854eeb20-f9b9-f918-4739-82597bbccb1a@googlemail.com> <160901182720.ZM6370@torch.brasslantern.com> From: m0viefreak Message-ID: Date: Fri, 2 Sep 2016 23:02:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <160901182720.ZM6370@torch.brasslantern.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 02.09.2016 03:27, Bart Schaefer wrote: > On Aug 31, 10:27pm, m0viefreak wrote: > } > } On 31.08.2016 05:00, Daniel Shahaf wrote: > } > I think that's the best we can do without writing new C code to suport > } > multiline descriptions. > } > } This has been working well for me: > } > } zstyle ':completion:*:configure:*:options' command $'print -r -- "${$(COLUMNS=9999 ${~words[1]} --help)//\n #/ }"' > > If that works, then we ought to be able to rewrite the loop starting > at about line 91 of _arguments. But that loop already seems to be > looking for lines with leading spaces, whereas if I'm reading your > pattern correctly you're unfolding lines with more than six leading > spaces to make them part of the previous line? > > I have to update that to look for more than eight spaces for it to work > right for zsh's ./configure Oh, right, I'm missing one #. It should have been '[8spaces]##': zstyle ':completion:*:configure:*:options' command $'print -r -- "${$(COLUMNS=9999 ${~words[1]} --help)//\n ##/ }"' > and even then it mysteriously fails to pick > out defaults [/usr/local] and [PREFIX] for --prefix and --exec-prefix > respectively, though it gets it right for --datarootdir et al. This works fine for me: ~/sources/zsh $ ./configure --e Completing: option --enable-additional-fpath -- add directories to default function path --enable-ansi2knr -- translate source to K&R C before compiling --enable-cap -- enable the search for POSIX capabilities (may require additional headers to be added by hand) --enable-cflags -- specify C compiler flags --enable-cppflags -- specify C preprocessor flags --enable-custom-patchlevel -- set a custom ZSH_PATCHLEVEL value --enable-etcdir -- the default directory for global zsh scripts --enable-fndir -- the directory in which to install functions --enable-function-subdirs -- install functions in subdirectories --enable-ldflags -- specify linker flags --enable-libc-musl -- compile with musl as the C library --enable-libs -- specify link libraries --enable-maildir-support -- enable maildir support in MAIL and MAILPATH --enable-max-function-depth -- limit function depth to MAX, default 1000 --enable-multibyte -- support multibyte characters --enable-pcre -- enable the search for the pcre library (may create run-time library dependencies) --enable-readnullcmd -- pager used when READNULLCMD is not set --enable-runhelpdir -- the directory in which to install run-help files --enable-scriptdir -- the directory in which to install scripts --enable-site-fndir -- same for site functions (not version specific) --enable-site-scriptdir -- same for site scripts (not version specific) --enable-stack-allocation -- allocate stack memory e.g. with `alloca' --enable-zlogin -- the full pathname of the global zlogin script --enable-zlogout -- the full pathname of the global zlogout script --enable-zprofile -- the full pathname of the global zprofile script --enable-zsh-debug -- compile with debug code and debugger symbols --enable-zsh-hash-debug -- turn on debugging of internal hash tables --enable-zsh-heap-debug -- turn on error checking for heap allocation --enable-zsh-mem -- compile with zsh memory allocation routines --enable-zsh-mem-debug -- debug zsh memory allocation routines --enable-zsh-mem-warning -- print warnings for errors in memory allocation --enable-zsh-secure-free -- turn on error checking for free() --enable-zsh-valgrind -- turn on support for valgrind debugging of heap memory --enable-zshenv -- the full pathname of the global zshenv script --enable-zshrc -- the full pathname of the global zshrc script --exec-prefix -- install architecture-dependent files in EPREFIX (PREFIX) ~/sources/zsh $ ./configure --p Completing: option --pdfdir -- pdf documentation (DOCDIR) --prefix -- install architecture-independent files in PREFIX (/usr/local) --program-prefix -- prepend PREFIX to installed program names --program-suffix -- append SUFFIX to installed program names --program-transform-name -- run sed PROGRAM on installed program names --psdir -- ps documentation (DOCDIR) Also, slightly related: The _configure completion could benefit from my patch I sent back in march: http://www.zsh.org/mla/workers//2016/msg00674.html