Mercurial > emacs
annotate lisp/pcmpl-cvs.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:
29959
diff
changeset
|
1 ;;; pcmpl-cvs.el --- functions for dealing with cvs completions |
29959 | 2 |
74442 | 3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, |
106815 | 4 ;; 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
46081
e0672852f9dd
Added my name as the maintainer of this file.
John Wiegley <johnw@newartisans.com>
parents:
38414
diff
changeset
|
5 |
e0672852f9dd
Added my name as the maintainer of this file.
John Wiegley <johnw@newartisans.com>
parents:
38414
diff
changeset
|
6 ;; Author: John Wiegley <johnw@gnu.org> |
29959 | 7 |
8 ;; This file is part of GNU Emacs. | |
9 | |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
10 ;; GNU Emacs is free software: you can redistribute it and/or modify |
29959 | 11 ;; 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
|
12 ;; 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
|
13 ;; (at your option) any later version. |
29959 | 14 |
15 ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 ;; GNU General Public License for more details. | |
19 | |
20 ;; 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
|
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
29959 | 22 |
23 ;;; Commentary: | |
24 | |
25 ;; These functions provide completion rules for the `cvs' tool. | |
26 | |
27 ;;; Code: | |
28 | |
29 (provide 'pcmpl-cvs) | |
30 | |
31 (require 'pcomplete) | |
32 (require 'executable) | |
33 | |
34 (defgroup pcmpl-cvs nil | |
64016
a32551e9db34
(pcmpl-cvs): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents:
52401
diff
changeset
|
35 "Functions for dealing with CVS completions." |
29959 | 36 :group 'pcomplete) |
37 | |
38 ;; User Variables: | |
39 | |
40 (defcustom pcmpl-cvs-binary (or (executable-find "cvs") "cvs") | |
100171 | 41 "The full path of the 'cvs' binary." |
29959 | 42 :type 'file |
43 :group 'pcmpl-cvs) | |
44 | |
45 ;; Functions: | |
46 | |
47 ;;;###autoload | |
48 (defun pcomplete/cvs () | |
49 "Completion rules for the `cvs' command." | |
50 (let ((pcomplete-help "(cvs)Invoking CVS")) | |
51 (pcomplete-opt "HQqrwlntvfab/T/e*d/z?s") | |
52 (pcomplete-here* (pcmpl-cvs-commands)) | |
53 (cond ((pcomplete-test "add") | |
54 (setq pcomplete-help "(cvs)Adding files") | |
55 (pcomplete-opt "k?m?") | |
56 (while (pcomplete-here (pcmpl-cvs-entries '(??))))) | |
57 ((pcomplete-test "remove") | |
58 (setq pcomplete-help "(cvs)Removing files") | |
59 (pcomplete-opt "flR") | |
60 (while (pcomplete-here (pcmpl-cvs-entries '(?U))))) | |
61 ((pcomplete-test "init") | |
62 (setq pcomplete-help "(cvs)Creating a repository")) | |
63 ((pcomplete-test '("login" "logout")) | |
64 (setq pcomplete-help "(cvs)Password authentication client")) | |
65 ((pcomplete-test "import") | |
66 (setq pcomplete-help "(cvs)import") | |
67 (pcomplete-opt "dk?I(pcmpl-cvs-entries '(??))b?m?W?")) | |
68 ((pcomplete-test "checkout") | |
69 (setq pcomplete-help "(cvs)checkout") | |
70 (pcomplete-opt "ANPRcflnpsr?D?d/k?j?") | |
71 (pcomplete-here (pcmpl-cvs-modules))) | |
72 ((pcomplete-test "rtag") | |
73 (setq pcomplete-help "(cvs)Creating a branch") | |
74 (pcomplete-opt "aflRndbr?DF") | |
75 (pcomplete-here (pcmpl-cvs-modules))) | |
76 ((pcomplete-test "release") | |
77 (setq pcomplete-help "(cvs)release") | |
78 (pcomplete-opt "d") | |
79 (while (pcomplete-here (pcomplete-dirs)))) | |
80 ((pcomplete-test "export") | |
81 (setq pcomplete-help "(cvs)export") | |
82 (pcomplete-opt "NflRnr?D?d/k?") | |
83 (pcomplete-here (pcmpl-cvs-modules))) | |
84 ((pcomplete-test "commit") | |
85 (setq pcomplete-help "(cvs)commit files") | |
86 (pcomplete-opt "nRlfF.m?r(pcmpl-cvs-tags '(?M ?R ?A))") | |
87 (while (pcomplete-here (pcmpl-cvs-entries '(?M ?R ?A))))) | |
88 ((pcomplete-test "diff") | |
89 (setq pcomplete-help "(cvs)Viewing differences") | |
90 (let ((opt-index pcomplete-index) | |
91 saw-backdate) | |
92 (pcomplete-opt "lRD?Nr(pcmpl-cvs-tags)") | |
93 (while (< opt-index pcomplete-index) | |
94 (if (pcomplete-match "^-[Dr]" (- pcomplete-index opt-index)) | |
95 (setq saw-backdate t opt-index pcomplete-index) | |
96 (setq opt-index (1+ opt-index)))) | |
97 (while (pcomplete-here | |
98 (pcmpl-cvs-entries (unless saw-backdate '(?M))))))) | |
99 ((pcomplete-test "unedit") | |
100 (setq pcomplete-help "(cvs)Editing files") | |
101 (pcomplete-opt "lR") | |
102 (while (pcomplete-here (pcmpl-cvs-entries '(?M ?R ?A))))) | |
103 ((pcomplete-test "update") | |
104 (setq pcomplete-help "(cvs)update") | |
105 (pcomplete-opt | |
106 (concat "APdflRpk?r(pcmpl-cvs-tags '(?U ?P))D?" | |
107 "j(pcmpl-cvs-tags '(?U ?P))" | |
108 "I(pcmpl-cvs-entries '(??))W?")) | |
109 (while (pcomplete-here (pcmpl-cvs-entries '(?U ?P))))) | |
110 (t | |
111 (while (pcomplete-here (pcmpl-cvs-entries))))))) | |
112 | |
113 (defun pcmpl-cvs-commands () | |
114 "Return a list of available CVS commands." | |
115 (with-temp-buffer | |
116 (call-process pcmpl-cvs-binary nil t nil "--help-commands") | |
117 (goto-char (point-min)) | |
118 (let (cmds) | |
119 (while (re-search-forward "^\\s-+\\([a-z]+\\)" nil t) | |
120 (setq cmds (cons (match-string 1) cmds))) | |
121 (pcomplete-uniqify-list cmds)))) | |
122 | |
123 (defun pcmpl-cvs-modules () | |
124 "Return a list of available modules under CVS." | |
125 (with-temp-buffer | |
126 (call-process pcmpl-cvs-binary nil t nil "checkout" "-c") | |
127 (goto-char (point-min)) | |
128 (let (entries) | |
129 (while (re-search-forward "\\(\\S-+\\)$" nil t) | |
130 (setq entries (cons (match-string 1) entries))) | |
131 (pcomplete-uniqify-list entries)))) | |
132 | |
133 (defun pcmpl-cvs-tags (&optional opers) | |
134 "Return all the tags which could apply to the files related to OPERS." | |
135 (let ((entries (pcmpl-cvs-entries opers)) | |
136 tags) | |
137 (with-temp-buffer | |
138 (apply 'call-process pcmpl-cvs-binary nil t nil | |
139 "status" "-v" entries) | |
140 (goto-char (point-min)) | |
141 (while (re-search-forward "Existing Tags:" nil t) | |
142 (forward-line) | |
143 (while (not (looking-at "^$")) | |
144 (unless (looking-at "^\\s-+\\(\\S-+\\)\\s-+") | |
145 (error "Error in output from `cvs status -v'")) | |
146 (setq tags (cons (match-string 1) tags)) | |
147 (forward-line)))) | |
148 (pcomplete-uniqify-list tags))) | |
149 | |
150 (defun pcmpl-cvs-entries (&optional opers) | |
151 "Return the Entries for the current directory. | |
152 If OPERS is a list of characters, return entries for which that | |
153 operation character applies, as displayed by 'cvs -n update'." | |
154 (let* ((arg (pcomplete-arg)) | |
155 (dir (file-name-as-directory | |
156 (or (file-name-directory arg) ""))) | |
157 (nondir (or (file-name-nondirectory arg) "")) | |
158 entries) | |
159 (if opers | |
160 (with-temp-buffer | |
161 (and dir (cd dir)) | |
162 (call-process pcmpl-cvs-binary nil t nil | |
163 "-q" "-n" "-f" "update"); "-l") | |
164 (goto-char (point-min)) | |
165 (while (re-search-forward "^\\(.\\) \\(.+\\)$" nil t) | |
166 (if (memq (string-to-char (match-string 1)) opers) | |
167 (setq entries (cons (match-string 2) entries))))) | |
168 (with-temp-buffer | |
169 (insert-file-contents (concat dir "CVS/Entries")) | |
170 (goto-char (point-min)) | |
171 (while (not (eobp)) | |
172 (let* ((line (buffer-substring (line-beginning-position) | |
173 (line-end-position))) | |
174 (fields (split-string line "/")) | |
175 text) | |
176 (if (eq (aref line 0) ?/) | |
177 (setq fields (cons "" fields))) | |
178 (setq text (nth 1 fields)) | |
179 (when text | |
180 (if (string= (nth 0 fields) "D") | |
181 (setq text (file-name-as-directory text))) | |
182 (setq entries (cons text entries)))) | |
183 (forward-line)))) | |
184 (setq pcomplete-stub nondir) | |
185 (pcomplete-uniqify-list entries))) | |
186 | |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
79721
diff
changeset
|
187 ;; arch-tag: d2aeac43-4bf5-4509-a496-74b863c6642b |
29959 | 188 ;;; pcmpl-cvs.el ends here |