Mercurial > emacs
annotate lisp/cedet/semantic.el @ 107092:2e763e444bc2
* net/ange-ftp.el (ange-ftp-insert-directory):
* net/tramp-imap.el (tramp-imap-handle-insert-directory):
* net/tramp-smb.el (tramp-smb-handle-insert-directory):
Handle also directories. (Bug#5478)
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Fri, 05 Feb 2010 12:15:28 +0100 |
parents | 181539c8b6a4 |
children | f6b8c73548b3 |
rev | line source |
---|---|
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; semantic.el --- Semantic buffer evaluator. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
105325 | 3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
106815 | 4 ;; 2008, 2009, 2010 Free Software Foundation, Inc. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; Keywords: syntax |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; (at your option) any later version. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; GNU General Public License for more details. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;;; Commentary: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; API for providing the semantic content of a buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; |
106557
e60ede6c3be3
Add commentary about how to use Semantic.
Chong Yidong <cyd@stupidchicken.com>
parents:
106150
diff
changeset
|
28 ;; The Semantic API provides an interface to a series of different parser |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 ;; implementations. Each parser outputs a parse tree in a similar format |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 ;; designed to handle typical functional and object oriented languages. |
106557
e60ede6c3be3
Add commentary about how to use Semantic.
Chong Yidong <cyd@stupidchicken.com>
parents:
106150
diff
changeset
|
31 ;; |
e60ede6c3be3
Add commentary about how to use Semantic.
Chong Yidong <cyd@stupidchicken.com>
parents:
106150
diff
changeset
|
32 ;; To enable Semantic, turn on `semantic-mode', a global minor mode |
e60ede6c3be3
Add commentary about how to use Semantic.
Chong Yidong <cyd@stupidchicken.com>
parents:
106150
diff
changeset
|
33 ;; (M-x semantic-mode RET, or "Source Code Parsers" from the Tools |
e60ede6c3be3
Add commentary about how to use Semantic.
Chong Yidong <cyd@stupidchicken.com>
parents:
106150
diff
changeset
|
34 ;; menu). To enable it at startup, put (semantic-mode 1) in your init |
e60ede6c3be3
Add commentary about how to use Semantic.
Chong Yidong <cyd@stupidchicken.com>
parents:
106150
diff
changeset
|
35 ;; file. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
37 (require 'cedet) |
104412
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
104409
diff
changeset
|
38 (require 'semantic/tag) |
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
104409
diff
changeset
|
39 (require 'semantic/lex) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 |
104493
a4e1a12c8b97
* files.el (auto-mode-alist): Use emacs-lisp-mode for Project.ede.
Chong Yidong <cyd@stupidchicken.com>
parents:
104471
diff
changeset
|
41 (defvar semantic-version "2.0pre7" |
a4e1a12c8b97
* files.el (auto-mode-alist): Use emacs-lisp-mode for Project.ede.
Chong Yidong <cyd@stupidchicken.com>
parents:
104471
diff
changeset
|
42 "Current version of Semantic.") |
a4e1a12c8b97
* files.el (auto-mode-alist): Use emacs-lisp-mode for Project.ede.
Chong Yidong <cyd@stupidchicken.com>
parents:
104471
diff
changeset
|
43 |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 (declare-function inversion-test "inversion") |
104512
aa2a07e5db2f
* cedet/semantic.el (semantic-parser-working-message): Use a less
Chong Yidong <cyd@stupidchicken.com>
parents:
104508
diff
changeset
|
45 (declare-function semanticdb-load-ebrowse-caches "semantic/db-ebrowse") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (defun semantic-require-version (major minor &optional beta) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
48 "Non-nil if this version of Semantic does not satisfy a specific version. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 Arguments can be: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 (MAJOR MINOR &optional BETA) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 Values MAJOR and MINOR must be integers. BETA can be an integer, or |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 excluded if a released version is required. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 It is assumed that if the current version is newer than that specified, |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 everything passes. Exceptions occur when known incompatibilities are |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 introduced." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (require 'inversion) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (inversion-test 'semantic |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (concat major "." minor |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (when beta (concat "beta" beta))))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 (defgroup semantic nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 "Parser Generator and parser framework." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 :group 'lisp) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (defgroup semantic-faces nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 "Faces used for Semantic enabled tools." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 :group 'semantic) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 |
104412
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
104409
diff
changeset
|
72 (require 'semantic/fw) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 ;;; Code: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 ;;; Variables and Configuration |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 (defvar semantic--parse-table nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 "Variable that defines how to parse top level items in a buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 This variable is for internal use only, and its content depends on the |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 external parser used.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 (make-variable-buffer-local 'semantic--parse-table) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 (semantic-varalias-obsolete 'semantic-toplevel-bovine-table |
105760
d0906291f75b
* cedet/semantic/fw.el (semantic-alias-obsolete)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105442
diff
changeset
|
85 'semantic--parse-table "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 (defvar semantic-symbol->name-assoc-list |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 '((type . "Types") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 (variable . "Variables") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 (function . "Functions") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 (include . "Dependencies") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 (package . "Provides")) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 "Association between symbols returned, and a string. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 The string is used to represent a group of objects of the given type. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 It is sometimes useful for a language to use a different string |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 in place of the default, even though that language will still |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 return a symbol. For example, Java return's includes, but the |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 string can be replaced with `Imports'.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (make-variable-buffer-local 'semantic-symbol->name-assoc-list) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 (defvar semantic-symbol->name-assoc-list-for-type-parts nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 "Like `semantic-symbol->name-assoc-list' for type parts. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 Some tags that have children (see `semantic-tag-children-compatibility') |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 will want to define the names of classes of tags differently than at |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 the top level. For example, in C++, a Function may be called a |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 Method. In addition, there may be new types of tags that exist only |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 in classes, such as protection labels.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (make-variable-buffer-local 'semantic-symbol->name-assoc-list-for-type-parts) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 (defvar semantic-case-fold nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 "Value for `case-fold-search' when parsing.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 (make-variable-buffer-local 'semantic-case-fold) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 (defvar semantic-expand-nonterminal nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 "Function to call for each nonterminal production. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 Return a list of non-terminals derived from the first argument, or nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 if it does not need to be expanded. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 Languages with compound definitions should use this function to expand |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 from one compound symbol into several. For example, in C the definition |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 int a, b; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 is easily parsed into one tag. This function should take this |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 compound tag and turn it into two tags, one for A, and the other for B.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 (make-variable-buffer-local 'semantic-expand-nonterminal) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 (defvar semantic--buffer-cache nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 "A cache of the fully parsed buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 If no significant changes have been made (based on the state) then |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 this is returned instead of re-parsing the buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 DO NOT USE THIS VARIABLE IN PROGRAMS. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 If you need a tag list, use `semantic-fetch-tags'. If you need the |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
133 cached values for some reason, chances are you can add a hook to |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 `semantic-after-toplevel-cache-change-hook'.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 (make-variable-buffer-local 'semantic--buffer-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 (semantic-varalias-obsolete 'semantic-toplevel-bovine-cache |
105760
d0906291f75b
* cedet/semantic/fw.el (semantic-alias-obsolete)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105442
diff
changeset
|
137 'semantic--buffer-cache "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 (defvar semantic-unmatched-syntax-cache nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 "A cached copy of unmatched syntax tokens.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 (make-variable-buffer-local 'semantic-unmatched-syntax-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
143 (defvar semantic-unmatched-syntax-cache-check nil |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
144 "Non-nil if the unmatched syntax cache is out of date. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 This is tracked with `semantic-change-function'.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 (make-variable-buffer-local 'semantic-unmatched-syntax-cache-check) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
148 (defvar semantic-edits-are-safe nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 "When non-nil, modifications do not require a reparse. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
150 This prevents tags from being marked dirty, and it prevents top level |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
151 edits from causing a cache check. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
152 Use this when writing programs that could cause a full reparse, but |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
153 will not change the tag structure, such as adding or updating |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
154 `top-level' comments.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
155 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
156 (defvar semantic-unmatched-syntax-hook nil |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
157 "Hooks run when Semantic detects syntax not matched in a grammar. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
158 Each individual piece of syntax (such as a symbol or punctuation |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
159 character) is called with this hook when it doesn't match in the |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
160 grammar, and multiple unmatched syntax elements are not grouped |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
161 together. Each hook is called with one argument, which is a list |
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
162 of syntax tokens created by the semantic lexer. Use the functions |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
163 `semantic-lex-token-start', `semantic-lex-token-end' and |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
164 `semantic-lex-token-text' to get information about these tokens. |
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
165 The current buffer is the buffer these tokens are derived from.") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
166 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
167 (defvar semantic--before-fetch-tags-hook nil |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
168 "Hooks run before a buffer is parsed for tags. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
169 It is called before any request for tags is made via the function |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
170 `semantic-fetch-tags' by an application. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
171 If any hook returns a nil value, the cached value is returned |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
172 immediately, even if it is empty.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
173 (semantic-varalias-obsolete 'semantic-before-toplevel-bovination-hook |
105760
d0906291f75b
* cedet/semantic/fw.el (semantic-alias-obsolete)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105442
diff
changeset
|
174 'semantic--before-fetch-tags-hook "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
175 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
176 (defvar semantic-after-toplevel-bovinate-hook nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
177 "Hooks run after a toplevel parse. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
178 It is not run if the toplevel parse command is called, and buffer does |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
179 not need to be fully reparsed. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
180 For language specific hooks, make sure you define this as a local hook. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
181 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
182 This hook should not be used any more. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
183 Use `semantic-after-toplevel-cache-change-hook' instead.") |
105406
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
184 (make-obsolete-variable 'semantic-after-toplevel-bovinate-hook nil "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
185 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
186 (defvar semantic-after-toplevel-cache-change-hook nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
187 "Hooks run after the buffer tag list has changed. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
188 This list will change when a buffer is reparsed, or when the tag list |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
189 in a buffer is cleared. It is *NOT* called if the current tag list is |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
190 partially reparsed. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
191 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
192 Hook functions must take one argument, which is the new list of tags |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
193 associated with this buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
194 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
195 For language specific hooks, make sure you define this as a local hook.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
196 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
197 (defvar semantic-before-toplevel-cache-flush-hook nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
198 "Hooks run before the toplevel tag cache is flushed. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
199 For language specific hooks, make sure you define this as a local |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
200 hook. This hook is called before a corresponding |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
201 `semantic-after-toplevel-cache-change-hook' which is also called |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
202 during a flush when the cache is given a new value of nil.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
203 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
204 (defcustom semantic-dump-parse nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
205 "When non-nil, dump parsing information." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
206 :group 'semantic |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
207 :type 'boolean) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
208 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
209 (defvar semantic-parser-name "LL" |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
210 "Optional name of the parser used to parse input stream.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
211 (make-variable-buffer-local 'semantic-parser-name) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
212 |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
213 (defvar semantic--completion-cache nil |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
214 "Internal variable used by `semantic-complete-symbol'.") |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
215 (make-variable-buffer-local 'semantic--completion-cache) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
216 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
217 ;;; Parse tree state management API |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
218 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
219 (defvar semantic-parse-tree-state 'needs-rebuild |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
220 "State of the current parse tree.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
221 (make-variable-buffer-local 'semantic-parse-tree-state) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
222 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
223 (defmacro semantic-parse-tree-unparseable () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
224 "Indicate that the current buffer is unparseable. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
225 It is also true that the parse tree will need either updating or |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
226 a rebuild. This state will be changed when the user edits the buffer." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
227 `(setq semantic-parse-tree-state 'unparseable)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
228 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
229 (defmacro semantic-parse-tree-unparseable-p () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
230 "Return non-nil if the current buffer has been marked unparseable." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
231 `(eq semantic-parse-tree-state 'unparseable)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
232 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
233 (defmacro semantic-parse-tree-set-needs-update () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
234 "Indicate that the current parse tree needs to be updated. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
235 The parse tree can be updated by `semantic-parse-changes'." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
236 `(setq semantic-parse-tree-state 'needs-update)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
237 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
238 (defmacro semantic-parse-tree-needs-update-p () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
239 "Return non-nil if the current parse tree needs to be updated." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
240 `(eq semantic-parse-tree-state 'needs-update)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
241 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
242 (defmacro semantic-parse-tree-set-needs-rebuild () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
243 "Indicate that the current parse tree needs to be rebuilt. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
244 The parse tree must be rebuilt by `semantic-parse-region'." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
245 `(setq semantic-parse-tree-state 'needs-rebuild)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
246 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
247 (defmacro semantic-parse-tree-needs-rebuild-p () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
248 "Return non-nil if the current parse tree needs to be rebuilt." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
249 `(eq semantic-parse-tree-state 'needs-rebuild)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
250 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
251 (defmacro semantic-parse-tree-set-up-to-date () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
252 "Indicate that the current parse tree is up to date." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
253 `(setq semantic-parse-tree-state nil)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
254 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
255 (defmacro semantic-parse-tree-up-to-date-p () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
256 "Return non-nil if the current parse tree is up to date." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
257 `(null semantic-parse-tree-state)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
258 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
259 ;;; Interfacing with the system |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
260 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
261 (defcustom semantic-inhibit-functions nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
262 "List of functions to call with no arguments before Semantic is setup. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
263 If any of these functions returns non-nil, the current buffer is not |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
264 setup to use Semantic." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
265 :group 'semantic |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
266 :type 'hook) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
267 |
105441
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
268 (defcustom semantic-new-buffer-setup-functions |
106783
fc2b73c71e0f
Add Semantic parsers for Python.
Chong Yidong <cyd@stupidchicken.com>
parents:
106557
diff
changeset
|
269 '((c-mode . semantic-default-c-setup) |
105441
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
270 (c++-mode . semantic-default-c-setup) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
271 (html-mode . semantic-default-html-setup) |
106783
fc2b73c71e0f
Add Semantic parsers for Python.
Chong Yidong <cyd@stupidchicken.com>
parents:
106557
diff
changeset
|
272 (java-mode . wisent-java-default-setup) |
fc2b73c71e0f
Add Semantic parsers for Python.
Chong Yidong <cyd@stupidchicken.com>
parents:
106557
diff
changeset
|
273 (js-mode . wisent-javascript-setup-parser) |
fc2b73c71e0f
Add Semantic parsers for Python.
Chong Yidong <cyd@stupidchicken.com>
parents:
106557
diff
changeset
|
274 (python-mode . wisent-python-default-setup) |
fc2b73c71e0f
Add Semantic parsers for Python.
Chong Yidong <cyd@stupidchicken.com>
parents:
106557
diff
changeset
|
275 (scheme-mode . semantic-default-scheme-setup) |
105441
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
276 (srecode-template-mode . srecode-template-setup-parser) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
277 (makefile-automake-mode . semantic-default-make-setup) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
278 (makefile-gmake-mode . semantic-default-make-setup) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
279 (makefile-makepp-mode . semantic-default-make-setup) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
280 (makefile-bsdmake-mode . semantic-default-make-setup) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
281 (makefile-imake-mode . semantic-default-make-setup) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
282 (makefile-mode . semantic-default-make-setup)) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
283 "Alist of functions to call to set up Semantic parsing in the buffer. |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
284 Each element has the form (MODE . FN), where MODE is a value of |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
285 `major-mode' for the buffer and FN is the corresponding function |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
286 to call, with no arguments, to set up the parser. |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
287 |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
288 These functions are called by `semantic-new-buffer-fcn', before |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
289 `semantic-inhibit-functions'." |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
290 :group 'semantic |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
291 :type '(alist :key-type symbol :value-type function)) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
292 |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
293 (defvar semantic-init-hook nil |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
294 "Hook run when a buffer is initialized with a parsing table.") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
295 |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
296 (defvar semantic-init-mode-hook nil |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
297 "Hook run when a buffer of a particular mode is initialized.") |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
298 (make-variable-buffer-local 'semantic-init-mode-hook) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
299 |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
300 (defvar semantic-init-db-hook nil |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
301 "Hook run when a buffer is initialized with a parsing table for DBs. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
302 This hook is for database functions which intend to swap in a tag table. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
303 This guarantees that the DB will go before other modes that require |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
304 a parse of the buffer.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
305 |
104514
c65d65798b34
Fix last change to use semantic-varalias-obsolete.
Chong Yidong <cyd@stupidchicken.com>
parents:
104512
diff
changeset
|
306 (semantic-varalias-obsolete 'semantic-init-hooks |
105760
d0906291f75b
* cedet/semantic/fw.el (semantic-alias-obsolete)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105442
diff
changeset
|
307 'semantic-init-hook "23.2") |
104514
c65d65798b34
Fix last change to use semantic-varalias-obsolete.
Chong Yidong <cyd@stupidchicken.com>
parents:
104512
diff
changeset
|
308 (semantic-varalias-obsolete 'semantic-init-mode-hooks |
105760
d0906291f75b
* cedet/semantic/fw.el (semantic-alias-obsolete)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105442
diff
changeset
|
309 'semantic-init-mode-hook "23.2") |
104514
c65d65798b34
Fix last change to use semantic-varalias-obsolete.
Chong Yidong <cyd@stupidchicken.com>
parents:
104512
diff
changeset
|
310 (semantic-varalias-obsolete 'semantic-init-db-hooks |
105760
d0906291f75b
* cedet/semantic/fw.el (semantic-alias-obsolete)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105442
diff
changeset
|
311 'semantic-init-db-hook "23.2") |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
312 |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
313 (defvar semantic-new-buffer-fcn-was-run nil |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
314 "Non-nil after `semantic-new-buffer-fcn' has been executed.") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
315 (make-variable-buffer-local 'semantic-new-buffer-fcn-was-run) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
316 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
317 (defsubst semantic-active-p () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
318 "Return non-nil if the current buffer was set up for parsing." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
319 semantic-new-buffer-fcn-was-run) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
320 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
321 (defsubst semantic--umatched-syntax-needs-refresh-p () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
322 "Return non-nil if the unmatched syntax cache needs a refresh. |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
323 That is, if it is dirty or if the current parse tree isn't up to date." |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
324 (or semantic-unmatched-syntax-cache-check |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
325 (not (semantic-parse-tree-up-to-date-p)))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
326 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
327 (defun semantic-new-buffer-fcn () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
328 "Setup the current buffer to use Semantic. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
329 If the major mode is ready for Semantic, and no |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
330 `semantic-inhibit-functions' disabled it, the current buffer is setup |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
331 to use Semantic, and `semantic-init-hook' is run." |
105441
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
332 ;; In upstream Semantic, the parser setup functions are called from |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
333 ;; mode hooks. In the version bundled with Emacs, we do it here. |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
334 (let ((entry (assq major-mode semantic-new-buffer-setup-functions))) |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
335 (when entry |
457c7a0ec078
* cedet/semantic.el (semantic-new-buffer-setup-functions): New
Chong Yidong <cyd@stupidchicken.com>
parents:
105409
diff
changeset
|
336 (funcall (cdr entry)))) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
337 ;; Do stuff if semantic was activated by a mode hook in this buffer, |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
338 ;; and not afterwards disabled. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
339 (when (and semantic--parse-table |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
340 (not (semantic-active-p)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
341 (not (run-hook-with-args-until-success |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
342 'semantic-inhibit-functions))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
343 ;; Make sure that if this buffer is cloned, our tags and overlays |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
344 ;; don't go along for the ride. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
345 (add-hook 'clone-indirect-buffer-hook 'semantic-clear-toplevel-cache |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
346 nil t) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
347 ;; Specify that this function has done it's work. At this point |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
348 ;; we can consider that semantic is active in this buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
349 (setq semantic-new-buffer-fcn-was-run t) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
350 ;; Here are some buffer local variables we can initialize ourselves |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
351 ;; of a mode does not choose to do so. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
352 (semantic-lex-init) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
353 ;; Force this buffer to have its cache refreshed. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
354 (semantic-clear-toplevel-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
355 ;; Call DB hooks before regular init hooks |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
356 (run-hooks 'semantic-init-db-hook) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
357 ;; Set up semantic modes |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
358 (run-hooks 'semantic-init-hook) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
359 ;; Set up major-mode specific semantic modes |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
360 (run-hooks 'semantic-init-mode-hook))) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
361 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
362 (defun semantic-fetch-tags-fast () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
363 "For use in a hook. When only a partial reparse is needed, reparse." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
364 (condition-case nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
365 (if (semantic-parse-tree-needs-update-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
366 (semantic-fetch-tags)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
367 (error nil)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
368 semantic--buffer-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
369 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
370 ;;; Parsing Commands |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
371 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
372 (eval-when-compile |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
373 (condition-case nil (require 'pp) (error nil))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
374 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
375 (defvar semantic-edebug nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
376 "When non-nil, activate the interactive parsing debugger. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
377 Do not set this yourself. Call `semantic-debug'.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
378 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
379 (defun semantic-elapsed-time (start end) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
380 "Copied from elp.el. Was `elp-elapsed-time'. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
381 Argument START and END bound the time being calculated." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
382 (+ (* (- (car end) (car start)) 65536.0) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
383 (- (car (cdr end)) (car (cdr start))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
384 (/ (- (car (cdr (cdr end))) (car (cdr (cdr start)))) 1000000.0))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
385 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
386 (defun bovinate (&optional clear) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
387 "Parse the current buffer. Show output in a temp buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
388 Optional argument CLEAR will clear the cache before parsing. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
389 If CLEAR is negative, it will do a full reparse, and also not display |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
390 the output buffer." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
391 (interactive "P") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
392 (if clear (semantic-clear-toplevel-cache)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
393 (if (eq clear '-) (setq clear -1)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
394 (let* ((start (current-time)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
395 (out (semantic-fetch-tags)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
396 (end (current-time))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
397 (message "Retrieving tags took %.2f seconds." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
398 (semantic-elapsed-time start end)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
399 (when (or (null clear) (not (listp clear))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
400 (pop-to-buffer "*Parser Output*") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
401 (require 'pp) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
402 (erase-buffer) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
403 (insert (pp-to-string out)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
404 (goto-char (point-min))))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
405 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
406 ;;; Functions of the parser plug-in API |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
407 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
408 ;; Overload these functions to create new types of parsers. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
409 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
410 (define-overloadable-function semantic-parse-stream (stream nonterminal) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
411 "Parse STREAM, starting at the first NONTERMINAL rule. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
412 For bovine and wisent based parsers, STREAM is from the output of |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
413 `semantic-lex', and NONTERMINAL is a rule in the appropriate language |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
414 specific rules file. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
415 The default parser table used for bovine or wisent based parsers is |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
416 `semantic--parse-table'. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
417 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
418 Must return a list: (STREAM TAGS) where STREAM is the unused elements |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
419 from STREAM, and TAGS is the list of semantic tags found; usually only |
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
420 one tag is returned with the exception of compound statements.") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
421 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
422 (define-overloadable-function semantic-parse-changes () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
423 "Reparse changes in the current buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
424 The list of changes are tracked as a series of overlays in the buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
425 When overloading this function, use `semantic-changes-in-region' to |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
426 analyze.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
427 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
428 (define-overloadable-function semantic-parse-region |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
429 (start end &optional nonterminal depth returnonerror) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
430 "Parse the area between START and END, and return any tags found. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
431 If END needs to be extended due to a lexical token being too large, it |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
432 will be silently ignored. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
433 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
434 Optional arguments: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
435 NONTERMINAL is the rule to start parsing at. |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
436 DEPTH specifies the lexical depth to descend for parser that use |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
437 lexical analysis as their first step. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
438 RETURNONERROR specifies that parsing should stop on the first |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
439 unmatched syntax encountered. When nil, parsing skips the syntax, |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
440 adding it to the unmatched syntax cache. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
441 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
442 Must return a list of semantic tags wich have been cooked |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
443 \(repositioned properly) but which DO NOT HAVE OVERLAYS associated |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
444 with them. When overloading this function, use `semantic--tag-expand' |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
445 to cook raw tags.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
446 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
447 (defun semantic-parse-region-default |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
448 (start end &optional nonterminal depth returnonerror) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
449 "Parse the area between START and END, and return any tags found. |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
450 If END needs to be extended due to a lexical token being too large, |
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
451 it will be silently ignored. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
452 Optional arguments: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
453 NONTERMINAL is the rule to start parsing at if it is known. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
454 DEPTH specifies the lexical depth to scan. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
455 RETURNONERROR specifies that parsing should end when encountering |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
456 unterminated syntax." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
457 (when (or (null semantic--parse-table) (eq semantic--parse-table t)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
458 ;; If there is no table, or it was set to t, then we are here by |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
459 ;; some other mistake. Do not throw an error deep in the parser. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
460 (error "No support found to parse buffer %S" (buffer-name))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
461 (save-restriction |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
462 (widen) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
463 (when (or (< end start) (> end (point-max))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
464 (error "Invalid parse region bounds %S, %S" start end)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
465 (nreverse |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
466 (semantic-repeat-parse-whole-stream |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
467 (or (cdr (assq start semantic-lex-block-streams)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
468 (semantic-lex start end depth)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
469 nonterminal returnonerror)))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
470 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
471 ;;; Parsing functions |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
472 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
473 (defun semantic-set-unmatched-syntax-cache (unmatched-syntax) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
474 "Set the unmatched syntax cache. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
475 Argument UNMATCHED-SYNTAX is the syntax to set into the cache." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
476 ;; This function is not actually called by the main parse loop. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
477 ;; This is intended for use by semanticdb. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
478 (setq semantic-unmatched-syntax-cache unmatched-syntax |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
479 semantic-unmatched-syntax-cache-check nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
480 ;; Refresh the display of unmatched syntax tokens if enabled |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
481 (run-hook-with-args 'semantic-unmatched-syntax-hook |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
482 semantic-unmatched-syntax-cache)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
483 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
484 (defun semantic-clear-unmatched-syntax-cache () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
485 "Clear the cache of unmatched syntax tokens." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
486 (setq semantic-unmatched-syntax-cache nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
487 semantic-unmatched-syntax-cache-check t)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
488 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
489 (defun semantic-unmatched-syntax-tokens () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
490 "Return the list of unmatched syntax tokens." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
491 ;; If the cache need refresh then do a full re-parse. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
492 (if (semantic--umatched-syntax-needs-refresh-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
493 ;; To avoid a recursive call, temporarily disable |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
494 ;; `semantic-unmatched-syntax-hook'. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
495 (let (semantic-unmatched-syntax-hook) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
496 (condition-case nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
497 (progn |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
498 (semantic-clear-toplevel-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
499 (semantic-fetch-tags)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
500 (quit |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
501 (message "semantic-unmatched-syntax-tokens:\ |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
502 parsing of buffer canceled")) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
503 ))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
504 semantic-unmatched-syntax-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
505 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
506 (defun semantic-clear-toplevel-cache () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
507 "Clear the toplevel tag cache for the current buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
508 Clearing the cache will force a complete reparse next time a tag list |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
509 is requested." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
510 (interactive) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
511 (run-hooks 'semantic-before-toplevel-cache-flush-hook) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
512 (setq semantic--buffer-cache nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
513 (semantic-clear-unmatched-syntax-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
514 (semantic-clear-parser-warnings) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
515 ;; Nuke all semantic overlays. This is faster than deleting based |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
516 ;; on our data structure. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
517 (let ((l (semantic-overlay-lists))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
518 (mapc 'semantic-delete-overlay-maybe (car l)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
519 (mapc 'semantic-delete-overlay-maybe (cdr l)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
520 ) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
521 (semantic-parse-tree-set-needs-rebuild) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
522 ;; Remove this hook which tracks if a buffer is up to date or not. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
523 (remove-hook 'after-change-functions 'semantic-change-function t) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
524 ;; Old model. Delete someday. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
525 ;;(run-hooks 'semantic-after-toplevel-bovinate-hook) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
526 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
527 (run-hook-with-args 'semantic-after-toplevel-cache-change-hook |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
528 semantic--buffer-cache) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
529 |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
530 (setq semantic--completion-cache nil)) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
531 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
532 (defvar semantic-bovinate-nonterminal-check-obarray) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
533 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
534 (defun semantic--set-buffer-cache (tagtable) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
535 "Set the toplevel tag cache to TAGTABLE." |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
536 (setq semantic--buffer-cache tagtable |
104449
217c6a8e8420
lisp/cedet/semantic.el (semantic--set-buffer-cache): Ensure that
Chong Yidong <cyd@stupidchicken.com>
parents:
104439
diff
changeset
|
537 semantic-unmatched-syntax-cache-check nil) |
217c6a8e8420
lisp/cedet/semantic.el (semantic--set-buffer-cache): Ensure that
Chong Yidong <cyd@stupidchicken.com>
parents:
104439
diff
changeset
|
538 ;; This is specific to the bovine parser. |
217c6a8e8420
lisp/cedet/semantic.el (semantic--set-buffer-cache): Ensure that
Chong Yidong <cyd@stupidchicken.com>
parents:
104439
diff
changeset
|
539 (set (make-local-variable 'semantic-bovinate-nonterminal-check-obarray) |
217c6a8e8420
lisp/cedet/semantic.el (semantic--set-buffer-cache): Ensure that
Chong Yidong <cyd@stupidchicken.com>
parents:
104439
diff
changeset
|
540 nil) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
541 (semantic-parse-tree-set-up-to-date) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
542 (semantic-make-local-hook 'after-change-functions) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
543 (add-hook 'after-change-functions 'semantic-change-function nil t) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
544 (run-hook-with-args 'semantic-after-toplevel-cache-change-hook |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
545 semantic--buffer-cache) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
546 (setq semantic--completion-cache nil) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
547 ;; Refresh the display of unmatched syntax tokens if enabled |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
548 (run-hook-with-args 'semantic-unmatched-syntax-hook |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
549 semantic-unmatched-syntax-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
550 ;; Old Semantic 1.3 hook API. Maybe useful forever? |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
551 (run-hooks 'semantic-after-toplevel-bovinate-hook) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
552 ) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
553 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
554 (defvar semantic-working-type 'percent |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
555 "*The type of working message to use when parsing. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
556 'percent means we are doing a linear parse through the buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
557 'dynamic means we are reparsing specific tags.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
558 (semantic-varalias-obsolete 'semantic-bovination-working-type |
105760
d0906291f75b
* cedet/semantic/fw.el (semantic-alias-obsolete)
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
105442
diff
changeset
|
559 'semantic-working-type "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
560 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
561 (defvar semantic-minimum-working-buffer-size (* 1024 5) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
562 "*The minimum size of a buffer before working messages are displayed. |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
563 Buffers smaller than this will parse silently. |
105325 | 564 Buffers larger than this will display the working progress bar.") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
565 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
566 (defsubst semantic-parser-working-message (&optional arg) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
567 "Return the message string displayed while parsing. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
568 If optional argument ARG is non-nil it is appended to the message |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
569 string." |
104512
aa2a07e5db2f
* cedet/semantic.el (semantic-parser-working-message): Use a less
Chong Yidong <cyd@stupidchicken.com>
parents:
104508
diff
changeset
|
570 (concat "Parsing" |
aa2a07e5db2f
* cedet/semantic.el (semantic-parser-working-message): Use a less
Chong Yidong <cyd@stupidchicken.com>
parents:
104508
diff
changeset
|
571 (if arg (format " %s" arg)) |
aa2a07e5db2f
* cedet/semantic.el (semantic-parser-working-message): Use a less
Chong Yidong <cyd@stupidchicken.com>
parents:
104508
diff
changeset
|
572 (if semantic-parser-name (format " (%s)" semantic-parser-name)) |
aa2a07e5db2f
* cedet/semantic.el (semantic-parser-working-message): Use a less
Chong Yidong <cyd@stupidchicken.com>
parents:
104508
diff
changeset
|
573 "...")) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
574 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
575 ;;; Application Parser Entry Points |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
576 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
577 ;; The best way to call the parser from programs is via |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
578 ;; `semantic-fetch-tags'. This, in turn, uses other internal |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
579 ;; API functions which plug-in parsers can take advantage of. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
580 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
581 (defun semantic-fetch-tags () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
582 "Fetch semantic tags from the current buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
583 If the buffer cache is up to date, return that. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
584 If the buffer cache is out of date, attempt an incremental reparse. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
585 If the buffer has not been parsed before, or if the incremental reparse |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
586 fails, then parse the entire buffer. |
105325 | 587 If a lexical error had been previously discovered and the buffer |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
588 was marked unparseable, then do nothing, and return the cache." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
589 (and |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
590 ;; Is this a semantic enabled buffer? |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
591 (semantic-active-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
592 ;; Application hooks say the buffer is safe for parsing |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
593 (run-hook-with-args-until-failure |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
594 'semantic-before-toplevel-bovination-hook) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
595 (run-hook-with-args-until-failure |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
596 'semantic--before-fetch-tags-hook) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
597 ;; If the buffer was previously marked unparseable, |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
598 ;; then don't waste our time. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
599 (not (semantic-parse-tree-unparseable-p)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
600 ;; The parse tree actually needs to be refreshed |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
601 (not (semantic-parse-tree-up-to-date-p)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
602 ;; So do it! |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
603 (let* ((gc-cons-threshold (max gc-cons-threshold 10000000)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
604 (semantic-lex-block-streams nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
605 (res nil)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
606 (garbage-collect) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
607 (cond |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
608 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
609 ;;;; Try the incremental parser to do a fast update. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
610 ((semantic-parse-tree-needs-update-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
611 (setq res (semantic-parse-changes)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
612 (if (semantic-parse-tree-needs-rebuild-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
613 ;; If the partial reparse fails, jump to a full reparse. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
614 (semantic-fetch-tags) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
615 ;; Clear the cache of unmatched syntax tokens |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
616 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
617 ;; NOTE TO SELF: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
618 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
619 ;; Move this into the incremental parser. This is a bug. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
620 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
621 (semantic-clear-unmatched-syntax-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
622 (run-hook-with-args ;; Let hooks know the updated tags |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
623 'semantic-after-partial-cache-change-hook res)) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
624 (setq semantic--completion-cache nil)) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
625 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
626 ;;;; Parse the whole system. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
627 ((semantic-parse-tree-needs-rebuild-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
628 ;; Use Emacs' built-in progress-reporter |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
629 (let ((semantic--progress-reporter |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
630 (and (>= (point-max) semantic-minimum-working-buffer-size) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
631 (eq semantic-working-type 'percent) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
632 (make-progress-reporter |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
633 (semantic-parser-working-message (buffer-name)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
634 0 100)))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
635 (setq res (semantic-parse-region (point-min) (point-max))) |
104471
64ff46db1dda
lisp/cedet/semantic.el (semantic-fetch-tags): Check if progress
Chong Yidong <cyd@stupidchicken.com>
parents:
104470
diff
changeset
|
636 (if semantic--progress-reporter |
64ff46db1dda
lisp/cedet/semantic.el (semantic-fetch-tags): Check if progress
Chong Yidong <cyd@stupidchicken.com>
parents:
104470
diff
changeset
|
637 (progress-reporter-done semantic--progress-reporter))) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
638 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
639 ;; Clear the caches when we see there were no errors. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
640 ;; But preserve the unmatched syntax cache and warnings! |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
641 (let (semantic-unmatched-syntax-cache |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
642 semantic-unmatched-syntax-cache-check |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
643 semantic-parser-warnings) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
644 (semantic-clear-toplevel-cache)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
645 ;; Set up the new overlays |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
646 (semantic--tag-link-list-to-buffer res) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
647 ;; Set up the cache with the new results |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
648 (semantic--set-buffer-cache res) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
649 )))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
650 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
651 ;; Always return the current parse tree. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
652 semantic--buffer-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
653 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
654 (defun semantic-refresh-tags-safe () |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
655 "Refresh the current buffer's tags safely. |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
656 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
657 Return non-nil if the refresh was successful. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
658 Return nil if there is some sort of syntax error preventing a reparse. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
659 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
660 Does nothing if the current buffer doesn't need reparsing." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
661 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
662 ;; These checks actually occur in `semantic-fetch-tags', but if we |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
663 ;; do them here, then all the bovination hooks are not run, and |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
664 ;; we save lots of time. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
665 (cond |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
666 ;; If the buffer was previously marked unparseable, |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
667 ;; then don't waste our time. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
668 ((semantic-parse-tree-unparseable-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
669 nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
670 ;; The parse tree is already ok. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
671 ((semantic-parse-tree-up-to-date-p) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
672 t) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
673 (t |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
674 (let* ((inhibit-quit nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
675 (lexically-safe t) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
676 ) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
677 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
678 (unwind-protect |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
679 ;; Perform the parsing. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
680 (progn |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
681 (when (semantic-lex-catch-errors safe-refresh |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
682 (save-excursion (semantic-fetch-tags)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
683 nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
684 ;; If we are here, it is because the lexical step failed, |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
685 ;; proably due to unterminated lists or something like that. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
686 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
687 ;; We do nothing, and just wait for the next idle timer |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
688 ;; to go off. In the meantime, remember this, and make sure |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
689 ;; no other idle services can get executed. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
690 (setq lexically-safe nil)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
691 ) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
692 ) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
693 ;; Return if we are lexically safe |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
694 lexically-safe)))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
695 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
696 (defun semantic-bovinate-toplevel (&optional ignored) |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
697 "Backward compatibility function." |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
698 (semantic-fetch-tags)) |
105406
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
699 (make-obsolete 'semantic-bovinate-toplevel 'semantic-fetch-tags "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
700 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
701 ;; Another approach is to let Emacs call the parser on idle time, when |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
702 ;; needed, use `semantic-fetch-available-tags' to only retrieve |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
703 ;; available tags, and setup the `semantic-after-*-hook' hooks to |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
704 ;; synchronize with new tags when they become available. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
705 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
706 (defsubst semantic-fetch-available-tags () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
707 "Fetch available semantic tags from the current buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
708 That is, return tags currently in the cache without parsing the |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
709 current buffer. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
710 Parse operations happen asynchronously when needed on Emacs idle time. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
711 Use the `semantic-after-toplevel-cache-change-hook' and |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
712 `semantic-after-partial-cache-change-hook' hooks to synchronize with |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
713 new tags when they become available." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
714 semantic--buffer-cache) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
715 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
716 ;;; Iterative parser helper function |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
717 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
718 ;; Iterative parsers are better than rule-based iterative functions |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
719 ;; in that they can handle obscure errors more cleanly. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
720 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
721 ;; `semantic-repeat-parse-whole-stream' abstracts this action for |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
722 ;; other parser centric routines. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
723 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
724 (defun semantic-repeat-parse-whole-stream |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
725 (stream nonterm &optional returnonerror) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
726 "Iteratively parse the entire stream STREAM starting with NONTERM. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
727 Optional argument RETURNONERROR indicates that the parser should exit |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
728 with the current results on a parse error. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
729 This function returns semantic tags without overlays." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
730 (let ((result nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
731 (case-fold-search semantic-case-fold) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
732 nontermsym tag) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
733 (while stream |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
734 (setq nontermsym (semantic-parse-stream stream nonterm) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
735 tag (car (cdr nontermsym))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
736 (if (not nontermsym) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
737 (error "Parse error @ %d" (car (cdr (car stream))))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
738 (if (eq (car nontermsym) stream) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
739 (error "Parser error: Infinite loop?")) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
740 (if tag |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
741 (if (car tag) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
742 (setq tag (mapcar |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
743 #'(lambda (tag) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
744 ;; Set the 'reparse-symbol property to |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
745 ;; NONTERM unless it was already setup |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
746 ;; by a tag expander |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
747 (or (semantic--tag-get-property |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
748 tag 'reparse-symbol) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
749 (semantic--tag-put-property |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
750 tag 'reparse-symbol nonterm)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
751 tag) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
752 (semantic--tag-expand tag)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
753 result (append tag result)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
754 ;; No error in this case, a purposeful nil means don't |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
755 ;; store anything. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
756 ) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
757 (if returnonerror |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
758 (setq stream nil) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
759 ;; The current item in the stream didn't match, so add it to |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
760 ;; the list of syntax items which didn't match. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
761 (setq semantic-unmatched-syntax-cache |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
762 (cons (car stream) semantic-unmatched-syntax-cache)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
763 )) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
764 ;; Designated to ignore. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
765 (setq stream (car nontermsym)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
766 (if stream |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
767 ;; Use Emacs' built-in progress reporter: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
768 (and (boundp 'semantic--progress-reporter) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
769 semantic--progress-reporter |
104439
da5b2513c225
cedet/cedet.el (cedet-packages): Bump srecode version.
Chong Yidong <cyd@stupidchicken.com>
parents:
104412
diff
changeset
|
770 (eq semantic-working-type 'percent) |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
771 (progress-reporter-update |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
772 semantic--progress-reporter |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
773 (/ (* 100 (semantic-lex-token-start (car stream))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
774 (point-max)))))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
775 result)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
776 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
777 ;;; Parsing Warnings: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
778 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
779 ;; Parsing a buffer may result in non-critical things that we should |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
780 ;; alert the user to without interrupting the normal flow. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
781 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
782 ;; Any parser can use this API to provide a list of warnings during a |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
783 ;; parse which a user may want to investigate. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
784 (defvar semantic-parser-warnings nil |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
785 "A list of parser warnings since the last full reparse.") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
786 (make-variable-buffer-local 'semantic-parser-warnings) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
787 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
788 (defun semantic-clear-parser-warnings () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
789 "Clear the current list of parser warnings for this buffer." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
790 (setq semantic-parser-warnings nil)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
791 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
792 (defun semantic-push-parser-warning (warning start end) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
793 "Add a parser WARNING that covers text from START to END." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
794 (setq semantic-parser-warnings |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
795 (cons (cons warning (cons start end)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
796 semantic-parser-warnings))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
797 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
798 (defun semantic-dump-parser-warnings () |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
799 "Dump any parser warnings." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
800 (interactive) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
801 (if semantic-parser-warnings |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
802 (let ((pw semantic-parser-warnings)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
803 (pop-to-buffer "*Parser Warnings*") |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
804 (require 'pp) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
805 (erase-buffer) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
806 (insert (pp-to-string pw)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
807 (goto-char (point-min))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
808 (message "No parser warnings."))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
809 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
810 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
811 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
812 ;;; Compatibility: |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
813 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
814 ;; Semantic 1.x parser action helper functions, used by some parsers. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
815 ;; Please move away from these functions, and try using semantic 2.x |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
816 ;; interfaces instead. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
817 ;; |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
818 (defsubst semantic-bovinate-region-until-error |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
819 (start end nonterm &optional depth) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
820 "NOTE: Use `semantic-parse-region' instead. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
821 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
822 Bovinate between START and END starting with NONTERM. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
823 Optional DEPTH specifies how many levels of parenthesis to enter. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
824 This command will parse until an error is encountered, and return |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
825 the list of everything found until that moment. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
826 This is meant for finding variable definitions at the beginning of |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
827 code blocks in methods. If `bovine-inner-scope' can also support |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
828 commands, use `semantic-bovinate-from-nonterminal-full'." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
829 (semantic-parse-region start end nonterm depth t)) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
830 (make-obsolete 'semantic-bovinate-region-until-error |
105406
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
831 'semantic-parse-region "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
832 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
833 (defsubst semantic-bovinate-from-nonterminal |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
834 (start end nonterm &optional depth length) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
835 "Bovinate from within a nonterminal lambda from START to END. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
836 Argument NONTERM is the nonterminal symbol to start with. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
837 Optional argument DEPTH is the depth of lists to dive into. When used |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
838 in a `lambda' of a MATCH-LIST, there is no need to include a START and |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
839 END part. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
840 Optional argument LENGTH specifies we are only interested in LENGTH |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
841 tokens." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
842 (car-safe (cdr (semantic-parse-stream |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
843 (semantic-lex start end (or depth 1) length) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
844 nonterm)))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
845 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
846 (defsubst semantic-bovinate-from-nonterminal-full |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
847 (start end nonterm &optional depth) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
848 "NOTE: Use `semantic-parse-region' instead. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
849 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
850 Bovinate from within a nonterminal lambda from START to END. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
851 Iterates until all the space between START and END is exhausted. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
852 Argument NONTERM is the nonterminal symbol to start with. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
853 If NONTERM is nil, use `bovine-block-toplevel'. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
854 Optional argument DEPTH is the depth of lists to dive into. |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
855 When used in a `lambda' of a MATCH-LIST, there is no need to include |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
856 a START and END part." |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
857 (semantic-parse-region start end nonterm (or depth 1))) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
858 (make-obsolete 'semantic-bovinate-from-nonterminal-full |
105406
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
859 'semantic-parse-region "23.2") |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
860 |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
861 ;;; User interface |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
862 |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
863 (defun semantic-force-refresh () |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
864 "Force a full refresh of the current buffer's tags. |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
865 Throw away all the old tags, and recreate the tag database." |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
866 (interactive) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
867 (semantic-clear-toplevel-cache) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
868 (semantic-fetch-tags) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
869 (message "Buffer reparsed.")) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
870 |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
871 (defvar semantic-mode-map |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
872 (let ((map (make-sparse-keymap))) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
873 ;; Key bindings: |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
874 ;; (define-key km "f" 'senator-search-set-tag-class-filter) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
875 ;; (define-key km "i" 'senator-isearch-toggle-semantic-mode) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
876 (define-key map "\C-c,j" 'semantic-complete-jump-local) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
877 (define-key map "\C-c,J" 'semantic-complete-jump) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
878 (define-key map "\C-c,g" 'semantic-symref-symbol) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
879 (define-key map "\C-c,G" 'semantic-symref) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
880 (define-key map "\C-c,p" 'senator-previous-tag) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
881 (define-key map "\C-c,n" 'senator-next-tag) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
882 (define-key map "\C-c,u" 'senator-go-to-up-reference) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
883 (define-key map "\C-c, " 'semantic-complete-analyze-inline) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
884 (define-key map "\C-c,\C-w" 'senator-kill-tag) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
885 (define-key map "\C-c,\M-w" 'senator-copy-tag) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
886 (define-key map "\C-c,\C-y" 'senator-yank-tag) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
887 (define-key map "\C-c,r" 'senator-copy-tag-to-register) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
888 (define-key map [?\C-c ?, up] 'senator-transpose-tags-up) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
889 (define-key map [?\C-c ?, down] 'senator-transpose-tags-down) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
890 (define-key map "\C-c,l" 'semantic-analyze-possible-completions) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
891 ;; This hack avoids showing the CEDET menu twice if ede-minor-mode |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
892 ;; and Semantic are both enabled. Is there a better way? |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
893 (define-key map [menu-bar cedet-menu] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
894 (list 'menu-item "Development" cedet-menu-map |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
895 :enable (quote (not (bound-and-true-p global-ede-mode))))) |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
896 ;; (define-key km "-" 'senator-fold-tag) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
897 ;; (define-key km "+" 'senator-unfold-tag) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
898 map)) |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
899 |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
900 ;; Activate the Semantic items in cedet-menu-map |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
901 (let ((navigate-menu (make-sparse-keymap "Navigate Tags")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
902 (edit-menu (make-sparse-keymap "Edit Tags"))) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
903 |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
904 ;; Edit Tags submenu: |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
905 (define-key edit-menu [semantic-analyze-possible-completions] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
906 '(menu-item "List Completions" semantic-analyze-possible-completions |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
907 :help "Display a list of completions for the tag at point")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
908 (define-key edit-menu [semantic-complete-analyze-inline] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
909 '(menu-item "Complete Tag Inline" semantic-complete-analyze-inline |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
910 :help "Display inline completion for the tag at point")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
911 (define-key edit-menu [semantic-completion-separator] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
912 '("--")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
913 (define-key edit-menu [senator-transpose-tags-down] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
914 '(menu-item "Transpose Tags Down" senator-transpose-tags-down |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
915 :active (semantic-current-tag) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
916 :help "Transpose the current tag and the next tag")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
917 (define-key edit-menu [senator-transpose-tags-up] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
918 '(menu-item "Transpose Tags Up" senator-transpose-tags-up |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
919 :active (semantic-current-tag) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
920 :help "Transpose the current tag and the previous tag")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
921 (define-key edit-menu [semantic-edit-separator] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
922 '("--")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
923 (define-key edit-menu [senator-yank-tag] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
924 '(menu-item "Yank Tag" senator-yank-tag |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
925 :active (not (ring-empty-p senator-tag-ring)) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
926 :help "Yank the head of the tag ring into the buffer")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
927 (define-key edit-menu [senator-copy-tag-to-register] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
928 '(menu-item "Copy Tag To Register" senator-copy-tag-to-register |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
929 :active (semantic-current-tag) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
930 :help "Yank the head of the tag ring into the buffer")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
931 (define-key edit-menu [senator-copy-tag] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
932 '(menu-item "Copy Tag" senator-copy-tag |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
933 :active (semantic-current-tag) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
934 :help "Copy the current tag to the tag ring")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
935 (define-key edit-menu [senator-kill-tag] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
936 '(menu-item "Kill Tag" senator-kill-tag |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
937 :active (semantic-current-tag) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
938 :help "Kill the current tag, and copy it to the tag ring")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
939 |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
940 ;; Navigate Tags submenu: |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
941 (define-key navigate-menu [senator-narrow-to-defun] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
942 '(menu-item "Narrow to Tag" senator-narrow-to-defun |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
943 :active (semantic-current-tag) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
944 :help "Narrow the buffer to the bounds of the current tag")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
945 (define-key navigate-menu [semantic-narrow-to-defun-separator] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
946 '("--")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
947 (define-key navigate-menu [semantic-symref-symbol] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
948 '(menu-item "Find Tag References..." semantic-symref-symbol |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
949 :help "Read a tag and list the references to it")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
950 (define-key navigate-menu [semantic-complete-jump] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
951 '(menu-item "Find Tag Globally..." semantic-complete-jump |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
952 :help "Read a tag name and find it in the current project")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
953 (define-key navigate-menu [semantic-complete-jump-local] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
954 '(menu-item "Find Tag in This Buffer..." semantic-complete-jump-local |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
955 :help "Read a tag name and find it in this buffer")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
956 (define-key navigate-menu [semantic-navigation-separator] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
957 '("--")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
958 (define-key navigate-menu [senator-go-to-up-reference] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
959 '(menu-item "Parent Tag" senator-go-to-up-reference |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
960 :help "Navigate up one reference by tag.")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
961 (define-key navigate-menu [senator-next-tag] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
962 '(menu-item "Next Tag" senator-next-tag |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
963 :help "Go to the next tag")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
964 (define-key navigate-menu [senator-previous-tag] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
965 '(menu-item "Previous Tag" senator-previous-tag |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
966 :help "Go to the previous tag")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
967 |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
968 ;; Top level menu items: |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
969 (define-key cedet-menu-map [semantic-force-refresh] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
970 '(menu-item "Reparse Buffer" semantic-force-refresh |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
971 :help "Force a full reparse of the current buffer." |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
972 :visible semantic-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
973 (define-key cedet-menu-map [semantic-edit-menu] |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
974 `(menu-item "Edit Tags" ,edit-menu |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
975 :visible semantic-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
976 (define-key cedet-menu-map [navigate-menu] |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
977 `(menu-item "Navigate Tags" ,navigate-menu |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
978 :visible semantic-mode)) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
979 (define-key cedet-menu-map [semantic-options-separator] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
980 '("--")) |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
981 (define-key cedet-menu-map [global-semantic-highlight-func-mode] |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
982 '(menu-item "Highlight Current Function" global-semantic-highlight-func-mode |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
983 :help "Highlight the tag at point" |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
984 :visible semantic-mode |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
985 :button (:toggle . global-semantic-highlight-func-mode))) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
986 (define-key cedet-menu-map [global-semantic-decoration-mode] |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
987 '(menu-item "Decorate Tags" global-semantic-decoration-mode |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
988 :help "Decorate tags based on tag attributes" |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
989 :visible semantic-mode |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
990 :button (:toggle . (bound-and-true-p |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
991 global-semantic-decoration-mode)))) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
992 (define-key cedet-menu-map [global-semantic-idle-completions-mode] |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
993 '(menu-item "Show Tag Completions" global-semantic-idle-completions-mode |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
994 :help "Show tag completions when idle" |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
995 :visible semantic-mode |
106150
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
996 :enable global-semantic-idle-scheduler-mode |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
997 :button (:toggle . global-semantic-idle-completions-mode))) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
998 (define-key cedet-menu-map [global-semantic-idle-summary-mode] |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
999 '(menu-item "Show Tag Summaries" global-semantic-idle-summary-mode |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
1000 :help "Show tag summaries when idle" |
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
1001 :visible semantic-mode |
106150
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1002 :enable global-semantic-idle-scheduler-mode |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
1003 :button (:toggle . global-semantic-idle-summary-mode))) |
106150
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1004 (define-key cedet-menu-map [global-semantic-idle-scheduler-mode] |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1005 '(menu-item "Reparse When Idle" global-semantic-idle-scheduler-mode |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1006 :help "Keep a buffer's parse tree up to date when idle" |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1007 :visible semantic-mode |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1008 :button (:toggle . global-semantic-idle-scheduler-mode))) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
1009 (define-key cedet-menu-map [global-semanticdb-minor-mode] |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
1010 '(menu-item "Semantic Database" global-semanticdb-minor-mode |
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
1011 :help "Store tag information in a database" |
104524
fbd55cc47b77
* cedet/ede/system.el (ede-upload-html-documentation)
Chong Yidong <cyd@stupidchicken.com>
parents:
104523
diff
changeset
|
1012 :visible semantic-mode |
106150
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1013 :button (:toggle . global-semanticdb-minor-mode)))) |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
1014 |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1015 ;; The `semantic-mode' command, in conjuction with the |
104523
18ae68cd64bd
* cedet/ede.el (global-ede-mode-map): Move menu to
Chong Yidong <cyd@stupidchicken.com>
parents:
104519
diff
changeset
|
1016 ;; `semantic-default-submodes' variable, toggles Semantic's various |
106876
ad7558737bc7
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1017 ;; auxiliary minor modes. |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1018 |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1019 (defvar semantic-load-system-cache-loaded nil |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
1020 "Non-nil when the Semantic system caches have been loaded. |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1021 Prevent this load system from loading files in twice.") |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1022 |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1023 (defconst semantic-submode-list |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1024 '(global-semantic-highlight-func-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1025 global-semantic-decoration-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1026 global-semantic-stickyfunc-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1027 global-semantic-idle-completions-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1028 global-semantic-idle-scheduler-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1029 global-semanticdb-minor-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1030 global-semantic-idle-summary-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1031 global-semantic-mru-bookmark-mode) |
105325 | 1032 "List of auxiliary minor modes in the Semantic package.") |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1033 |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1034 ;;;###autoload |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1035 (defcustom semantic-default-submodes |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1036 '(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode) |
105325 | 1037 "List of auxiliary Semantic minor modes enabled by `semantic-mode'. |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1038 The possible elements of this list include the following: |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1039 |
106150
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1040 `global-semanticdb-minor-mode' - Maintain tag database. |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1041 `global-semantic-idle-scheduler-mode' - Reparse buffer when idle. |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1042 `global-semantic-idle-summary-mode' - Show summary of tag at point. |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1043 `global-semantic-idle-completions-mode' - Show completions when idle. |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1044 `global-semantic-decoration-mode' - Additional tag decorations. |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1045 `global-semantic-highlight-func-mode' - Highlight the current tag. |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1046 `global-semantic-stickyfunc-mode' - Show current fun in header line. |
269b53d49dd9
* cedet/cedet.el (cedet-menu-map): Re-order menu items.
Chong Yidong <cyd@stupidchicken.com>
parents:
105815
diff
changeset
|
1047 `global-semantic-mru-bookmark-mode' - Provide `switch-to-buffer'-like |
106895
181539c8b6a4
Fix typos in docstrings, error messages, etc.
Juanma Barranquero <lekktu@gmail.com>
parents:
106876
diff
changeset
|
1048 keybinding for tag names." |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1049 :group 'semantic |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1050 :type `(set ,@(mapcar (lambda (c) (list 'const c)) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1051 semantic-submode-list))) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1052 |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1053 ;;;###autoload |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1054 (define-minor-mode semantic-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1055 "Toggle Semantic mode. |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1056 With ARG, turn Semantic mode on if ARG is positive, off otherwise. |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1057 |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1058 In Semantic mode, Emacs parses the buffers you visit for their |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1059 semantic content. This information is used by a variety of |
106876
ad7558737bc7
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1060 auxiliary minor modes, listed in `semantic-default-submodes'; |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1061 all the minor modes in this list are also enabled when you enable |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
1062 Semantic mode. |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
1063 |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
1064 \\{semantic-mode-map}" |
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
1065 :global t |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1066 :group 'semantic |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1067 (if semantic-mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1068 ;; Turn on Semantic mode |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1069 (progn |
106876
ad7558737bc7
Fix typos in docstrings.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
1070 ;; Enable all the global auxiliary minor modes in |
104519
934691bc93ed
* cedet/semantic/idle.el (semantic-idle-scheduler-work-timer):
Chong Yidong <cyd@stupidchicken.com>
parents:
104514
diff
changeset
|
1071 ;; `semantic-submode-list'. |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1072 (dolist (mode semantic-submode-list) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1073 (if (memq mode semantic-default-submodes) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1074 (funcall mode 1))) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1075 (unless semantic-load-system-cache-loaded |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1076 (setq semantic-load-system-cache-loaded t) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1077 (when (and (boundp 'semanticdb-default-system-save-directory) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1078 (stringp semanticdb-default-system-save-directory) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1079 (file-exists-p semanticdb-default-system-save-directory)) |
104512
aa2a07e5db2f
* cedet/semantic.el (semantic-parser-working-message): Use a less
Chong Yidong <cyd@stupidchicken.com>
parents:
104508
diff
changeset
|
1080 (require 'semantic/db-ebrowse) |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1081 (semanticdb-load-ebrowse-caches))) |
105442
96247a7ec10d
* cedet/semantic.el (semantic-mode): Parse all existing buffers when
Chong Yidong <cyd@stupidchicken.com>
parents:
105441
diff
changeset
|
1082 (add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn) |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105760
diff
changeset
|
1083 (if global-ede-mode |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105760
diff
changeset
|
1084 (define-key cedet-menu-map [cedet-menu-separator] '("--"))) |
105442
96247a7ec10d
* cedet/semantic.el (semantic-mode): Parse all existing buffers when
Chong Yidong <cyd@stupidchicken.com>
parents:
105441
diff
changeset
|
1085 (dolist (b (buffer-list)) |
96247a7ec10d
* cedet/semantic.el (semantic-mode): Parse all existing buffers when
Chong Yidong <cyd@stupidchicken.com>
parents:
105441
diff
changeset
|
1086 (with-current-buffer b |
96247a7ec10d
* cedet/semantic.el (semantic-mode): Parse all existing buffers when
Chong Yidong <cyd@stupidchicken.com>
parents:
105441
diff
changeset
|
1087 (semantic-new-buffer-fcn)))) |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1088 ;; Disable all Semantic features. |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1089 (remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn) |
105815
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105760
diff
changeset
|
1090 (define-key cedet-menu-map [cedet-menu-separator] nil) |
cdc718e48308
* menu-bar.el (menu-bar-tools-menu): Add Semantic and EDE menu
Chong Yidong <cyd@stupidchicken.com>
parents:
105760
diff
changeset
|
1091 (define-key cedet-menu-map [semantic-options-separator] nil) |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1092 ;; FIXME: handle semanticdb-load-ebrowse-caches |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1093 (dolist (mode semantic-submode-list) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1094 (if (and (boundp mode) (eval mode)) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1095 (funcall mode -1))))) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1096 |
104508
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1097 ;;; Autoload some functions that are not in semantic/loaddefs |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1098 |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1099 (autoload 'global-semantic-idle-completions-mode "semantic/idle" |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1100 "Toggle global use of `semantic-idle-completions-mode'. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1101 If ARG is positive, enable, if it is negative, disable. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1102 If ARG is nil, then toggle." t nil) |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1103 |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1104 (autoload 'semantic-idle-completions-mode "semantic/idle" |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1105 "Display a list of possible completions in a tooltip. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1106 |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1107 This is a minor mode which performs actions during idle time. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1108 With prefix argument ARG, turn on if positive, otherwise off. The |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1109 minor mode can be turned on only if semantic feature is available and |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1110 the current buffer was set up for parsing. Return non-nil if the |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1111 minor mode is enabled." t nil) |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1112 |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1113 (autoload 'global-semantic-idle-summary-mode "semantic/idle" |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1114 "Toggle global use of `semantic-idle-summary-mode'. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1115 If ARG is positive, enable, if it is negative, disable. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1116 If ARG is nil, then toggle." t nil) |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1117 |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1118 (autoload 'semantic-idle-summary-mode "semantic/idle" |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1119 "Display a tag summary of the lexical token under the cursor. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1120 Call `semantic-idle-summary-current-symbol-info' for getting the |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1121 current tag to display information. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1122 |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1123 This is a minor mode which performs actions during idle time. |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1124 With prefix argument ARG, turn on if positive, otherwise off. The |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1125 minor mode can be turned on only if semantic feature is available and |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1126 the current buffer was set up for parsing. Return non-nil if the |
90ca5d588aa9
* cedet/semantic.el: Add autoloads for semantic/idle functions.
Chong Yidong <cyd@stupidchicken.com>
parents:
104506
diff
changeset
|
1127 minor mode is enabled." t nil) |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1128 |
105406
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
1129 (autoload 'srecode-template-setup-parser "srecode/srecode-template" |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
1130 "Set up buffer for parsing SRecode template files." t nil) |
5b8c8cd21526
* cedet/srecode/srt-mode.el (srecode-template-mode): Doc fix.
Chong Yidong <cyd@stupidchicken.com>
parents:
105377
diff
changeset
|
1131 |
104409
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1132 (provide 'semantic) |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1133 |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1134 ;; Semantic-util is a part of the semantic API. Include it last |
560b69982442
semantic.el, semantic-tag.el, semantic-lex.el, semantic-fw.el: Initial
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1135 ;; because it depends on semantic. |
104412
05443eb58935
cedet/semantic.el: Change requires to use semantic/FOO format.
Chong Yidong <cyd@stupidchicken.com>
parents:
104409
diff
changeset
|
1136 (require 'semantic/util) |
104470
6ccad1511df1
Minor whitespace changes and `require' fixes.
Chong Yidong <cyd@stupidchicken.com>
parents:
104449
diff
changeset
|
1137 |
104506
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1138 ;; (require 'semantic/load) |
801834237f9c
* menu-bar.el: Remove ediff-misc from Tools menu.
Chong Yidong <cyd@stupidchicken.com>
parents:
104493
diff
changeset
|
1139 |
105377 | 1140 ;; arch-tag: 31583e10-6508-41a9-be40-f83d0ae0a4ed |
104470
6ccad1511df1
Minor whitespace changes and `require' fixes.
Chong Yidong <cyd@stupidchicken.com>
parents:
104449
diff
changeset
|
1141 ;;; semantic.el ends here |