zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _make complete filenames as a last resort.
@ 1999-06-07  1:07 Tanaka Akira
  1999-06-07  6:43 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Tanaka Akira @ 1999-06-07  1:07 UTC (permalink / raw)
  To: zsh-workers

If targets for makefiles contain variable references, _make can not
generate proper completion candidate.

I think it is useful to complete normal filenames as a last resort.

--- Completion/User/_make-	Mon Jun  7 10:00:59 1999
+++ Completion/User/_make	Mon Jun  7 10:01:07 1999
@@ -1,3 +1,4 @@
 #compdef make gmake pmake
 
-compgen -s "\$(awk '/^[a-zA-Z0-9][^\/ 	]+:/ {print \$1}' FS=: [mM]akefile /dev/null)"
+compgen -s "\$(awk '/^[a-zA-Z0-9][^\/ 	]+:/ {print \$1}' FS=: [mM]akefile /dev/null)" ||
+compgen -f

-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: _make complete filenames as a last resort.
  1999-06-07  1:07 PATCH: _make complete filenames as a last resort Tanaka Akira
@ 1999-06-07  6:43 ` Bart Schaefer
  1999-06-07 18:23   ` Tanaka Akira
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 1999-06-07  6:43 UTC (permalink / raw)
  To: zsh-workers

On Jun 7, 10:07am, Tanaka Akira wrote:
} Subject: PATCH: _make complete filenames as a last resort.
}
} If targets for makefiles contain variable references, _make can not
} generate proper completion candidate.

Hmm; if targets for makefiles contain anything other than alphanumerics,
_make doesn't generate proper completion candidates.  What's the reason
for leaving [-._] out of the character class?  Maybe [/+,] too.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: _make complete filenames as a last resort.
  1999-06-07  6:43 ` Bart Schaefer
@ 1999-06-07 18:23   ` Tanaka Akira
  0 siblings, 0 replies; 4+ messages in thread
From: Tanaka Akira @ 1999-06-07 18:23 UTC (permalink / raw)
  To: zsh-workers

In article <990607064350.ZM18009@candle.brasslantern.com>,
  "Bart Schaefer" <schaefer@candle.brasslantern.com> writes:

> Hmm; if targets for makefiles contain anything other than alphanumerics,
> _make doesn't generate proper completion candidates.

No. /^[a-zA-Z0-9][^\/ 	]+:/ matches any filename beginning with
alphanumerics.
-- 
Tanaka Akira


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PATCH: _make complete filenames as a last resort.
@ 1999-06-08  7:07 Sven Wischnowsky
  0 siblings, 0 replies; 4+ messages in thread
From: Sven Wischnowsky @ 1999-06-08  7:07 UTC (permalink / raw)
  To: zsh-workers


Tanaka Akira wrote:

> In article <990607064350.ZM18009@candle.brasslantern.com>,
>   "Bart Schaefer" <schaefer@candle.brasslantern.com> writes:
> 
> > Hmm; if targets for makefiles contain anything other than alphanumerics,
> > _make doesn't generate proper completion candidates.
> 
> No. /^[a-zA-Z0-9][^\/ 	]+:/ matches any filename beginning with
> alphanumerics.

Just for the record: this function was in the first example file for
the new completion stuff and hasn't change since then. At that time I
really didn't have the time to write anything more sophisticated -- it 
is a hack.
So we probably should change this function to something better (and
faster, using compadd and only shell-code, no awk) anyway.
However, I explicitly excluded targets with slashes in them because if 
you use makedepend or something like that, you normally end up with
lots of full path names as targets -- and that for every system header 
file (a better solution would probably be to search only lines up the
makedepend marker-comment or something like that...).

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-06-08  7:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-06-07  1:07 PATCH: _make complete filenames as a last resort Tanaka Akira
1999-06-07  6:43 ` Bart Schaefer
1999-06-07 18:23   ` Tanaka Akira
1999-06-08  7:07 Sven Wischnowsky

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).