Mercurial > emacs
annotate lisp/cedet/semantic/symref/filter.el @ 105891:07c792840800
* xmenu.c (Fx_popup_menu): Extract event timestamp. Pass it to
xmenu_show.
(xmenu_show): New arg. Pass it to create_and_show_popup_menu.
(create_and_show_popup_menu): New arg. Pass it to gtk_menu_popup.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 07 Nov 2009 23:49:08 +0000 |
parents | 7f4c7f5c0eba |
children | 1d1d5d9bd884 |
rev | line source |
---|---|
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; semantic/symref/filter.el --- Filter symbol reference hits for accuracy. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
105340 | 3 ;; Copyright (C) 2009 Free Software Foundation, Inc. |
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 ;; Author: Eric M. Ludlam <eric@siege-engine.com> |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; This file is part of GNU Emacs. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; GNU Emacs is free software: you can redistribute it and/or modify |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; it under the terms of the GNU General Public License as published by |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; the Free Software Foundation, either version 3 of the License, or |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; (at your option) any later version. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; GNU Emacs is distributed in the hope that it will be useful, |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; GNU General Public License for more details. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; You should have received a copy of the GNU General Public License |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;;; Commentary: |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;; |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;; Filter symbol reference hits for accuracy. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; Most symbol referencing tools, such as find/grep only find matching |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; strings, but cannot determine the difference between an actual use, |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 ;; and something else with a similar name, or even a string in a comment. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 ;; |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 ;; This file provides utilities for filtering down to accurate matches |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 ;; starting at a basic filter level that doesn't use symref, up to filters |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ;; across symref results. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 ;;; Code: |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 (require 'semantic) |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
37 (require 'semantic/analyze) |
104456
6065d66f0c99
lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents:
104454
diff
changeset
|
38 (declare-function srecode-active-template-region "srecode/fields") |
6065d66f0c99
lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents:
104454
diff
changeset
|
39 (declare-function srecode-delete "srecode/fields") |
6065d66f0c99
lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents:
104454
diff
changeset
|
40 (declare-function srecode-field "srecode/fields") |
6065d66f0c99
lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents:
104454
diff
changeset
|
41 (declare-function srecode-template-inserted-region "srecode/fields") |
6065d66f0c99
lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents:
104454
diff
changeset
|
42 (declare-function srecode-overlaid-activate "srecode/fields") |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
43 (declare-function semantic-idle-summary-useful-context-p "semantic/idle") |
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 ;;; FILTERS |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 ;; |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (defun semantic-symref-filter-hit (target &optional position) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 "Determine if the tag TARGET is used at POSITION in the current buffer. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 Return non-nil for a match." |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 (semantic-analyze-current-symbol |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 (lambda (start end prefix) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 (let ((tag (car (nreverse prefix)))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 (and (semantic-tag-p tag) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 (semantic-equivalent-tag-p target tag)))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 position)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 ;;; IN-BUFFER FILTERING |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 ;; The following does filtering in-buffer only, and not against |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 ;; a symref results object. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (defun semantic-symref-hits-in-region (target hookfcn start end) |
105340 | 63 "Find all occurrences of the symbol TARGET that match TARGET the tag. |
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 For each match, call HOOKFCN. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 HOOKFCN takes three arguments that match |
105340 | 66 `semantic-analyze-current-symbol's use of HOOKFCN. |
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 ( START END PREFIX ) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 Search occurs in the current buffer between START and END." |
104496
8c4870c15962
* cedet/ede.el, cedet/ede/*.el: New files.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
70 (require 'semantic/idle) |
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (save-excursion |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 (goto-char start) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 (let* ((str (semantic-tag-name target)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 (case-fold-search semantic-case-fold) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 (regexp (concat "\\<" (regexp-quote str) "\\>"))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 (while (re-search-forward regexp end t) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 (when (semantic-idle-summary-useful-context-p) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 (semantic-analyze-current-symbol |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 (lambda (start end prefix) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 (let ((tag (car (nreverse prefix)))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 ;; check for semantic match on the text match. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 (when (and (semantic-tag-p tag) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 (semantic-equivalent-tag-p target tag)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 (save-excursion |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 (funcall hookfcn start end prefix))))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 (point))))))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 (defun semantic-symref-rename-local-variable () |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 "Fancy way to rename the local variable under point. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 Depends on the SRecode Field editing API." |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 (interactive) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 ;; Do the replacement as needed. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 (let* ((ctxt (semantic-analyze-current-context)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 (target (car (reverse (oref ctxt prefix)))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 (tag (semantic-current-tag)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 ) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 (when (or (not target) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (not (semantic-tag-with-position-p target))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (error "Cannot identify symbol under point")) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 (when (not (semantic-tag-of-class-p target 'variable)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 (error "Can only rename variables")) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 (when (or (< (semantic-tag-start target) (semantic-tag-start tag)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 (> (semantic-tag-end target) (semantic-tag-end tag))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 (error "Can only rename variables declared in %s" |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (semantic-tag-name tag))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 ;; I think we're good for this example. Give it a go through |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 ;; our fancy interface from SRecode. |
104456
6065d66f0c99
lisp/cedet/semantic/db-ref.el: Require semantic/db.
Chong Yidong <cyd@stupidchicken.com>
parents:
104454
diff
changeset
|
112 (require 'srecode/fields) |
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 ;; Make sure there is nothing active. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 (let ((ar (srecode-active-template-region))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 (when ar (srecode-delete ar))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 (let ((srecode-field-archive nil) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 (region nil) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 ) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 (semantic-symref-hits-in-region |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 target (lambda (start end prefix) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 ;; For every valid hit, create one field. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 (srecode-field "LOCAL" :name "LOCAL" :start start :end end)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 (semantic-tag-start tag) (semantic-tag-end tag)) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 ;; Now that the fields are setup, create the region. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 (setq region (srecode-template-inserted-region |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 "REGION" :start (semantic-tag-start tag) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 :end (semantic-tag-end tag))) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 ;; Activate the region. |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 (srecode-overlaid-activate region) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 ) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 )) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 (provide 'semantic/symref/filter) |
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 |
105377 | 140 ;; arch-tag: 14b9e795-02bf-408b-b375-c3f8ff6a4e38 |
104454
e4842bf0f303
lisp/cedet/semantic/symref/filter.el: New file.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 ;;; semantic/symref/filter.el ends here |