zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: [PATCH 0/3] completion: make: various improvements
Date: Tue, 2 Aug 2022 19:42:53 +0900	[thread overview]
Message-ID: <BE06862D-C2C9-4777-AF77-B4691F87ED4F@kba.biglobe.ne.jp> (raw)
In-Reply-To: <20220730010310.3383526-1-felipe.contreras@gmail.com>


> 2022/07/30 10:03, Felipe Contreras <felipe.contreras@gmail.com> wrote:
> 
> While using `call-command` I found very serious issues, for starters
> trying to complete `make` in the zsh source code takes several minutes
> to complete.
> 
>  zstyle ':completion:*:make:*:targets' call-command true

Thanks.
Could you please update [PATCH 2/3]?
(The comment for [PATCH 1/3] is just a note and can be ignored.)


[PATCH 1/3]
> At least in GNU make 4.3 the -n option is *not* respected and
> --always-make builds everything.

This is indeed serious; just hitting <TAB> for completion should
_never_ build anything.

> Instead use a fake .DEFAULT target the way bash-completion does.

If there is a target .DEFAULT in the user's Makefile, its recipe
is not executed (due to the -n option) but is echoed to stdout
(although the -s option is passed to make; I don't know why).
In the _worst_ case this may confuse make-parseDataBase().
For example, if Makefile has the following two lines:

.DEFAULT:
 	echo foo: bar

then the output of 'make -nsp .DEFAULT' contains a line

echo foo: bar

and 'echo foo' will be offered as a possible target.
But I think we can ignore such (extremely) rare cases.


[PATCH 2/3]
> The make program does all the heavy lifting, there's no need to use a
> full parser.

With this patch, if I type 'make <TAB>' in the zsh src directory,
it offers the following files as targets:
    configure.ac, Makefile.in, aclocal.m4   etc.
These are not make targets, and in the output of 'make -nsp',
these are preceded by a line

# Not a target:

I think a (wrong) target after this line should be ignored.


  parent reply	other threads:[~2022-08-02 10:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-30  1:03 Felipe Contreras
2022-07-30  1:03 ` [PATCH 1/3] completion: make: don't build everything Felipe Contreras
2022-07-30  1:03 ` [PATCH 2/3] completion: make: add a simpler parser Felipe Contreras
2022-07-30  1:03 ` [PATCH 3/3] completion: make: fix whitespaces Felipe Contreras
2022-08-04  8:50   ` Jun T
2022-08-04 15:57     ` Felipe Contreras
2022-08-02 10:42 ` Jun T [this message]
2022-08-02 23:02   ` [PATCH 0/3] completion: make: various improvements Felipe Contreras
2022-08-03  8:48     ` Jun T
2022-08-03 14:36       ` Felipe Contreras
2022-08-04  9:33         ` Jun T
2022-08-04 17:03           ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BE06862D-C2C9-4777-AF77-B4691F87ED4F@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).