Mercurial > emacs
annotate lisp/pcmpl-gnu.el @ 110523:a5ad4f188e19
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 18 Sep 2010 22:49:54 -0400 |
parents | 1d1d5d9bd884 |
children | 280c8ae2476d 376148b31b5e |
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 | 2 |
74442 | 3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, |
106815 | 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
29959 | 5 |
6 ;; This file is part of GNU Emacs. | |
7 | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
8 ;; GNU Emacs is free software: you can redistribute it and/or modify |
29959 | 9 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
10 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
11 ;; (at your option) any later version. |
29959 | 12 |
13 ;; GNU Emacs is distributed in the hope that it will be useful, | |
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 ;; GNU General Public License for more details. | |
17 | |
18 ;; You should have received a copy of the GNU General Public License | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
19 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
29959 | 20 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
31241
diff
changeset
|
21 ;;; Commentary: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
31241
diff
changeset
|
22 |
29959 | 23 ;;; Code: |
24 | |
25 (provide 'pcmpl-gnu) | |
26 | |
27 (require 'pcomplete) | |
28 (require 'pcmpl-unix) | |
29 | |
30 (defgroup pcmpl-gnu nil | |
31 "Completions for GNU project tools." | |
32 :group 'pcomplete) | |
33 | |
34 ;; User Variables: | |
35 | |
36 (defcustom pcmpl-gnu-makefile-regexps | |
31241 | 37 '("\\`GNUmakefile" "\\`Makefile" "\\.mak\\'") |
100171 | 38 "A list of regexps that will match Makefile names." |
29959 | 39 :type '(repeat regexp) |
40 :group 'pcmpl-gnu) | |
41 | |
42 ;; Functions: | |
43 | |
44 ;;;###autoload | |
45 (defun pcomplete/gzip () | |
46 "Completion for `gzip'." | |
47 (let ((pcomplete-help "(gzip)")) | |
48 (pcomplete-opt "cdfhlLnNqrStvV123456789") | |
49 (while (pcomplete-here | |
50 (pcmpl-gnu-zipped-files | |
51 (catch 'has-d-flag | |
52 (let ((args pcomplete-args)) | |
53 (while args | |
54 (if (string-match "\\`-.*[dt]" (car args)) | |
55 (throw 'has-d-flag t)) | |
56 (setq args (cdr args)))))))))) | |
57 | |
58 (defun pcmpl-gnu-zipped-files (unzip-p) | |
59 "Find all zipped or unzipped files: the inverse of UNZIP-P." | |
60 (pcomplete-entries | |
61 nil | |
62 (function | |
63 (lambda (entry) | |
64 (when (and (file-readable-p entry) | |
65 (file-regular-p entry)) | |
66 (let ((zipped (string-match "\\.\\(t?gz\\|\\(ta\\)?Z\\)\\'" | |
67 entry))) | |
68 (or (and unzip-p zipped) | |
69 (and (not unzip-p) (not zipped))))))))) | |
70 | |
71 ;;;###autoload | |
72 (defun pcomplete/bzip2 () | |
73 "Completion for `bzip2'." | |
74 (pcomplete-opt "hdzkftcqvLVs123456789") | |
75 (while (pcomplete-here | |
76 (pcmpl-gnu-bzipped-files | |
77 (catch 'has-d-flag | |
78 (let ((args pcomplete-args)) | |
79 (while args | |
80 (if (string-match "\\`-.*[dt]" (car args)) | |
81 (throw 'has-d-flag t)) | |
82 (setq args (cdr args))))))))) | |
83 | |
84 (defun pcmpl-gnu-bzipped-files (unzip-p) | |
85 "Find all zipped or unzipped files: the inverse of UNZIP-P." | |
86 (pcomplete-entries | |
87 nil | |
88 (function | |
89 (lambda (entry) | |
90 (when (and (file-readable-p entry) | |
91 (file-regular-p entry)) | |
92 (let ((zipped (string-match "\\.\\(t?z2\\|bz2\\)\\'" entry))) | |
93 (or (and unzip-p zipped) | |
94 (and (not unzip-p) (not zipped))))))))) | |
95 | |
96 ;;;###autoload | |
97 (defun pcomplete/make () | |
98 "Completion for GNU `make'." | |
99 (let ((pcomplete-help "(make)Top")) | |
100 (pcomplete-opt "bmC/def(pcmpl-gnu-makefile-names)hiI/j?kl?no.pqrsStvwW.") | |
101 (while (pcomplete-here (pcmpl-gnu-make-rule-names) nil 'identity)))) | |
102 | |
103 (defun pcmpl-gnu-makefile-names () | |
104 "Return a list of possible makefile names." | |
105704
4d03be3df4fe
(pcmpl-gnu-makefile-names): Use a single call to pcomplete-entries.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
100908
diff
changeset
|
105 (pcomplete-entries (mapconcat 'identity pcmpl-gnu-makefile-regexps "\\|"))) |
29959 | 106 |
107 (defun pcmpl-gnu-make-rule-names () | |
108 "Return a list of possible make rule names in MAKEFILE." | |
109 (let* ((minus-f (member "-f" pcomplete-args)) | |
31241 | 110 (makefile (or (cadr minus-f) |
111 (if (file-exists-p "GNUmakefile") | |
112 "GNUmakefile" | |
113 "Makefile"))) | |
29959 | 114 rules) |
115 (if (not (file-readable-p makefile)) | |
116 (unless minus-f (list "-f")) | |
117 (with-temp-buffer | |
118 (insert-file-contents-literally makefile) | |
119 (while (re-search-forward | |
120 (concat "^\\s-*\\([^\n#%.$][^:=\n]*\\)\\s-*:[^=]") nil t) | |
121 (setq rules (append (split-string (match-string 1)) rules)))) | |
122 (pcomplete-uniqify-list rules)))) | |
123 | |
124 (defcustom pcmpl-gnu-tarfile-regexp | |
125 "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" | |
100171 | 126 "A regexp which matches any tar archive." |
29959 | 127 :type 'regexp |
128 :group 'pcmpl-gnu) | |
129 | |
130 (defvar pcmpl-gnu-tar-buffer nil) | |
131 | |
105809
27deb58e021f
(tar-parse-info, tar-header-name): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
105704
diff
changeset
|
132 ;; Only used in tar-mode buffers. |
27deb58e021f
(tar-parse-info, tar-header-name): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
105704
diff
changeset
|
133 (defvar tar-parse-info) |
27deb58e021f
(tar-parse-info, tar-header-name): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
105704
diff
changeset
|
134 (declare-function tar-header-name "tar-mode" t t) |
27deb58e021f
(tar-parse-info, tar-header-name): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents:
105704
diff
changeset
|
135 |
29959 | 136 ;;;###autoload |
137 (defun pcomplete/tar () | |
138 "Completion for the GNU tar utility." | |
139 ;; options that end in an equal sign will want further completion... | |
140 (let (saw-option complete-within) | |
141 (setq pcomplete-suffix-list (cons ?= pcomplete-suffix-list)) | |
142 (while (pcomplete-match "^-" 0) | |
143 (setq saw-option t) | |
144 (if (pcomplete-match "^--" 0) | |
145 (if (pcomplete-match "^--\\([^= \t\n\f]*\\)\\'" 0) | |
146 (pcomplete-here* | |
147 '("--absolute-names" | |
148 "--after-date=" | |
149 "--append" | |
150 "--atime-preserve" | |
151 "--backup" | |
152 "--block-number" | |
153 "--blocking-factor=" | |
154 "--catenate" | |
155 "--checkpoint" | |
156 "--compare" | |
157 "--compress" | |
158 "--concatenate" | |
159 "--confirmation" | |
160 "--create" | |
161 "--delete" | |
162 "--dereference" | |
163 "--diff" | |
164 "--directory=" | |
165 "--exclude=" | |
166 "--exclude-from=" | |
167 "--extract" | |
168 "--file=" | |
169 "--files-from=" | |
170 "--force-local" | |
171 "--get" | |
172 "--group=" | |
173 "--gzip" | |
174 "--help" | |
175 "--ignore-failed-read" | |
176 "--ignore-zeros" | |
177 "--incremental" | |
178 "--info-script=" | |
179 "--interactive" | |
180 "--keep-old-files" | |
181 "--label=" | |
182 "--list" | |
183 "--listed-incremental" | |
184 "--mode=" | |
185 "--modification-time" | |
186 "--multi-volume" | |
187 "--new-volume-script=" | |
188 "--newer=" | |
189 "--newer-mtime" | |
190 "--no-recursion" | |
191 "--null" | |
192 "--numeric-owner" | |
193 "--old-archive" | |
194 "--one-file-system" | |
195 "--owner=" | |
196 "--portability" | |
197 "--posix" | |
198 "--preserve" | |
199 "--preserve-order" | |
200 "--preserve-permissions" | |
201 "--read-full-records" | |
202 "--record-size=" | |
203 "--recursive-unlink" | |
204 "--remove-files" | |
205 "--rsh-command=" | |
206 "--same-order" | |
207 "--same-owner" | |
208 "--same-permissions" | |
209 "--sparse" | |
210 "--starting-file=" | |
211 "--suffix=" | |
212 "--tape-length=" | |
213 "--to-stdout" | |
214 "--totals" | |
215 "--uncompress" | |
216 "--ungzip" | |
217 "--unlink-first" | |
218 "--update" | |
219 "--use-compress-program=" | |
220 "--verbose" | |
221 "--verify" | |
222 "--version" | |
223 "--volno-file="))) | |
224 (pcomplete-opt "01234567ABCFGKLMNOPRSTUVWXZbcdfghiklmoprstuvwxz")) | |
225 (cond | |
226 ((pcomplete-match "\\`--after-date=" 0) | |
227 (pcomplete-here*)) | |
228 ((pcomplete-match "\\`--backup=" 0) | |
229 (pcomplete-here*)) | |
230 ((pcomplete-match "\\`--blocking-factor=" 0) | |
231 (pcomplete-here*)) | |
232 ((pcomplete-match "\\`--directory=\\(.*\\)" 0) | |
233 (pcomplete-here* (pcomplete-dirs) | |
234 (pcomplete-match-string 1 0))) | |
235 ((pcomplete-match "\\`--exclude-from=\\(.*\\)" 0) | |
236 (pcomplete-here* (pcomplete-entries) | |
237 (pcomplete-match-string 1 0))) | |
238 ((pcomplete-match "\\`--exclude=" 0) | |
239 (pcomplete-here*)) | |
240 ((pcomplete-match "\\`--\\(extract\\|list\\)\\'" 0) | |
241 (setq complete-within t)) | |
242 ((pcomplete-match "\\`--file=\\(.*\\)" 0) | |
243 (pcomplete-here* (pcomplete-dirs-or-entries pcmpl-gnu-tarfile-regexp) | |
244 (pcomplete-match-string 1 0))) | |
245 ((pcomplete-match "\\`--files-from=\\(.*\\)" 0) | |
246 (pcomplete-here* (pcomplete-entries) | |
247 (pcomplete-match-string 1 0))) | |
248 ((pcomplete-match "\\`--group=\\(.*\\)" 0) | |
249 (pcomplete-here* (pcmpl-unix-group-names) | |
250 (pcomplete-match-string 1 0))) | |
251 ((pcomplete-match "\\`--info-script=\\(.*\\)" 0) | |
252 (pcomplete-here* (pcomplete-entries) | |
253 (pcomplete-match-string 1 0))) | |
254 ((pcomplete-match "\\`--label=" 0) | |
255 (pcomplete-here*)) | |
256 ((pcomplete-match "\\`--mode=" 0) | |
257 (pcomplete-here*)) | |
258 ((pcomplete-match "\\`--new-volume-script=\\(.*\\)" 0) | |
259 (pcomplete-here* (pcomplete-entries) | |
260 (pcomplete-match-string 1 0))) | |
261 ((pcomplete-match "\\`--newer=" 0) | |
262 (pcomplete-here*)) | |
263 ((pcomplete-match "\\`--owner=\\(.*\\)" 0) | |
264 (pcomplete-here* (pcmpl-unix-user-names) | |
265 (pcomplete-match-string 1 0))) | |
266 ((pcomplete-match "\\`--record-size=" 0) | |
267 (pcomplete-here*)) | |
268 ((pcomplete-match "\\`--rsh-command=\\(.*\\)" 0) | |
269 (pcomplete-here* (funcall pcomplete-command-completion-function) | |
270 (pcomplete-match-string 1 0))) | |
271 ((pcomplete-match "\\`--starting-file=\\(.*\\)" 0) | |
272 (pcomplete-here* (pcomplete-entries) | |
273 (pcomplete-match-string 1 0))) | |
274 ((pcomplete-match "\\`--suffix=" 0) | |
275 (pcomplete-here*)) | |
276 ((pcomplete-match "\\`--tape-length=" 0) | |
277 (pcomplete-here*)) | |
278 ((pcomplete-match "\\`--use-compress-program=\\(.*\\)" 0) | |
279 (pcomplete-here* (funcall pcomplete-command-completion-function) | |
280 (pcomplete-match-string 1 0))) | |
281 ((pcomplete-match "\\`--volno-file=\\(.*\\)" 0) | |
282 (pcomplete-here* (pcomplete-entries) | |
283 (pcomplete-match-string 1 0))))) | |
284 (setq pcomplete-suffix-list (cdr pcomplete-suffix-list)) | |
285 (unless saw-option | |
286 (pcomplete-here | |
287 (mapcar 'char-to-string | |
288 (string-to-list | |
289 "01234567ABCFGIKLMNOPRSTUVWXZbcdfghiklmoprstuvwxz"))) | |
290 (if (pcomplete-match "[xt]" 'first 1) | |
291 (setq complete-within t))) | |
292 (pcomplete-here (pcomplete-dirs-or-entries pcmpl-gnu-tarfile-regexp)) | |
293 (setq pcmpl-gnu-tar-buffer (find-file-noselect (pcomplete-arg 1))) | |
294 (while (pcomplete-here | |
295 (if complete-within | |
296 (with-current-buffer pcmpl-gnu-tar-buffer | |
297 (mapcar | |
298 (function | |
299 (lambda (entry) | |
300 (tar-header-name (cdr entry)))) | |
301 tar-parse-info)) | |
302 (pcomplete-entries)) | |
303 nil 'identity)))) | |
304 | |
305 ;;;###autoload | |
306 (defalias 'pcomplete/gdb 'pcomplete/xargs) | |
307 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79721
diff
changeset
|
308 ;; arch-tag: 06d2b429-dcb1-4a57-84e1-f70d87781183 |
29959 | 309 ;;; pcmpl-gnu.el ends here |