Mercurial > emacs
annotate lisp/cedet/semantic/symref/global.el @ 107150:b6358fb91b0b
Fix typos.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sun, 14 Feb 2010 18:34:09 +0100 |
parents | 1d1d5d9bd884 |
children | 376148b31b5e |
rev | line source |
---|---|
104422
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; semantic/symref/global.el --- Use GNU Global for symbol references |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
106815 | 3 ;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. |
104422
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; This file is part of GNU Emacs. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; GNU Emacs is free software: you can redistribute it and/or modify |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; it under the terms of the GNU General Public License as published by |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; the Free Software Foundation, either version 3 of the License, or |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; (at your option) any later version. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; GNU Emacs is distributed in the hope that it will be useful, |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; GNU General Public License for more details. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; You should have received a copy of the GNU General Public License |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;;; Commentary: |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;; |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;; GNU Global use with the semantic-symref system. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 (require 'cedet-global) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 (require 'semantic/symref) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 ;;; Code: |
104486
1ca7a97e0322
lisp/cedet/semantic/symref.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
30 ;;;###autoload |
104422
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 (defclass semantic-symref-tool-global (semantic-symref-tool-baseclass) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ( |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 ) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 "A symref tool implementation using GNU Global. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 The GNU Global command can be used to generate lists of tags in a way |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 similar to that of `grep'. This tool will parse the output to generate |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 the hit list. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 See the function `cedet-gnu-global-search' for more details.") |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 (defmethod semantic-symref-perform-search ((tool semantic-symref-tool-global)) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
42 "Perform a search with GNU Global." |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 (let ((b (cedet-gnu-global-search (oref tool :searchfor) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 (oref tool :searchtype) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 (oref tool :resulttype) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 (oref tool :searchscope) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 )) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 ) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 (semantic-symref-parse-tool-output tool b) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 )) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 (defmethod semantic-symref-parse-tool-output-one-line ((tool semantic-symref-tool-global)) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 "Parse one line of grep output, and return it as a match list. |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 Moves cursor to end of the match." |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 (cond ((or (eq (oref tool :resulttype) 'file) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 (eq (oref tool :searchtype) 'tagcompletions)) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 ;; Search for files |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 (when (re-search-forward "^\\([^\n]+\\)$" nil t) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (match-string 1))) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (t |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (when (re-search-forward "^\\([^ ]+\\) +\\([0-9]+\\) \\([^ ]+\\) " nil t) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (cons (string-to-number (match-string 2)) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (match-string 3)) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 )))) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 (provide 'semantic/symref/global) |
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 |
104486
1ca7a97e0322
lisp/cedet/semantic/symref.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
68 ;; Local variables: |
1ca7a97e0322
lisp/cedet/semantic/symref.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
69 ;; generated-autoload-file: "../loaddefs.el" |
1ca7a97e0322
lisp/cedet/semantic/symref.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
70 ;; generated-autoload-load-name: "semantic/symref/global" |
1ca7a97e0322
lisp/cedet/semantic/symref.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
71 ;; End: |
1ca7a97e0322
lisp/cedet/semantic/symref.el: Revert last change.
Chong Yidong <cyd@stupidchicken.com>
parents:
104422
diff
changeset
|
72 |
105377 | 73 ;; arch-tag: 1f061cc0-d8dd-44b1-9de3-3d00cb6e8abe |
104422
36f56620b2ae
cedet/semantic/symref.el, cedet/semantic/symref/cscope.el.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 ;;; semantic/symref/global.el ends here |