about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2001-02-08 17:50:26 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2001-02-08 17:50:26 +0000
commit5723d260c0928b85989bfde7b48f26acf2d9f8c5 (patch)
treed305429682529f33792354265f39cc16ad736546 /Completion
parent14d2dae44c6ccc408ee2f7b558ea31f28b2b5936 (diff)
downloadzsh-5723d260c0928b85989bfde7b48f26acf2d9f8c5.tar.gz
zsh-5723d260c0928b85989bfde7b48f26acf2d9f8c5.tar.xz
zsh-5723d260c0928b85989bfde7b48f26acf2d9f8c5.zip
add completion for newsgroups (13448)
Diffstat (limited to 'Completion')
-rw-r--r--Completion/User/.distfiles4
-rw-r--r--Completion/User/_netscape4
-rw-r--r--Completion/User/_newsgroups9
-rw-r--r--Completion/User/_tin2
4 files changed, 15 insertions, 4 deletions
diff --git a/Completion/User/.distfiles b/Completion/User/.distfiles
index d6abd4e1e..6d88112c0 100644
--- a/Completion/User/.distfiles
+++ b/Completion/User/.distfiles
@@ -7,12 +7,12 @@ DISTFILES_SRC='
     _gs _gv _gzip _hosts _imagemagick _ispell
     _java _joe _killall _lp _look _lynx _lzop
     _mailboxes _make _man _mere _mh _mount _mutt _my_accounts _mysql_utils
-    _nedit _netscape _nslookup _other_accounts
+    _nedit _netscape _newsgroups _nslookup _other_accounts
     _pack _patch _pbm _pdf _perl _perl_basepods _perl_builtin_funcs
     _perl_modules _perldoc _ports _prcs _printers _prompt _ps _pspdf
     _psutils _rcs _rlogin
     _sh _slrn _socket _ssh _strip _stty _su _sudo
-    _tar _tar_archive _telnet _tex _texi _tiff _tilde_files
+    _tar _tar_archive _telnet _tex _texi _tiff _tilde_files _tin
     _urls _use_lo _user_at_host _users _users_on
     _webbrowser _wget _whereis _whois _xargs _yodl _yp
     _zcat _zdump
diff --git a/Completion/User/_netscape b/Completion/User/_netscape
index 2aba6750d..99d6ee45c 100644
--- a/Completion/User/_netscape
+++ b/Completion/User/_netscape
@@ -74,13 +74,15 @@ if [[ "$state" = "urls" ]]; then
     _wanted values expl 'about what' \
         compadd "$@" authors blank cache document fonts global hype image-cache \
             license logo memory-cache mozilla plugins && ret=0
+  elif compset -P news: ; then
+    _newsgroups "$@" && ret=0
   else
     _tags prefixes
     while _tags; do
       while _next_label prefixes expl 'URL prefix' "$@"; do
         _urls "$expl[@]" && ret=0
 	compset -S '[^:]*'
-        compadd -S '' "$expl[@]" about: mocha: javascript: && ret=0
+        compadd -S '' "$expl[@]" about: news: mocha: javascript: && ret=0
       done
       (( ret )) || return 0
     done
diff --git a/Completion/User/_newsgroups b/Completion/User/_newsgroups
new file mode 100644
index 000000000..74e878d11
--- /dev/null
+++ b/Completion/User/_newsgroups
@@ -0,0 +1,9 @@
+#autoload
+
+local expl
+
+: ${(A)_cache_newsgroups:=${${(f)"$(fgrep -vh \! ~/.newsrc*)"}%:*}}
+
+(( ${(w)#_cache_newsgroups} )) && _wanted newsgroups expl 'newsgroup' \
+    _multi_parts "$@" -i . _cache_newsgroups
+
diff --git a/Completion/User/_tin b/Completion/User/_tin
index 2441acf1f..21525c35d 100644
--- a/Completion/User/_tin
+++ b/Completion/User/_tin
@@ -34,7 +34,7 @@ _arguments -C -s \
   "-X[don't save any files on quit]" \
   '-z[start if any unread news]' \
   '-Z[return status to indicate if any unread news]' \
-  '::newsgroup' && return 0
+  '::newsgroup:_newsgroups' && return 0
 
 if [[ "$state" = newshosts ]]; then
   newshosts=( ${${(f)"$(<~/.tin/newsrctable)"}%%\#*} ) 2>/dev/null