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

Re: Various completion contributions



On Sat, 15 Jan 2011 21:48:33 -0500
gi1242+zsh@xxxxxxxxx wrote:
> >>     _tex	New completion file
> > 
> > There's already one in Completion/Unix/Type/_tex, so I've ignored
> > this.
> 
> That only completes file types. I'd remove it and replace it with the
> version attached (in Completion/Unix/Command instead).

That's a better place since it handles commands.

Thanks for the changes.

Here's what I'm applying, shouldn't differ materially...

Index: Completion/Unix/Command/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/.distfiles,v
retrieving revision 1.111
diff -p -u -r1.111 .distfiles
--- Completion/Unix/Command/.distfiles	9 Jan 2011 16:57:01 -0000	1.111
+++ Completion/Unix/Command/.distfiles	16 Jan 2011 19:36:37 -0000
@@ -207,6 +207,7 @@ _tardy
 _tcpdump
 _tcptraceroute
 _telnet
+_tex
 _texinfo
 _tidy
 _tiff
@@ -240,7 +241,6 @@ _wiggle
 _xargs
 _xmlsoft
 _xmms2
-_xournal
 _yafc
 _yodl
 _yp
Index: Completion/Unix/Command/_lp
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_lp,v
retrieving revision 1.5
diff -p -u -r1.5 _lp
--- Completion/Unix/Command/_lp	9 Jan 2011 16:57:01 -0000	1.5
+++ Completion/Unix/Command/_lp	16 Jan 2011 19:36:37 -0000
@@ -1,7 +1,5 @@
 #compdef lp lpr lpq lprm lpoptions lpstat
 
-local expl ret=1 printer list disp strs shown
-
 _lp_get_printer()
 {
   # No reason to call _lp_get_printer when service == lpstat. Others matched
@@ -22,6 +20,7 @@ _lp_get_printer()
 
 _lp_job_options()
 {
+  local expl printer
   local -a lopts_with_args lopts_no_args
 
   # Generic options (from lp manual page)
@@ -84,6 +83,9 @@ _lp_job_options()
 
 _lp_list_jobs()
 {
+  local ret=1 printer shown
+  local -a list disp strs
+
   _lp_get_printer
   [[ -n "$printer" ]] && printer=(-P $printer)
 
@@ -125,95 +127,101 @@ _lp_list_jobs()
   return 1
 }
 
-case $service in
-  (lpq)
-    _arguments \
-      '-E[Force encryption]' \
-      '-U:username (for connection to server):_users' \
-      '-h:alternate server:_hosts' \
-      '(-a)-P+[destination printer]:printers:_printers' \
-      '(-P)-a[all printers]' \
-      '-l[long listing]' \
-      '*:poll interval (+seconds):'
-    ;;
-
-  (lprm)
-    _arguments \
-      '-E[Force encryption]' \
-      '-U:username (for connection to server):_users' \
-      '-h:alternate server:_hosts' \
-      '-P+[destination printer]:printers:_printers' \
-      '*:job ids:_lp_list_jobs'
-    ;;
-
-  (lpoptions)
-    _arguments \
-      '-E[Force encryption]' \
-      '-U:username (for connection to server):_users' \
-      '-h:alternate server:_hosts' \
-      '(-p -l -r -x)-d[set default printer]:printers:_printers' \
-      '(-l -x)*-o:job options:_lp_job_options' \
-      '(-d -x)-p[destination printer for options]:printers:_printers' \
-      '(-d -o -r -x)-l[list options]' \
-      '(-d -l -x)*-r:remove option:_lp_job_options' \
-      '(-d -l -r -o)-x[remove all options]:printers:_printers'
-    ;;
-
-  (lpstat)
-    _arguments \
-      '-E[Force encryption]' \
-      '-R[Shows print job ranking]' \
-      '-U:username (for connection to server):_users' \
-      '-W:which jobs:(completed not-completed)' \
-      '-a[Show accepting state]:printers:_printers' \
-      '-c:printer classes:' \
-      '-d[Show current default destination]' \
-      '-h:hostname (alternate server):_hosts' \
-      '-l[long listing]' \
-      '-o[destinations]:printers:_printers' \
-      '-p:printers:_printers' \
-      '-r[CUPS server running status]' \
-      '-s[Status summary]' \
-      '-t[All status info]' \
-      '-u[list jobs by users]:users:_users' \
-      '-v[show devices]:printers:_printers'
-    ;;
-
-  (lpr)
-    _arguments \
-      '-E[Force encryption]' \
-      '-H:hostname (alternate server):_hosts' \
-      '(-C -J -T)'-{C,J,T}':job name:' \
-      '-P+[destination printer]:printers:_printers' \
-      '-U:username (for connection to server):_users' \
-      '-#[Copies]:copies (1--100):' \
-      '-h[Disables banner printing]' \
-      '-l[raw file]' \
-      '-m[Send an email on job completion]' \
-      '*-o:print job options:_lp_job_options' \
-      '-p[format with shaded header incl. date, time etc.]' \
-      '-q[Hold job for printing.]' \
-      '-r[delete files after printing]' \
-      '*:PS/PDF files:_pspdf'
-    ;;
-
-  (lp)
-    _arguments \
-      '-E[Force encryption]' \
-      '-U[username (for connection to server)]:username:_users' \
-      '-c[(OBSOLETE) copy to spool dir before printing]' \
-      '-d[destination printer]:printers:_printers' \
-      '-h:hostname (alternate server):_hosts' \
-      '-i[job id to modify]:job id:' \
-      '-m[Send an email on job completion]' \
-      '-n[Copies]:copies (1--100):' \
-      '*-o:print job options:_lp_job_options' \
-      '-q[Job priority -- 1 (lowest) to 100 (highest)]:priority:' \
-      '-s[Dont report resulting job IDs]' \
-      '-t[Sets the job name]:job name:' \
-      '-u[job submission username]:username:_users' \
-      '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \
-      '-P:page range list:' \
-      '*:PS/PDF files:_pspdf'
-    ;;
-esac
+
+_lp()
+{
+  case $service in
+    (lpq)
+      _arguments \
+	'-E[Force encryption]' \
+	'-U:username (for connection to server):_users' \
+	'-h:alternate server:_hosts' \
+	'(-a)-P+[destination printer]:printers:_printers' \
+	'(-P)-a[all printers]' \
+	'-l[long listing]' \
+	'*:poll interval (+seconds):'
+      ;;
+
+    (lprm)
+      _arguments \
+	'-E[Force encryption]' \
+	'-U:username (for connection to server):_users' \
+	'-h:alternate server:_hosts' \
+	'-P+[destination printer]:printers:_printers' \
+	'*:job ids:_lp_list_jobs'
+      ;;
+
+    (lpoptions)
+      _arguments \
+	'-E[Force encryption]' \
+	'-U:username (for connection to server):_users' \
+	'-h:alternate server:_hosts' \
+	'(-p -l -r -x)-d[set default printer]:printers:_printers' \
+	'(-l -x)*-o:job options:_lp_job_options' \
+	'(-d -x)-p[destination printer for options]:printers:_printers' \
+	'(-d -o -r -x)-l[list options]' \
+	'(-d -l -x)*-r:remove option:_lp_job_options' \
+	'(-d -l -r -o)-x[remove all options]:printers:_printers'
+      ;;
+
+    (lpstat)
+      _arguments \
+	'-E[Force encryption]' \
+	'-R[Shows print job ranking]' \
+	'-U:username (for connection to server):_users' \
+	'-W:which jobs:(completed not-completed)' \
+	'-a[Show accepting state]:printers:_printers' \
+	'-c:printer classes:' \
+	'-d[Show current default destination]' \
+	'-h:hostname (alternate server):_hosts' \
+	'-l[long listing]' \
+	'-o[destinations]:printers:_printers' \
+	'-p:printers:_printers' \
+	'-r[CUPS server running status]' \
+	'-s[Status summary]' \
+	'-t[All status info]' \
+	'-u[list jobs by users]:users:_users' \
+	'-v[show devices]:printers:_printers'
+      ;;
+
+    (lpr)
+      _arguments \
+	'-E[Force encryption]' \
+	'-H:hostname (alternate server):_hosts' \
+	'(-C -J -T)'-{C,J,T}':job name:' \
+	'-P+[destination printer]:printers:_printers' \
+	'-U:username (for connection to server):_users' \
+	'-#[Copies]:copies (1--100):' \
+	'-h[Disables banner printing]' \
+	'-l[raw file]' \
+	'-m[Send an email on job completion]' \
+	'*-o:print job options:_lp_job_options' \
+	'-p[format with shaded header incl. date, time etc.]' \
+	'-q[Hold job for printing.]' \
+	'-r[delete files after printing]' \
+	'*:PS/PDF files:_pspdf'
+      ;;
+
+    (lp)
+      _arguments \
+	'-E[Force encryption]' \
+	'-U[username (for connection to server)]:username:_users' \
+	'-c[(OBSOLETE) copy to spool dir before printing]' \
+	'-d[destination printer]:printers:_printers' \
+	'-h:hostname (alternate server):_hosts' \
+	'-i[job id to modify]:job id:' \
+	'-m[Send an email on job completion]' \
+	'-n[Copies]:copies (1--100):' \
+	'*-o:print job options:_lp_job_options' \
+	'-q[Job priority -- 1 (lowest) to 100 (highest)]:priority:' \
+	'-s[Dont report resulting job IDs]' \
+	'-t[Sets the job name]:job name:' \
+	'-u[job submission username]:username:_users' \
+	'-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \
+	'-P:page range list:' \
+	'*:PS/PDF files:_pspdf'
+      ;;
+  esac
+}
+
+_lp "$@"
Index: Completion/Unix/Command/_tex
===================================================================
RCS file: Completion/Unix/Command/_tex
diff -N Completion/Unix/Command/_tex
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/Unix/Command/_tex	16 Jan 2011 19:36:37 -0000
@@ -0,0 +1,29 @@
+#compdef tex latex slitex pdftex pdflatex jadetex pdfjadetex xetex=tex xelatex=latex latexmk
+
+_arguments : \
+    '-enc[enable encTeX extensions]' \
+    '(-no-file-line-error -file-line-error)'{-no,}'-file-line-error[enable/disable file\:line\:error style messages]' \
+    '-fmt=-[use FMTNAME instead of program name or a %& line]:FMTNAME:' \
+    '-halt-on-error[stop processing at the first error]' \
+    '-ini[be initex, for dumping formats]' \
+    '-interaction[set interaction mode]:STRING:(batchmode nonstopmode  scrollmode errorstopmode)' \
+    '-ipc[send DVI output to a socket as well as the usual output file]' \
+    '-ipc-start[as -ipc, and also start the server at the other end]' \
+    '-jobname=-[set the job name]:STRING:' \
+    '-kpathsea-debug=-[set path searching debugging flags according to the bits of NUMBER]:NUMBER:' \
+    '(-no-mktex -mktex)'{-no,}'-mktex=-[enable/disable mktexFMT generation]:FMT:(tex tfm)' \
+    '-mltex[enable MLTeX extensions]' \
+    '-output-comment=-[DVI file comment]:STRING:' \
+    '-output-directory=-[directory to write files to]:DIR:' \
+    '(-no-parse-first-line -parse-first-line)'{-no,}'-parse-first-line[disable/enable parsing of the first line of the input file]' \
+    '-progname=-[set program (and fmt) name]:STRING:' \
+    '-recorder[enable filename recorder]' \
+    '(-no-shell-escape -shell-escape)'{-no,}-shell-escape'[enable/disable \\write18{SHELL COMMAND}]' \
+    '-shell-restricted[enable restricted \\write18]' \
+    '-src-specials[insert source specials into the DVI file]' \
+    '-src-specials=-[insert source specials in certain places of the DVI file]:WHERE:_values -s , WHERE cr display hbox math par parend vbox' \
+    '-translate-file=-[use the TCX file TCXNAME]:TCXNAME:' \
+    '-8bit[make all characters printable by default]' \
+    '-help[display this help and exit]' \
+    '-version[output version information and exit]' \
+    '*:TeX or LaTeX file:_files -g "*.(tex|TEX|texinfo|texi)(-.)"'
Index: Completion/Unix/Command/_xournal
===================================================================
RCS file: Completion/Unix/Command/_xournal
diff -N Completion/Unix/Command/_xournal
--- Completion/Unix/Command/_xournal	9 Jan 2011 16:57:01 -0000	1.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,6 +0,0 @@
-#compdef xournal
-
-local expl
-
-_description files expl 'PDF and Xournal files'
-_files "$@" "$expl[@]" -g '*.(#i){xoj,pdf}(-.)'
Index: Completion/Unix/Type/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Type/.distfiles,v
retrieving revision 1.21
diff -p -u -r1.21 .distfiles
--- Completion/Unix/Type/.distfiles	13 Mar 2009 09:59:58 -0000	1.21
+++ Completion/Unix/Type/.distfiles	16 Jan 2011 19:36:37 -0000
@@ -41,7 +41,6 @@ _services
 _signals
 _tar_archive
 _terminals
-_tex
 _texi
 _tilde_files
 _time_zone
Index: Completion/Unix/Type/_tex
===================================================================
RCS file: Completion/Unix/Type/_tex
diff -N Completion/Unix/Type/_tex
--- Completion/Unix/Type/_tex	18 Jul 2009 18:21:35 -0000	1.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,6 +0,0 @@
-#compdef tex latex slitex pdflatex jadetex pdfjadetex xetex=tex xelatex=latex latexmk
-
-local expl
-
-_description files expl 'TeX or LaTeX file'
-_files "$@" "$expl[@]" -g '*.(tex|TEX|texinfo|texi)(-.)'
Index: Completion/X/Command/.distfiles
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/X/Command/.distfiles,v
retrieving revision 1.18
diff -p -u -r1.18 .distfiles
--- Completion/X/Command/.distfiles	9 Jan 2011 16:57:01 -0000	1.18
+++ Completion/X/Command/.distfiles	16 Jan 2011 19:36:37 -0000
@@ -1,16 +1,34 @@
 DISTFILES_SRC='
 .distfiles
-_acroread       _dcop
-_gnome-gv       _gqview         _gv             _kfmclient
-_mozilla        _mplayer        _nautilus
-_nedit          _netscape
+_acroread
+_dcop
+_gnome-gv
+_gqview
+_gv
+_kfmclient
+_mozilla
+_mplayer
+_nautilus
+_nedit
+_netscape
 _okular
 _pdftk
 _qiv            
 _setxkbmap
-_urxvt          _vnc
-_x_utils        _xauth          _xdvi           _xfig           _xloadimage
-_xmodmap        _xpdf           _xscreensaver   _xset           _xterm
-_xv             _xwit
+_urxvtd
+_vnc
+_x_utils
+_xauth
+_xdvi
+_xfigd
+_xloadimage
+_xmodmap
+_xournal
+_xpdf
+_xscreensaver
+_xsetd
+_xterm
+_xv
+_xwit
 _xrandr
 '
Index: Completion/X/Command/_xournal
===================================================================
RCS file: Completion/X/Command/_xournal
diff -N Completion/X/Command/_xournal
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Completion/X/Command/_xournal	16 Jan 2011 19:36:37 -0000
@@ -0,0 +1,6 @@
+#compdef xournal
+
+local expl
+
+_description files expl 'PDF and Xournal files'
+_files "$@" "$expl[@]" -g '*.(#i){xoj,pdf}(-.)'

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



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