Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug in completion for make



Hello list members,

I'm using zsh 5.0.2 on Mac OSX 10.6 compiled via homebrew.  When I
complete targets for one of my makefiles I get some extra suggestions,
which I should not get.  I have attached a example makefile to reproduce
the issue.

To reproduce the issue copy the attached makefile to a (new) directory
of your choice and run "make prepare".  Then enter "make " and press
CTRL-D. On my system the suggestions are:

  1.pdf
  2.pdf
  3.pdf
  \'s\#src/\(.\*\).tex\#1.pdf
  \|
  clean
  files.mk
  ls
  main
  prepare
  sed
  src/\*.tex

but I expect them to be:

  1.pdf
  2.pdf
  3.pdf
  clean
  files.mk
  main
  prepare

I looked at the code of _make and it seems that the error arises when
the makefile is parsed by _make-parseMakefile.  The line five of my
example file is misinterpreted because it contains a colon.
_make-parseMakefile therefor thinks it is a line containing a target and
a dependency.  The pattern used in _make-parseMakefile (in case ...
esac) is ([[:alnum:]][^$TAB:=]#:[^=]*) .  I do not understand why this
matches a line starting with a TAB-character.  Sadly I also do not know
how to correct this line.

Do you think this can be fixed?

Best regards
Luc
include files.mk
main:
	@echo Compiling main ...
files.mk: $(shell ls -t src/*.tex | head -n 1)
	ls src/*.tex | sed 's#src/\(.*\)\.tex#\1.pdf:#' > files.mk
%.pdf: src/%.tex
	@echo pdflatex ...
clean:
	rm -f files.mk *.pdf
prepare:
	mkdir -p src
	touch src/1.tex src/2.tex src/3.tex
	$(MAKE) files.mk


Messages sorted by: Reverse Date, Date, Thread, Author