annotate lisp/pcmpl-gnu.el @ 75609:df15b3ed8eb1

Fix typos.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 02 Feb 2007 14:39:39 +0000
parents e3694f1cb928
children 9355f9b7bbff 95d0cdf160ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 31241
diff changeset
1 ;;; pcmpl-gnu.el --- completions for GNU project tools
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
2
74442
b2e5081b9320 Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 68651
diff changeset
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 74442
diff changeset
4 ;; 2005, 2006, 2007 Free Software Foundation, Inc.
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
5
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
6 ;; This file is part of GNU Emacs.
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
7
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
8 ;; GNU Emacs is free software; you can redistribute it and/or modify
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
9 ;; it under the terms of the GNU General Public License as published by
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
11 ;; any later version.
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
12
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
13 ;; GNU Emacs is distributed in the hope that it will be useful,
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
16 ;; GNU General Public License for more details.
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
17
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
19 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64091
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 52401
diff changeset
20 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 52401
diff changeset
21 ;; Boston, MA 02110-1301, USA.
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
22
38414
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 31241
diff changeset
23 ;;; Commentary:
67b464da13ec Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 31241
diff changeset
24
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
25 ;;; Code:
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
26
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
27 (provide 'pcmpl-gnu)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
28
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
29 (require 'pcomplete)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
30 (require 'pcmpl-unix)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
31
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
32 (defgroup pcmpl-gnu nil
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
33 "Completions for GNU project tools."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
34 :group 'pcomplete)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
35
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
36 ;; User Variables:
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
37
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
38 (defcustom pcmpl-gnu-makefile-regexps
31241
3099993cba0f See ChangeLog
John Wiegley <johnw@newartisans.com>
parents: 29959
diff changeset
39 '("\\`GNUmakefile" "\\`Makefile" "\\.mak\\'")
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
40 "*A list of regexps that will match Makefile names."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
41 :type '(repeat regexp)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
42 :group 'pcmpl-gnu)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
43
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
44 ;; Functions:
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
45
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
46 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
47 (defun pcomplete/gzip ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
48 "Completion for `gzip'."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
49 (let ((pcomplete-help "(gzip)"))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
50 (pcomplete-opt "cdfhlLnNqrStvV123456789")
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
51 (while (pcomplete-here
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
52 (pcmpl-gnu-zipped-files
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
53 (catch 'has-d-flag
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
54 (let ((args pcomplete-args))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
55 (while args
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
56 (if (string-match "\\`-.*[dt]" (car args))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
57 (throw 'has-d-flag t))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
58 (setq args (cdr args))))))))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
59
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
60 (defun pcmpl-gnu-zipped-files (unzip-p)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
61 "Find all zipped or unzipped files: the inverse of UNZIP-P."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
62 (pcomplete-entries
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
63 nil
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
64 (function
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
65 (lambda (entry)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
66 (when (and (file-readable-p entry)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
67 (file-regular-p entry))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
68 (let ((zipped (string-match "\\.\\(t?gz\\|\\(ta\\)?Z\\)\\'"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
69 entry)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
70 (or (and unzip-p zipped)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
71 (and (not unzip-p) (not zipped)))))))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
72
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
73 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
74 (defun pcomplete/bzip2 ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
75 "Completion for `bzip2'."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
76 (pcomplete-opt "hdzkftcqvLVs123456789")
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
77 (while (pcomplete-here
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
78 (pcmpl-gnu-bzipped-files
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
79 (catch 'has-d-flag
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
80 (let ((args pcomplete-args))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
81 (while args
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
82 (if (string-match "\\`-.*[dt]" (car args))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
83 (throw 'has-d-flag t))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
84 (setq args (cdr args)))))))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
85
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
86 (defun pcmpl-gnu-bzipped-files (unzip-p)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
87 "Find all zipped or unzipped files: the inverse of UNZIP-P."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
88 (pcomplete-entries
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
89 nil
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
90 (function
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
91 (lambda (entry)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
92 (when (and (file-readable-p entry)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
93 (file-regular-p entry))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
94 (let ((zipped (string-match "\\.\\(t?z2\\|bz2\\)\\'" entry)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
95 (or (and unzip-p zipped)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
96 (and (not unzip-p) (not zipped)))))))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
97
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
98 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
99 (defun pcomplete/make ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
100 "Completion for GNU `make'."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
101 (let ((pcomplete-help "(make)Top"))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
102 (pcomplete-opt "bmC/def(pcmpl-gnu-makefile-names)hiI/j?kl?no.pqrsStvwW.")
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
103 (while (pcomplete-here (pcmpl-gnu-make-rule-names) nil 'identity))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
104
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
105 (defun pcmpl-gnu-makefile-names ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
106 "Return a list of possible makefile names."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
107 (let ((names (list t))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
108 (reg pcmpl-gnu-makefile-regexps))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
109 (while reg
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
110 (nconc names (pcomplete-entries (car reg)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
111 (setq reg (cdr reg)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
112 (cdr names)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
113
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
114 (defun pcmpl-gnu-make-rule-names ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
115 "Return a list of possible make rule names in MAKEFILE."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
116 (let* ((minus-f (member "-f" pcomplete-args))
31241
3099993cba0f See ChangeLog
John Wiegley <johnw@newartisans.com>
parents: 29959
diff changeset
117 (makefile (or (cadr minus-f)
3099993cba0f See ChangeLog
John Wiegley <johnw@newartisans.com>
parents: 29959
diff changeset
118 (if (file-exists-p "GNUmakefile")
3099993cba0f See ChangeLog
John Wiegley <johnw@newartisans.com>
parents: 29959
diff changeset
119 "GNUmakefile"
3099993cba0f See ChangeLog
John Wiegley <johnw@newartisans.com>
parents: 29959
diff changeset
120 "Makefile")))
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
121 rules)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
122 (if (not (file-readable-p makefile))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
123 (unless minus-f (list "-f"))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
124 (with-temp-buffer
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
125 (insert-file-contents-literally makefile)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
126 (while (re-search-forward
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
127 (concat "^\\s-*\\([^\n#%.$][^:=\n]*\\)\\s-*:[^=]") nil t)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
128 (setq rules (append (split-string (match-string 1)) rules))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
129 (pcomplete-uniqify-list rules))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
130
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
131 (defcustom pcmpl-gnu-tarfile-regexp
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
132 "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
133 "*A regexp which matches any tar archive."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
134 :type 'regexp
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
135 :group 'pcmpl-gnu)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
136
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
137 (defvar pcmpl-gnu-tar-buffer nil)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
138
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
139 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
140 (defun pcomplete/tar ()
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
141 "Completion for the GNU tar utility."
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
142 ;; options that end in an equal sign will want further completion...
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
143 (let (saw-option complete-within)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
144 (setq pcomplete-suffix-list (cons ?= pcomplete-suffix-list))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
145 (while (pcomplete-match "^-" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
146 (setq saw-option t)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
147 (if (pcomplete-match "^--" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
148 (if (pcomplete-match "^--\\([^= \t\n\f]*\\)\\'" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
149 (pcomplete-here*
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
150 '("--absolute-names"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
151 "--after-date="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
152 "--append"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
153 "--atime-preserve"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
154 "--backup"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
155 "--block-number"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
156 "--blocking-factor="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
157 "--catenate"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
158 "--checkpoint"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
159 "--compare"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
160 "--compress"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
161 "--concatenate"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
162 "--confirmation"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
163 "--create"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
164 "--delete"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
165 "--dereference"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
166 "--diff"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
167 "--directory="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
168 "--exclude="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
169 "--exclude-from="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
170 "--extract"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
171 "--file="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
172 "--files-from="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
173 "--force-local"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
174 "--get"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
175 "--group="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
176 "--gzip"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
177 "--help"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
178 "--ignore-failed-read"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
179 "--ignore-zeros"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
180 "--incremental"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
181 "--info-script="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
182 "--interactive"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
183 "--keep-old-files"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
184 "--label="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
185 "--list"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
186 "--listed-incremental"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
187 "--mode="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
188 "--modification-time"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
189 "--multi-volume"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
190 "--new-volume-script="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
191 "--newer="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
192 "--newer-mtime"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
193 "--no-recursion"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
194 "--null"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
195 "--numeric-owner"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
196 "--old-archive"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
197 "--one-file-system"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
198 "--owner="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
199 "--portability"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
200 "--posix"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
201 "--preserve"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
202 "--preserve-order"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
203 "--preserve-permissions"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
204 "--read-full-records"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
205 "--record-size="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
206 "--recursive-unlink"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
207 "--remove-files"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
208 "--rsh-command="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
209 "--same-order"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
210 "--same-owner"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
211 "--same-permissions"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
212 "--sparse"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
213 "--starting-file="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
214 "--suffix="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
215 "--tape-length="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
216 "--to-stdout"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
217 "--totals"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
218 "--uncompress"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
219 "--ungzip"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
220 "--unlink-first"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
221 "--update"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
222 "--use-compress-program="
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
223 "--verbose"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
224 "--verify"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
225 "--version"
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
226 "--volno-file=")))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
227 (pcomplete-opt "01234567ABCFGKLMNOPRSTUVWXZbcdfghiklmoprstuvwxz"))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
228 (cond
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
229 ((pcomplete-match "\\`--after-date=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
230 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
231 ((pcomplete-match "\\`--backup=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
232 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
233 ((pcomplete-match "\\`--blocking-factor=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
234 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
235 ((pcomplete-match "\\`--directory=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
236 (pcomplete-here* (pcomplete-dirs)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
237 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
238 ((pcomplete-match "\\`--exclude-from=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
239 (pcomplete-here* (pcomplete-entries)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
240 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
241 ((pcomplete-match "\\`--exclude=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
242 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
243 ((pcomplete-match "\\`--\\(extract\\|list\\)\\'" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
244 (setq complete-within t))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
245 ((pcomplete-match "\\`--file=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
246 (pcomplete-here* (pcomplete-dirs-or-entries pcmpl-gnu-tarfile-regexp)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
247 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
248 ((pcomplete-match "\\`--files-from=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
249 (pcomplete-here* (pcomplete-entries)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
250 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
251 ((pcomplete-match "\\`--group=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
252 (pcomplete-here* (pcmpl-unix-group-names)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
253 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
254 ((pcomplete-match "\\`--info-script=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
255 (pcomplete-here* (pcomplete-entries)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
256 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
257 ((pcomplete-match "\\`--label=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
258 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
259 ((pcomplete-match "\\`--mode=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
260 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
261 ((pcomplete-match "\\`--new-volume-script=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
262 (pcomplete-here* (pcomplete-entries)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
263 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
264 ((pcomplete-match "\\`--newer=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
265 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
266 ((pcomplete-match "\\`--owner=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
267 (pcomplete-here* (pcmpl-unix-user-names)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
268 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
269 ((pcomplete-match "\\`--record-size=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
270 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
271 ((pcomplete-match "\\`--rsh-command=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
272 (pcomplete-here* (funcall pcomplete-command-completion-function)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
273 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
274 ((pcomplete-match "\\`--starting-file=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
275 (pcomplete-here* (pcomplete-entries)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
276 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
277 ((pcomplete-match "\\`--suffix=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
278 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
279 ((pcomplete-match "\\`--tape-length=" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
280 (pcomplete-here*))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
281 ((pcomplete-match "\\`--use-compress-program=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
282 (pcomplete-here* (funcall pcomplete-command-completion-function)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
283 (pcomplete-match-string 1 0)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
284 ((pcomplete-match "\\`--volno-file=\\(.*\\)" 0)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
285 (pcomplete-here* (pcomplete-entries)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
286 (pcomplete-match-string 1 0)))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
287 (setq pcomplete-suffix-list (cdr pcomplete-suffix-list))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
288 (unless saw-option
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
289 (pcomplete-here
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
290 (mapcar 'char-to-string
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
291 (string-to-list
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
292 "01234567ABCFGIKLMNOPRSTUVWXZbcdfghiklmoprstuvwxz")))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
293 (if (pcomplete-match "[xt]" 'first 1)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
294 (setq complete-within t)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
295 (pcomplete-here (pcomplete-dirs-or-entries pcmpl-gnu-tarfile-regexp))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
296 (setq pcmpl-gnu-tar-buffer (find-file-noselect (pcomplete-arg 1)))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
297 (while (pcomplete-here
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
298 (if complete-within
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
299 (with-current-buffer pcmpl-gnu-tar-buffer
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
300 (mapcar
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
301 (function
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
302 (lambda (entry)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
303 (tar-header-name (cdr entry))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
304 tar-parse-info))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
305 (pcomplete-entries))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
306 nil 'identity))))
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
307
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
308 ;;;###autoload
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
309 (defalias 'pcomplete/gdb 'pcomplete/xargs)
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
310
52401
695cf19ef79e Add arch taglines
Miles Bader <miles@gnu.org>
parents: 38414
diff changeset
311 ;;; arch-tag: 06d2b429-dcb1-4a57-84e1-f70d87781183
29959
d4e54e70814f *** empty log message ***
Gerd Moellmann <gerd@gnu.org>
parents:
diff changeset
312 ;;; pcmpl-gnu.el ends here