zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: RE: Trivial patches for FreeBSD
@ 2000-09-07  8:38 Sven Wischnowsky
  2000-09-07 14:40 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2000-09-07  8:38 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> > -  compadd "$@" - /modules/*.ko(:t) && ret=0
> > +  compadd "$@" - /boot/kernel/*.ko(:t) /modules/*.ko(:t) && ret=0
> 
> Should not this be
> 
> compadd "$@" - /boot/kernel/*.ko(N:t) /modules/*.ko(N:t) && ret=0
> 
> ??

That sounds reasonable. I've changed in some other places, too (anyone 
who uses _mailboxes please check my work there).

Bye
 Sven

Index: Completion/Bsd/_bsd_pkg
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Bsd/_bsd_pkg,v
retrieving revision 1.3
diff -u -r1.3 _bsd_pkg
--- Completion/Bsd/_bsd_pkg	2000/08/01 08:26:40	1.3
+++ Completion/Bsd/_bsd_pkg	2000/09/07 08:37:32
@@ -7,7 +7,7 @@
   paths=( "${(@)${(@s.:.)PKG_PATH}:#}" )
   _files "$@" -g \*.tgz && ret=0
   (( $#path )) && _files "$@" -W paths -g \*.tgz && ret=0
-  compadd "$@" - /usr/ports/packages/All/*.tgz && ret=0
+  compadd "$@" - /usr/ports/packages/All/*.tgz(N) && ret=0
 
   return ret
 }
@@ -37,7 +37,7 @@
 	'-d[remove empty directories]' \
 	'-f[force deinstallation]' \
         '-p:prefix directory:_files -/' \
-        '*:package to deinstall:compadd - /var/db/pkg/*(\:t)'
+        '*:package to deinstall:compadd - /var/db/pkg/*(N\:t)'
     ;;
 
   pkg_info)
@@ -57,10 +57,10 @@
 	'-R[show list list of installed requiring packages]' \
 	'-m[show mtree files]' \
 	'-L[show full pathnames of files]' \
-        '-e[test if package is installed]:package name:compadd - /var/db/pkg/*(\:t)' \
+        '-e[test if package is installed]:package name:compadd - /var/db/pkg/*(N\:t)' \
         '-l:prefix directory:_files -/' \
         '-t:mktemp template:_files -/' \
-        '(-a)*:package name:compadd - /var/db/pkg/*(\:t)'
+        '(-a)*:package name:compadd - /var/db/pkg/*(N\:t)'
     ;;
   esac
 }
Index: Completion/Bsd/_kld
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Bsd/_kld,v
retrieving revision 1.3
diff -u -r1.3 _kld
--- Completion/Bsd/_kld	2000/09/06 15:15:32	1.3
+++ Completion/Bsd/_kld	2000/09/07 08:37:32
@@ -4,7 +4,7 @@
 _kld_module() {
   local ret=1
 
-  compadd "$@" - /boot/kernel/*.ko(:t) /modules/*.ko(:t) && ret=0
+  compadd "$@" - /boot/kernel/*.ko(N:t) /modules/*.ko(N:t) && ret=0
   _files "$@" -g \*.ko && ret=0
 
   return ret
Index: Completion/User/_gcc
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_gcc,v
retrieving revision 1.1.1.5
diff -u -r1.1.1.5 _gcc
--- Completion/User/_gcc	2000/03/23 04:19:29	1.1.1.5
+++ Completion/User/_gcc	2000/09/07 08:37:32
@@ -274,7 +274,7 @@
   ;;
 library)
   _wanted libraries expl library \
-      compadd - ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(:t:fr:s/lib//) && ret=0
+      compadd - ${^=LD_LIBRARY_PATH:-/usr/lib /usr/local/lib}/lib*.(a|so*)(N:t:fr:s/lib//) && ret=0
   ;;
 esac
 
Index: Completion/User/_gdb
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_gdb,v
retrieving revision 1.4
diff -u -r1.4 _gdb
--- Completion/User/_gdb	2000/04/11 07:57:57	1.4
+++ Completion/User/_gdb	2000/09/07 08:37:32
@@ -4,13 +4,13 @@
 
 [[ "$PREFIX" = --* ]] &&
     _arguments -- '*=(CORE|SYM)FILE:core file:_files' \
-		  '*=EXECFILE:executable:_files \*\(-\*\)' \
-		  '*=TTY:terminal device:compadd /dev/tty\*' && return 0
+		  '*=EXECFILE:executable:_files -g \*\(-\*\)' \
+		  '*=TTY:terminal device:compadd /dev/tty\*\(N\)' && return 0
 
 if compset -P '-(cd|directory)='; then
   _files -/
 elif compset -P '-tty='; then
-  _wanted devices expl 'terminal device' compadd - /dev/tty*
+  _wanted devices expl 'terminal device' compadd - /dev/tty*(N)
 elif compset -P '-(exec|se)='; then
   _description files expl executable
   _files "$expl[@]" -g '*(-*)'
Index: Completion/User/_mailboxes
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_mailboxes,v
retrieving revision 1.5
diff -u -r1.5 _mailboxes
--- Completion/User/_mailboxes	2000/08/01 08:27:18	1.5
+++ Completion/User/_mailboxes	2000/09/07 08:37:32
@@ -74,10 +74,10 @@
     _mutt_cache=( ${=${(M)${(f)"$(<${~muttrc})"}:#mailboxes *}#mailboxes *} )
 
 
-  _mbox_cache=( ${~maildirectory}/*(^/) )
-  _pine_cache=( ${~pinedirectory}/**/*(.) )
+  _mbox_cache=( ${~maildirectory}/*(N^/) )
+  _pine_cache=( ${~pinedirectory}/**/*(N.) )
 
-  dirboxes=( ${~maildirectory}/*(/) )
+  dirboxes=( ${~maildirectory}/*(N/) )
 
   while (( $#dirboxes )); do
     i=${dirboxes[1]}
@@ -87,7 +87,7 @@
     elif j=( "$i"/<1-> ) && [[ -n "$j" ]]; then
       _mh_cache=( "${_mh_cache[@]}" "$i" )
     else
-      _mbox_cache=( "${_mbox_cache[@]}" "$i"/*(.) )
+      _mbox_cache=( "${_mbox_cache[@]}" "$i"/*(N.) )
       dirboxes=( $dirboxes "$i"/*(/) )
     fi
   done
Index: Completion/User/_zdump
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/User/_zdump,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 _zdump
--- Completion/User/_zdump	2000/03/24 00:01:58	1.1.1.2
+++ Completion/User/_zdump	2000/09/07 08:37:32
@@ -1,7 +1,7 @@
 #compdef zdump
 
 if (( ! $+_zoneinfo_dirs )); then
-  _zoneinfo_dirs=(/usr/share/zoneinfo*(/) /usr/lib/zoneinfo*(/) /usr/share/lib/zoneinfo*(/))
+  _zoneinfo_dirs=( /usr/{share,lib,share/lib}/zoneinfo*(N/) )
 fi
 
 _arguments '-v[lowest possible]' \

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


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

* Re: PATCH: RE: Trivial patches for FreeBSD
  2000-09-07  8:38 PATCH: RE: Trivial patches for FreeBSD Sven Wischnowsky
@ 2000-09-07 14:40 ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2000-09-07 14:40 UTC (permalink / raw)
  To: Sven Wischnowsky, zsh-workers

On Sep 7, 10:38am, Sven Wischnowsky wrote:
} 
} Andrej Borsenkow wrote:
} 
} > compadd "$@" - /boot/kernel/*.ko(N:t) /modules/*.ko(N:t) && ret=0
} 
} That sounds reasonable. I've changed in some other places, too (anyone 
} who uses _mailboxes please check my work there).

Looks OK, but:

Is there EVER a case where we want the completion system to fail with a
"no match" error, or to return a glob pattern instead of an actual file
name?

Maybe _main_complete should setopt nullglob nocshnullglob and have done
with it.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: PATCH: RE: Trivial patches for FreeBSD
  2000-10-05 17:23   ` Andrej Borsenkow
@ 2000-10-06  4:25     ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2000-10-06  4:25 UTC (permalink / raw)
  To: zsh-workers

On Oct 5,  9:23pm, Andrej Borsenkow wrote:
}
} > I've suggested before that we should have one ... function? alias? ...
} > that installs the "standard completion-system setopts"
} 
} Actually, should it not be done by zsh before calling completion widget
} function?

The standard environment used by the set of completion functions supplied
with zsh might not be the same as the standard environment needed by some
other set of functions written by someone else ... just because there is
no other set of functions right now, doesn't mean there never will be.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* RE: PATCH: RE: Trivial patches for FreeBSD
  2000-10-05 17:08 ` Bart Schaefer
@ 2000-10-05 17:23   ` Andrej Borsenkow
  2000-10-06  4:25     ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Andrej Borsenkow @ 2000-10-05 17:23 UTC (permalink / raw)
  To: zsh-workers

>
> I've suggested before that we should have one ... function? alias? ...
> that installs the "standard completion-system setopts" so that we don't
> have to remember to edit all these different places.
>

I second that. Actually, should it not be done by zsh before calling
completion widget function? Setting up standard environment?  If it is the
same everytime anyway ...

-andrej


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

* Re: PATCH: RE: Trivial patches for FreeBSD
  2000-10-05 13:48 Sven Wischnowsky
@ 2000-10-05 17:08 ` Bart Schaefer
  2000-10-05 17:23   ` Andrej Borsenkow
  0 siblings, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2000-10-05 17:08 UTC (permalink / raw)
  To: zsh-workers

On Oct 5,  3:48pm, Sven Wischnowsky wrote:
}
} But since cshnullglob overrides nullglob, we should probably unset
} that in _main_complete, as Bart suggests...

That means there are several other files where this same change should
be made (_complete_help, etc.).

I've suggested before that we should have one ... function? alias? ...
that installs the "standard completion-system setopts" so that we don't
have to remember to edit all these different places.

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


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

* Re: PATCH: RE: Trivial patches for FreeBSD
@ 2000-10-05 13:48 Sven Wischnowsky
  2000-10-05 17:08 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Sven Wischnowsky @ 2000-10-05 13:48 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Sep 7, 10:38am, Sven Wischnowsky wrote:
> } 
> } Andrej Borsenkow wrote:
> } 
> } > compadd "$@" - /boot/kernel/*.ko(N:t) /modules/*.ko(N:t) && ret=0
> } 
> } That sounds reasonable. I've changed in some other places, too (anyone 
> } who uses _mailboxes please check my work there).
> 
> Looks OK, but:
> 
> Is there EVER a case where we want the completion system to fail with a
> "no match" error, or to return a glob pattern instead of an actual file
> name?
> 
> Maybe _main_complete should setopt nullglob nocshnullglob and have done
> with it.

Interestingly, in _main_complete:19 we see:

  setopt localoptions nullglob ...

And it seems to have been there for quite some time. Maybe we (ok, I)
got confused because in some places we use the foo(N) trick to turn a
normal string into a pattern to avoid having to explicitly test for
the existence of files searched.

But since cshnullglob overrides nullglob, we should probably unset
that in _main_complete, as Bart suggests...

Bye
 Sven

Index: Completion/Core/_main_complete
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_main_complete,v
retrieving revision 1.40
diff -u -r1.40 _main_complete
--- Completion/Core/_main_complete	2000/08/03 13:35:44	1.40
+++ Completion/Core/_main_complete	2000/10/05 13:30:51
@@ -16,8 +16,8 @@
 # which makes the output of setopt and unsetopt reflect a different
 # state than the global one for which you are completing.
 
-setopt localoptions nullglob rcexpandparam extendedglob noshglob
-unsetopt markdirs globsubst shwordsplit nounset ksharrays
+setopt localoptions nullglob rcexpandparam extendedglob noshglob \
+       nomarkdirs noglobsubst noshwordsplit unset noksharrays nocshnullglob
 exec </dev/null	# ZLE closes stdin, which can cause errors
 
 # Failed returns from this code are not real errors

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


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

end of thread, other threads:[~2000-10-06  4:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-07  8:38 PATCH: RE: Trivial patches for FreeBSD Sven Wischnowsky
2000-09-07 14:40 ` Bart Schaefer
2000-10-05 13:48 Sven Wischnowsky
2000-10-05 17:08 ` Bart Schaefer
2000-10-05 17:23   ` Andrej Borsenkow
2000-10-06  4:25     ` Bart Schaefer

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