zsh-workers
 help / color / mirror / code / Atom feed
* Portabilities issues of the completion
@ 1999-11-10 17:19 Akim Demaille
  0 siblings, 0 replies; 3+ messages in thread
From: Akim Demaille @ 1999-11-10 17:19 UTC (permalink / raw)
  To: Zsh Task Force


Hi People,

In one word, the regexp (a|) is not portable.  mawk hates, gawk loves.
Completion of make is affected on all the debian systems.

\? is portable.

According to one of the most aesthetic regexp I ever had to write:

share/zsh/functions # egrep '(\(\||\|\))' -- `fgrep awk -il *`   nostromo 18:15
_make:          /^\.include  *<bsd\.port\.(subdir\.|pre\.|)mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.|)mk"/ {
_mh:elif [[ "$prev" = -(no|)cc ]]; then
_zftp:  *(get(|at)|gcp|delete|remote))
_zftp:  *(put(|at)|pcp))

Only _make was affected, the others were not awking in the
corresponding section.

Regards,

        Akim

share/zsh/functions # diff -u _make.orig _make                   nostromo 18:16
--- _make.orig  Wed Nov 10 18:13:37 1999
+++ _make       Wed Nov 10 18:14:02 1999
@@ -22,7 +22,7 @@
   [[ -n "$file" ]] &&
     compadd "$expl[@]" - \
       $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1}
-            /^\.include  *<bsd\.port\.(subdir\.|pre\.|)mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.|)mk"/ {
+            /^\.include  *<bsd\.port\.(subdir\.|pre\.)\?mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.)\?mk"/ {
               print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \
            FS=: $file) && ret=0
   (( ret )) && { compset -P 1 '*\='; _files }


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

* Re: Portabilities issues of the completion
  1999-11-10 17:29 Akim Demaille
@ 1999-11-10 19:41 ` Tanaka Akira
  0 siblings, 0 replies; 3+ messages in thread
From: Tanaka Akira @ 1999-11-10 19:41 UTC (permalink / raw)
  To: Zsh Task Force

In article <mv4hfiuuuf1.fsf@nostromo.lrde.epita.fr>,
  Akim Demaille <akim@epita.fr> writes:

> My previous mail contains a mistake: use ?, not \?.  Though it should
> not make differences, AFAICT.

Thanks. I didn't know that (a|) is not portable.

But 8612 has mistake. It uses \? for second match.
This patch should be applyed over 8612.

Index: Completion/User/_make
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_make,v
retrieving revision 1.1.1.13
diff -u -r1.1.1.13 _make
--- Completion/User/_make	1999/11/10 19:27:53	1.1.1.13
+++ Completion/User/_make	1999/11/10 19:35:41
@@ -22,7 +22,7 @@
   [[ -n "$file" ]] &&
     compadd "$expl[@]" - \
       $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1}
-	     /^\.include  *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.)\?mk"/ {
+	     /^\.include  *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.)?mk"/ {
 	       print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \
 	    FS=: $file) && ret=0
   (( ret )) && { compset -P 1 '*\='; _files }
-- 
Tanaka Akira


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

* Portabilities issues of the completion
@ 1999-11-10 17:29 Akim Demaille
  1999-11-10 19:41 ` Tanaka Akira
  0 siblings, 1 reply; 3+ messages in thread
From: Akim Demaille @ 1999-11-10 17:29 UTC (permalink / raw)
  To: Zsh Task Force


Sorry,

My previous mail contains a mistake: use ?, not \?.  Though it should
not make differences, AFAICT.

        Akim

share/zsh/functions # diff -u _make.orig _make                   nostromo 18:16
--- _make.orig  Wed Nov 10 18:13:37 1999
+++ _make       Wed Nov 10 18:14:02 1999
@@ -22,7 +22,7 @@
   [[ -n "$file" ]] &&
     compadd "$expl[@]" - \
       $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1}
-            /^\.include  *<bsd\.port\.(subdir\.|pre\.|)mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.|)mk"/ {
+            /^\.include  *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include  *".*mk\/bsd\.pkg\.(subdir\.)\?mk"/ {
               print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \
            FS=: $file) && ret=0
   (( ret )) && { compset -P 1 '*\='; _files }


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

end of thread, other threads:[~1999-11-10 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-10 17:19 Portabilities issues of the completion Akim Demaille
1999-11-10 17:29 Akim Demaille
1999-11-10 19:41 ` Tanaka Akira

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