2009-08-23 03:46:01 +00:00
|
|
|
|
;;; semantic.el --- Semantic buffer evaluator.
|
|
|
|
|
|
2014-01-01 07:43:34 +00:00
|
|
|
|
;; Copyright (C) 1999-2014 Free Software Foundation, Inc.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;; Author: Eric M. Ludlam <zappo@gnu.org>
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
;; Keywords: syntax tools
|
2013-01-31 19:58:56 +00:00
|
|
|
|
;; Version: 2.2
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
|
;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; API for providing the semantic content of a buffer.
|
|
|
|
|
;;
|
2009-12-13 01:55:09 +00:00
|
|
|
|
;; The Semantic API provides an interface to a series of different parser
|
2009-08-23 03:46:01 +00:00
|
|
|
|
;; implementations. Each parser outputs a parse tree in a similar format
|
|
|
|
|
;; designed to handle typical functional and object oriented languages.
|
2009-12-13 01:55:09 +00:00
|
|
|
|
;;
|
|
|
|
|
;; To enable Semantic, turn on `semantic-mode', a global minor mode
|
|
|
|
|
;; (M-x semantic-mode RET, or "Source Code Parsers" from the Tools
|
|
|
|
|
;; menu). To enable it at startup, put (semantic-mode 1) in your init
|
|
|
|
|
;; file.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(require 'cedet)
|
2009-08-28 15:01:48 +00:00
|
|
|
|
(require 'semantic/tag)
|
|
|
|
|
(require 'semantic/lex)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
2013-01-31 19:58:56 +00:00
|
|
|
|
(defvar semantic-version "2.2"
|
2009-09-20 03:44:02 +00:00
|
|
|
|
"Current version of Semantic.")
|
|
|
|
|
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(declare-function inversion-test "inversion")
|
2009-09-21 19:05:56 +00:00
|
|
|
|
(declare-function semanticdb-load-ebrowse-caches "semantic/db-ebrowse")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defun semantic-require-version (major minor &optional beta)
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Non-nil if this version of Semantic does not satisfy a specific version.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
Arguments can be:
|
|
|
|
|
|
|
|
|
|
(MAJOR MINOR &optional BETA)
|
|
|
|
|
|
|
|
|
|
Values MAJOR and MINOR must be integers. BETA can be an integer, or
|
|
|
|
|
excluded if a released version is required.
|
|
|
|
|
|
|
|
|
|
It is assumed that if the current version is newer than that specified,
|
|
|
|
|
everything passes. Exceptions occur when known incompatibilities are
|
|
|
|
|
introduced."
|
|
|
|
|
(require 'inversion)
|
|
|
|
|
(inversion-test 'semantic
|
|
|
|
|
(concat major "." minor
|
|
|
|
|
(when beta (concat "beta" beta)))))
|
|
|
|
|
|
|
|
|
|
(defgroup semantic nil
|
|
|
|
|
"Parser Generator and parser framework."
|
2010-02-16 14:35:45 +00:00
|
|
|
|
:group 'tools)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defgroup semantic-faces nil
|
|
|
|
|
"Faces used for Semantic enabled tools."
|
|
|
|
|
:group 'semantic)
|
|
|
|
|
|
2009-08-28 15:01:48 +00:00
|
|
|
|
(require 'semantic/fw)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
;;; Variables and Configuration
|
|
|
|
|
;;
|
|
|
|
|
(defvar semantic--parse-table nil
|
|
|
|
|
"Variable that defines how to parse top level items in a buffer.
|
|
|
|
|
This variable is for internal use only, and its content depends on the
|
|
|
|
|
external parser used.")
|
|
|
|
|
(make-variable-buffer-local 'semantic--parse-table)
|
|
|
|
|
(semantic-varalias-obsolete 'semantic-toplevel-bovine-table
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic--parse-table "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-symbol->name-assoc-list
|
|
|
|
|
'((type . "Types")
|
|
|
|
|
(variable . "Variables")
|
|
|
|
|
(function . "Functions")
|
|
|
|
|
(include . "Dependencies")
|
|
|
|
|
(package . "Provides"))
|
|
|
|
|
"Association between symbols returned, and a string.
|
|
|
|
|
The string is used to represent a group of objects of the given type.
|
|
|
|
|
It is sometimes useful for a language to use a different string
|
|
|
|
|
in place of the default, even though that language will still
|
|
|
|
|
return a symbol. For example, Java return's includes, but the
|
|
|
|
|
string can be replaced with `Imports'.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-symbol->name-assoc-list)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-symbol->name-assoc-list-for-type-parts nil
|
|
|
|
|
"Like `semantic-symbol->name-assoc-list' for type parts.
|
|
|
|
|
Some tags that have children (see `semantic-tag-children-compatibility')
|
|
|
|
|
will want to define the names of classes of tags differently than at
|
|
|
|
|
the top level. For example, in C++, a Function may be called a
|
|
|
|
|
Method. In addition, there may be new types of tags that exist only
|
|
|
|
|
in classes, such as protection labels.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-symbol->name-assoc-list-for-type-parts)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-case-fold nil
|
|
|
|
|
"Value for `case-fold-search' when parsing.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-case-fold)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-expand-nonterminal nil
|
|
|
|
|
"Function to call for each nonterminal production.
|
|
|
|
|
Return a list of non-terminals derived from the first argument, or nil
|
|
|
|
|
if it does not need to be expanded.
|
|
|
|
|
Languages with compound definitions should use this function to expand
|
|
|
|
|
from one compound symbol into several. For example, in C the definition
|
|
|
|
|
int a, b;
|
|
|
|
|
is easily parsed into one tag. This function should take this
|
|
|
|
|
compound tag and turn it into two tags, one for A, and the other for B.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-expand-nonterminal)
|
|
|
|
|
|
|
|
|
|
(defvar semantic--buffer-cache nil
|
|
|
|
|
"A cache of the fully parsed buffer.
|
|
|
|
|
If no significant changes have been made (based on the state) then
|
|
|
|
|
this is returned instead of re-parsing the buffer.
|
|
|
|
|
|
|
|
|
|
DO NOT USE THIS VARIABLE IN PROGRAMS.
|
|
|
|
|
|
|
|
|
|
If you need a tag list, use `semantic-fetch-tags'. If you need the
|
2010-01-18 04:39:40 +00:00
|
|
|
|
cached values for some reason, chances are you can add a hook to
|
2009-08-23 03:46:01 +00:00
|
|
|
|
`semantic-after-toplevel-cache-change-hook'.")
|
|
|
|
|
(make-variable-buffer-local 'semantic--buffer-cache)
|
|
|
|
|
(semantic-varalias-obsolete 'semantic-toplevel-bovine-cache
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic--buffer-cache "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-unmatched-syntax-cache nil
|
|
|
|
|
"A cached copy of unmatched syntax tokens.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-unmatched-syntax-cache)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-unmatched-syntax-cache-check nil
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Non-nil if the unmatched syntax cache is out of date.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
This is tracked with `semantic-change-function'.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-unmatched-syntax-cache-check)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-edits-are-safe nil
|
|
|
|
|
"When non-nil, modifications do not require a reparse.
|
|
|
|
|
This prevents tags from being marked dirty, and it prevents top level
|
|
|
|
|
edits from causing a cache check.
|
|
|
|
|
Use this when writing programs that could cause a full reparse, but
|
|
|
|
|
will not change the tag structure, such as adding or updating
|
|
|
|
|
`top-level' comments.")
|
|
|
|
|
|
|
|
|
|
(defvar semantic-unmatched-syntax-hook nil
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Hooks run when Semantic detects syntax not matched in a grammar.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
Each individual piece of syntax (such as a symbol or punctuation
|
|
|
|
|
character) is called with this hook when it doesn't match in the
|
|
|
|
|
grammar, and multiple unmatched syntax elements are not grouped
|
2010-01-18 04:39:40 +00:00
|
|
|
|
together. Each hook is called with one argument, which is a list
|
|
|
|
|
of syntax tokens created by the semantic lexer. Use the functions
|
2009-08-23 03:46:01 +00:00
|
|
|
|
`semantic-lex-token-start', `semantic-lex-token-end' and
|
2010-01-18 04:39:40 +00:00
|
|
|
|
`semantic-lex-token-text' to get information about these tokens.
|
|
|
|
|
The current buffer is the buffer these tokens are derived from.")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic--before-fetch-tags-hook nil
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Hooks run before a buffer is parsed for tags.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
It is called before any request for tags is made via the function
|
|
|
|
|
`semantic-fetch-tags' by an application.
|
|
|
|
|
If any hook returns a nil value, the cached value is returned
|
|
|
|
|
immediately, even if it is empty.")
|
|
|
|
|
(semantic-varalias-obsolete 'semantic-before-toplevel-bovination-hook
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic--before-fetch-tags-hook "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-after-toplevel-bovinate-hook nil
|
|
|
|
|
"Hooks run after a toplevel parse.
|
|
|
|
|
It is not run if the toplevel parse command is called, and buffer does
|
|
|
|
|
not need to be fully reparsed.
|
|
|
|
|
For language specific hooks, make sure you define this as a local hook.
|
|
|
|
|
|
|
|
|
|
This hook should not be used any more.
|
|
|
|
|
Use `semantic-after-toplevel-cache-change-hook' instead.")
|
2009-10-03 19:28:05 +00:00
|
|
|
|
(make-obsolete-variable 'semantic-after-toplevel-bovinate-hook nil "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-after-toplevel-cache-change-hook nil
|
|
|
|
|
"Hooks run after the buffer tag list has changed.
|
|
|
|
|
This list will change when a buffer is reparsed, or when the tag list
|
|
|
|
|
in a buffer is cleared. It is *NOT* called if the current tag list is
|
|
|
|
|
partially reparsed.
|
|
|
|
|
|
|
|
|
|
Hook functions must take one argument, which is the new list of tags
|
|
|
|
|
associated with this buffer.
|
|
|
|
|
|
|
|
|
|
For language specific hooks, make sure you define this as a local hook.")
|
|
|
|
|
|
|
|
|
|
(defvar semantic-before-toplevel-cache-flush-hook nil
|
|
|
|
|
"Hooks run before the toplevel tag cache is flushed.
|
|
|
|
|
For language specific hooks, make sure you define this as a local
|
|
|
|
|
hook. This hook is called before a corresponding
|
|
|
|
|
`semantic-after-toplevel-cache-change-hook' which is also called
|
|
|
|
|
during a flush when the cache is given a new value of nil.")
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-dump-parse nil
|
|
|
|
|
"When non-nil, dump parsing information."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-parser-name "LL"
|
|
|
|
|
"Optional name of the parser used to parse input stream.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-parser-name)
|
2009-09-27 03:36:58 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic--completion-cache nil
|
|
|
|
|
"Internal variable used by `semantic-complete-symbol'.")
|
|
|
|
|
(make-variable-buffer-local 'semantic--completion-cache)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;;; Parse tree state management API
|
|
|
|
|
;;
|
|
|
|
|
(defvar semantic-parse-tree-state 'needs-rebuild
|
|
|
|
|
"State of the current parse tree.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-parse-tree-state)
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-unparseable ()
|
|
|
|
|
"Indicate that the current buffer is unparseable.
|
|
|
|
|
It is also true that the parse tree will need either updating or
|
|
|
|
|
a rebuild. This state will be changed when the user edits the buffer."
|
|
|
|
|
`(setq semantic-parse-tree-state 'unparseable))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-unparseable-p ()
|
|
|
|
|
"Return non-nil if the current buffer has been marked unparseable."
|
|
|
|
|
`(eq semantic-parse-tree-state 'unparseable))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-set-needs-update ()
|
|
|
|
|
"Indicate that the current parse tree needs to be updated.
|
|
|
|
|
The parse tree can be updated by `semantic-parse-changes'."
|
|
|
|
|
`(setq semantic-parse-tree-state 'needs-update))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-needs-update-p ()
|
|
|
|
|
"Return non-nil if the current parse tree needs to be updated."
|
|
|
|
|
`(eq semantic-parse-tree-state 'needs-update))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-set-needs-rebuild ()
|
|
|
|
|
"Indicate that the current parse tree needs to be rebuilt.
|
|
|
|
|
The parse tree must be rebuilt by `semantic-parse-region'."
|
|
|
|
|
`(setq semantic-parse-tree-state 'needs-rebuild))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-needs-rebuild-p ()
|
|
|
|
|
"Return non-nil if the current parse tree needs to be rebuilt."
|
|
|
|
|
`(eq semantic-parse-tree-state 'needs-rebuild))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-set-up-to-date ()
|
|
|
|
|
"Indicate that the current parse tree is up to date."
|
|
|
|
|
`(setq semantic-parse-tree-state nil))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-parse-tree-up-to-date-p ()
|
|
|
|
|
"Return non-nil if the current parse tree is up to date."
|
|
|
|
|
`(null semantic-parse-tree-state))
|
|
|
|
|
|
|
|
|
|
;;; Interfacing with the system
|
|
|
|
|
;;
|
|
|
|
|
(defcustom semantic-inhibit-functions nil
|
|
|
|
|
"List of functions to call with no arguments before Semantic is setup.
|
|
|
|
|
If any of these functions returns non-nil, the current buffer is not
|
|
|
|
|
setup to use Semantic."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'hook)
|
|
|
|
|
|
2009-10-04 19:22:09 +00:00
|
|
|
|
(defcustom semantic-new-buffer-setup-functions
|
2010-01-10 00:38:07 +00:00
|
|
|
|
'((c-mode . semantic-default-c-setup)
|
2009-10-04 19:22:09 +00:00
|
|
|
|
(c++-mode . semantic-default-c-setup)
|
|
|
|
|
(html-mode . semantic-default-html-setup)
|
2010-01-10 00:38:07 +00:00
|
|
|
|
(java-mode . wisent-java-default-setup)
|
|
|
|
|
(js-mode . wisent-javascript-setup-parser)
|
|
|
|
|
(python-mode . wisent-python-default-setup)
|
|
|
|
|
(scheme-mode . semantic-default-scheme-setup)
|
2009-10-04 19:22:09 +00:00
|
|
|
|
(srecode-template-mode . srecode-template-setup-parser)
|
2012-10-01 18:10:29 +00:00
|
|
|
|
(texinfo-mode . semantic-default-texi-setup)
|
2009-10-04 19:22:09 +00:00
|
|
|
|
(makefile-automake-mode . semantic-default-make-setup)
|
|
|
|
|
(makefile-gmake-mode . semantic-default-make-setup)
|
|
|
|
|
(makefile-makepp-mode . semantic-default-make-setup)
|
|
|
|
|
(makefile-bsdmake-mode . semantic-default-make-setup)
|
|
|
|
|
(makefile-imake-mode . semantic-default-make-setup)
|
|
|
|
|
(makefile-mode . semantic-default-make-setup))
|
|
|
|
|
"Alist of functions to call to set up Semantic parsing in the buffer.
|
|
|
|
|
Each element has the form (MODE . FN), where MODE is a value of
|
|
|
|
|
`major-mode' for the buffer and FN is the corresponding function
|
|
|
|
|
to call, with no arguments, to set up the parser.
|
|
|
|
|
|
|
|
|
|
These functions are called by `semantic-new-buffer-fcn', before
|
|
|
|
|
`semantic-inhibit-functions'."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type '(alist :key-type symbol :value-type function))
|
|
|
|
|
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(defvar semantic-init-hook nil
|
|
|
|
|
"Hook run when a buffer is initialized with a parsing table.")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(defvar semantic-init-mode-hook nil
|
|
|
|
|
"Hook run when a buffer of a particular mode is initialized.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-init-mode-hook)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(defvar semantic-init-db-hook nil
|
|
|
|
|
"Hook run when a buffer is initialized with a parsing table for DBs.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
This hook is for database functions which intend to swap in a tag table.
|
|
|
|
|
This guarantees that the DB will go before other modes that require
|
|
|
|
|
a parse of the buffer.")
|
|
|
|
|
|
2009-09-26 18:03:54 +00:00
|
|
|
|
(semantic-varalias-obsolete 'semantic-init-hooks
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic-init-hook "23.2")
|
2009-09-26 18:03:54 +00:00
|
|
|
|
(semantic-varalias-obsolete 'semantic-init-mode-hooks
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic-init-mode-hook "23.2")
|
2009-09-26 18:03:54 +00:00
|
|
|
|
(semantic-varalias-obsolete 'semantic-init-db-hooks
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic-init-db-hook "23.2")
|
2009-09-21 02:14:58 +00:00
|
|
|
|
|
2012-10-14 19:20:28 +00:00
|
|
|
|
(defsubst semantic-error-if-unparsed ()
|
|
|
|
|
"Raise an error if current buffer was not parsed by Semantic."
|
|
|
|
|
(unless semantic-new-buffer-fcn-was-run
|
|
|
|
|
(error "Buffer was not parsed by Semantic.")))
|
|
|
|
|
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(defsubst semantic--umatched-syntax-needs-refresh-p ()
|
|
|
|
|
"Return non-nil if the unmatched syntax cache needs a refresh.
|
2010-01-18 04:39:40 +00:00
|
|
|
|
That is, if it is dirty or if the current parse tree isn't up to date."
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(or semantic-unmatched-syntax-cache-check
|
|
|
|
|
(not (semantic-parse-tree-up-to-date-p))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-new-buffer-fcn ()
|
|
|
|
|
"Setup the current buffer to use Semantic.
|
|
|
|
|
If the major mode is ready for Semantic, and no
|
|
|
|
|
`semantic-inhibit-functions' disabled it, the current buffer is setup
|
|
|
|
|
to use Semantic, and `semantic-init-hook' is run."
|
2009-10-04 19:22:09 +00:00
|
|
|
|
;; In upstream Semantic, the parser setup functions are called from
|
|
|
|
|
;; mode hooks. In the version bundled with Emacs, we do it here.
|
|
|
|
|
(let ((entry (assq major-mode semantic-new-buffer-setup-functions)))
|
|
|
|
|
(when entry
|
|
|
|
|
(funcall (cdr entry))))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
;; Do stuff if semantic was activated by a mode hook in this buffer,
|
|
|
|
|
;; and not afterwards disabled.
|
|
|
|
|
(when (and semantic--parse-table
|
|
|
|
|
(not (semantic-active-p))
|
|
|
|
|
(not (run-hook-with-args-until-success
|
|
|
|
|
'semantic-inhibit-functions)))
|
|
|
|
|
;; Make sure that if this buffer is cloned, our tags and overlays
|
|
|
|
|
;; don't go along for the ride.
|
|
|
|
|
(add-hook 'clone-indirect-buffer-hook 'semantic-clear-toplevel-cache
|
|
|
|
|
nil t)
|
2011-11-20 03:48:53 +00:00
|
|
|
|
;; Specify that this function has done its work. At this point
|
2009-08-23 03:46:01 +00:00
|
|
|
|
;; we can consider that semantic is active in this buffer.
|
|
|
|
|
(setq semantic-new-buffer-fcn-was-run t)
|
|
|
|
|
;; Here are some buffer local variables we can initialize ourselves
|
|
|
|
|
;; of a mode does not choose to do so.
|
|
|
|
|
(semantic-lex-init)
|
|
|
|
|
;; Force this buffer to have its cache refreshed.
|
|
|
|
|
(semantic-clear-toplevel-cache)
|
|
|
|
|
;; Call DB hooks before regular init hooks
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(run-hooks 'semantic-init-db-hook)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
;; Set up semantic modes
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(run-hooks 'semantic-init-hook)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
;; Set up major-mode specific semantic modes
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(run-hooks 'semantic-init-mode-hook)))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defun semantic-fetch-tags-fast ()
|
|
|
|
|
"For use in a hook. When only a partial reparse is needed, reparse."
|
|
|
|
|
(condition-case nil
|
|
|
|
|
(if (semantic-parse-tree-needs-update-p)
|
|
|
|
|
(semantic-fetch-tags))
|
|
|
|
|
(error nil))
|
|
|
|
|
semantic--buffer-cache)
|
|
|
|
|
|
|
|
|
|
;;; Parsing Commands
|
|
|
|
|
;;
|
|
|
|
|
(eval-when-compile
|
|
|
|
|
(condition-case nil (require 'pp) (error nil)))
|
|
|
|
|
|
|
|
|
|
(defvar semantic-edebug nil
|
|
|
|
|
"When non-nil, activate the interactive parsing debugger.
|
|
|
|
|
Do not set this yourself. Call `semantic-debug'.")
|
|
|
|
|
|
2012-10-25 20:13:16 +00:00
|
|
|
|
(defsubst semantic-elapsed-time (start end)
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Copied from elp.el. Was `elp-elapsed-time'.
|
2011-11-20 03:48:53 +00:00
|
|
|
|
Arguments START and END bound the time being calculated."
|
2011-07-01 00:24:48 +00:00
|
|
|
|
(float-time (time-subtract end start)))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defun bovinate (&optional clear)
|
|
|
|
|
"Parse the current buffer. Show output in a temp buffer.
|
|
|
|
|
Optional argument CLEAR will clear the cache before parsing.
|
|
|
|
|
If CLEAR is negative, it will do a full reparse, and also not display
|
|
|
|
|
the output buffer."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(if clear (semantic-clear-toplevel-cache))
|
|
|
|
|
(if (eq clear '-) (setq clear -1))
|
|
|
|
|
(let* ((start (current-time))
|
|
|
|
|
(out (semantic-fetch-tags))
|
|
|
|
|
(end (current-time)))
|
|
|
|
|
(message "Retrieving tags took %.2f seconds."
|
|
|
|
|
(semantic-elapsed-time start end))
|
|
|
|
|
(when (or (null clear) (not (listp clear)))
|
|
|
|
|
(pop-to-buffer "*Parser Output*")
|
|
|
|
|
(require 'pp)
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert (pp-to-string out))
|
|
|
|
|
(goto-char (point-min)))))
|
|
|
|
|
|
|
|
|
|
;;; Functions of the parser plug-in API
|
|
|
|
|
;;
|
|
|
|
|
;; Overload these functions to create new types of parsers.
|
|
|
|
|
;;
|
|
|
|
|
(define-overloadable-function semantic-parse-stream (stream nonterminal)
|
|
|
|
|
"Parse STREAM, starting at the first NONTERMINAL rule.
|
|
|
|
|
For bovine and wisent based parsers, STREAM is from the output of
|
2010-01-18 04:39:40 +00:00
|
|
|
|
`semantic-lex', and NONTERMINAL is a rule in the appropriate language
|
2009-08-23 03:46:01 +00:00
|
|
|
|
specific rules file.
|
|
|
|
|
The default parser table used for bovine or wisent based parsers is
|
|
|
|
|
`semantic--parse-table'.
|
|
|
|
|
|
|
|
|
|
Must return a list: (STREAM TAGS) where STREAM is the unused elements
|
2010-01-18 04:39:40 +00:00
|
|
|
|
from STREAM, and TAGS is the list of semantic tags found; usually only
|
|
|
|
|
one tag is returned with the exception of compound statements.")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(define-overloadable-function semantic-parse-changes ()
|
|
|
|
|
"Reparse changes in the current buffer.
|
|
|
|
|
The list of changes are tracked as a series of overlays in the buffer.
|
|
|
|
|
When overloading this function, use `semantic-changes-in-region' to
|
|
|
|
|
analyze.")
|
|
|
|
|
|
|
|
|
|
(define-overloadable-function semantic-parse-region
|
|
|
|
|
(start end &optional nonterminal depth returnonerror)
|
|
|
|
|
"Parse the area between START and END, and return any tags found.
|
|
|
|
|
If END needs to be extended due to a lexical token being too large, it
|
|
|
|
|
will be silently ignored.
|
|
|
|
|
|
|
|
|
|
Optional arguments:
|
|
|
|
|
NONTERMINAL is the rule to start parsing at.
|
2011-11-20 03:48:53 +00:00
|
|
|
|
DEPTH specifies the lexical depth to descend for parsers that use
|
2009-08-23 03:46:01 +00:00
|
|
|
|
lexical analysis as their first step.
|
|
|
|
|
RETURNONERROR specifies that parsing should stop on the first
|
|
|
|
|
unmatched syntax encountered. When nil, parsing skips the syntax,
|
|
|
|
|
adding it to the unmatched syntax cache.
|
|
|
|
|
|
2011-11-23 07:03:56 +00:00
|
|
|
|
Must return a list of semantic tags which have been cooked
|
2009-08-23 03:46:01 +00:00
|
|
|
|
\(repositioned properly) but which DO NOT HAVE OVERLAYS associated
|
|
|
|
|
with them. When overloading this function, use `semantic--tag-expand'
|
|
|
|
|
to cook raw tags.")
|
|
|
|
|
|
|
|
|
|
(defun semantic-parse-region-default
|
|
|
|
|
(start end &optional nonterminal depth returnonerror)
|
|
|
|
|
"Parse the area between START and END, and return any tags found.
|
2010-01-18 04:39:40 +00:00
|
|
|
|
If END needs to be extended due to a lexical token being too large,
|
|
|
|
|
it will be silently ignored.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
Optional arguments:
|
|
|
|
|
NONTERMINAL is the rule to start parsing at if it is known.
|
|
|
|
|
DEPTH specifies the lexical depth to scan.
|
|
|
|
|
RETURNONERROR specifies that parsing should end when encountering
|
|
|
|
|
unterminated syntax."
|
|
|
|
|
(when (or (null semantic--parse-table) (eq semantic--parse-table t))
|
|
|
|
|
;; If there is no table, or it was set to t, then we are here by
|
|
|
|
|
;; some other mistake. Do not throw an error deep in the parser.
|
|
|
|
|
(error "No support found to parse buffer %S" (buffer-name)))
|
|
|
|
|
(save-restriction
|
|
|
|
|
(widen)
|
|
|
|
|
(when (or (< end start) (> end (point-max)))
|
|
|
|
|
(error "Invalid parse region bounds %S, %S" start end))
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 22:11:03 +00:00
|
|
|
|
(semantic-repeat-parse-whole-stream
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(or (cdr (assq start semantic-lex-block-streams))
|
|
|
|
|
(semantic-lex start end depth))
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 22:11:03 +00:00
|
|
|
|
nonterminal returnonerror)))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;;; Parsing functions
|
|
|
|
|
;;
|
|
|
|
|
(defun semantic-set-unmatched-syntax-cache (unmatched-syntax)
|
|
|
|
|
"Set the unmatched syntax cache.
|
|
|
|
|
Argument UNMATCHED-SYNTAX is the syntax to set into the cache."
|
|
|
|
|
;; This function is not actually called by the main parse loop.
|
|
|
|
|
;; This is intended for use by semanticdb.
|
|
|
|
|
(setq semantic-unmatched-syntax-cache unmatched-syntax
|
|
|
|
|
semantic-unmatched-syntax-cache-check nil)
|
|
|
|
|
;; Refresh the display of unmatched syntax tokens if enabled
|
|
|
|
|
(run-hook-with-args 'semantic-unmatched-syntax-hook
|
|
|
|
|
semantic-unmatched-syntax-cache))
|
|
|
|
|
|
|
|
|
|
(defun semantic-clear-unmatched-syntax-cache ()
|
|
|
|
|
"Clear the cache of unmatched syntax tokens."
|
|
|
|
|
(setq semantic-unmatched-syntax-cache nil
|
|
|
|
|
semantic-unmatched-syntax-cache-check t))
|
|
|
|
|
|
|
|
|
|
(defun semantic-unmatched-syntax-tokens ()
|
|
|
|
|
"Return the list of unmatched syntax tokens."
|
|
|
|
|
;; If the cache need refresh then do a full re-parse.
|
|
|
|
|
(if (semantic--umatched-syntax-needs-refresh-p)
|
|
|
|
|
;; To avoid a recursive call, temporarily disable
|
|
|
|
|
;; `semantic-unmatched-syntax-hook'.
|
|
|
|
|
(let (semantic-unmatched-syntax-hook)
|
|
|
|
|
(condition-case nil
|
|
|
|
|
(progn
|
|
|
|
|
(semantic-clear-toplevel-cache)
|
|
|
|
|
(semantic-fetch-tags))
|
|
|
|
|
(quit
|
|
|
|
|
(message "semantic-unmatched-syntax-tokens:\
|
|
|
|
|
parsing of buffer canceled"))
|
|
|
|
|
)))
|
|
|
|
|
semantic-unmatched-syntax-cache)
|
|
|
|
|
|
|
|
|
|
(defun semantic-clear-toplevel-cache ()
|
|
|
|
|
"Clear the toplevel tag cache for the current buffer.
|
|
|
|
|
Clearing the cache will force a complete reparse next time a tag list
|
|
|
|
|
is requested."
|
|
|
|
|
(interactive)
|
|
|
|
|
(run-hooks 'semantic-before-toplevel-cache-flush-hook)
|
|
|
|
|
(setq semantic--buffer-cache nil)
|
|
|
|
|
(semantic-clear-unmatched-syntax-cache)
|
|
|
|
|
(semantic-clear-parser-warnings)
|
|
|
|
|
;; Nuke all semantic overlays. This is faster than deleting based
|
|
|
|
|
;; on our data structure.
|
|
|
|
|
(let ((l (semantic-overlay-lists)))
|
|
|
|
|
(mapc 'semantic-delete-overlay-maybe (car l))
|
|
|
|
|
(mapc 'semantic-delete-overlay-maybe (cdr l))
|
|
|
|
|
)
|
|
|
|
|
(semantic-parse-tree-set-needs-rebuild)
|
|
|
|
|
;; Remove this hook which tracks if a buffer is up to date or not.
|
|
|
|
|
(remove-hook 'after-change-functions 'semantic-change-function t)
|
|
|
|
|
;; Old model. Delete someday.
|
|
|
|
|
;;(run-hooks 'semantic-after-toplevel-bovinate-hook)
|
|
|
|
|
|
|
|
|
|
(run-hook-with-args 'semantic-after-toplevel-cache-change-hook
|
|
|
|
|
semantic--buffer-cache)
|
2009-09-27 03:36:58 +00:00
|
|
|
|
|
|
|
|
|
(setq semantic--completion-cache nil))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-bovinate-nonterminal-check-obarray)
|
|
|
|
|
|
|
|
|
|
(defun semantic--set-buffer-cache (tagtable)
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Set the toplevel tag cache to TAGTABLE."
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(setq semantic--buffer-cache tagtable
|
2009-09-05 20:32:50 +00:00
|
|
|
|
semantic-unmatched-syntax-cache-check nil)
|
|
|
|
|
;; This is specific to the bovine parser.
|
|
|
|
|
(set (make-local-variable 'semantic-bovinate-nonterminal-check-obarray)
|
|
|
|
|
nil)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(semantic-parse-tree-set-up-to-date)
|
|
|
|
|
(semantic-make-local-hook 'after-change-functions)
|
|
|
|
|
(add-hook 'after-change-functions 'semantic-change-function nil t)
|
|
|
|
|
(run-hook-with-args 'semantic-after-toplevel-cache-change-hook
|
|
|
|
|
semantic--buffer-cache)
|
2009-09-27 03:36:58 +00:00
|
|
|
|
(setq semantic--completion-cache nil)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
;; Refresh the display of unmatched syntax tokens if enabled
|
|
|
|
|
(run-hook-with-args 'semantic-unmatched-syntax-hook
|
|
|
|
|
semantic-unmatched-syntax-cache)
|
|
|
|
|
;; Old Semantic 1.3 hook API. Maybe useful forever?
|
|
|
|
|
(run-hooks 'semantic-after-toplevel-bovinate-hook)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-working-type 'percent
|
2012-04-09 13:05:48 +00:00
|
|
|
|
"The type of working message to use when parsing.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
'percent means we are doing a linear parse through the buffer.
|
|
|
|
|
'dynamic means we are reparsing specific tags.")
|
|
|
|
|
(semantic-varalias-obsolete 'semantic-bovination-working-type
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic-working-type "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-minimum-working-buffer-size (* 1024 5)
|
2012-04-09 13:05:48 +00:00
|
|
|
|
"The minimum size of a buffer before working messages are displayed.
|
2010-01-18 04:39:40 +00:00
|
|
|
|
Buffers smaller than this will parse silently.
|
2009-10-01 02:39:07 +00:00
|
|
|
|
Buffers larger than this will display the working progress bar.")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defsubst semantic-parser-working-message (&optional arg)
|
|
|
|
|
"Return the message string displayed while parsing.
|
|
|
|
|
If optional argument ARG is non-nil it is appended to the message
|
|
|
|
|
string."
|
2009-09-21 19:05:56 +00:00
|
|
|
|
(concat "Parsing"
|
|
|
|
|
(if arg (format " %s" arg))
|
|
|
|
|
(if semantic-parser-name (format " (%s)" semantic-parser-name))
|
|
|
|
|
"..."))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;;; Application Parser Entry Points
|
|
|
|
|
;;
|
|
|
|
|
;; The best way to call the parser from programs is via
|
|
|
|
|
;; `semantic-fetch-tags'. This, in turn, uses other internal
|
|
|
|
|
;; API functions which plug-in parsers can take advantage of.
|
|
|
|
|
|
|
|
|
|
(defun semantic-fetch-tags ()
|
|
|
|
|
"Fetch semantic tags from the current buffer.
|
|
|
|
|
If the buffer cache is up to date, return that.
|
|
|
|
|
If the buffer cache is out of date, attempt an incremental reparse.
|
|
|
|
|
If the buffer has not been parsed before, or if the incremental reparse
|
|
|
|
|
fails, then parse the entire buffer.
|
2009-10-01 02:39:07 +00:00
|
|
|
|
If a lexical error had been previously discovered and the buffer
|
2009-08-23 03:46:01 +00:00
|
|
|
|
was marked unparseable, then do nothing, and return the cache."
|
|
|
|
|
(and
|
|
|
|
|
;; Is this a semantic enabled buffer?
|
|
|
|
|
(semantic-active-p)
|
|
|
|
|
;; Application hooks say the buffer is safe for parsing
|
|
|
|
|
(run-hook-with-args-until-failure
|
|
|
|
|
'semantic-before-toplevel-bovination-hook)
|
|
|
|
|
(run-hook-with-args-until-failure
|
|
|
|
|
'semantic--before-fetch-tags-hook)
|
|
|
|
|
;; If the buffer was previously marked unparseable,
|
|
|
|
|
;; then don't waste our time.
|
|
|
|
|
(not (semantic-parse-tree-unparseable-p))
|
|
|
|
|
;; The parse tree actually needs to be refreshed
|
|
|
|
|
(not (semantic-parse-tree-up-to-date-p))
|
|
|
|
|
;; So do it!
|
|
|
|
|
(let* ((gc-cons-threshold (max gc-cons-threshold 10000000))
|
|
|
|
|
(semantic-lex-block-streams nil)
|
|
|
|
|
(res nil))
|
|
|
|
|
(garbage-collect)
|
|
|
|
|
(cond
|
|
|
|
|
|
|
|
|
|
;;;; Try the incremental parser to do a fast update.
|
|
|
|
|
((semantic-parse-tree-needs-update-p)
|
|
|
|
|
(setq res (semantic-parse-changes))
|
|
|
|
|
(if (semantic-parse-tree-needs-rebuild-p)
|
|
|
|
|
;; If the partial reparse fails, jump to a full reparse.
|
|
|
|
|
(semantic-fetch-tags)
|
|
|
|
|
;; Clear the cache of unmatched syntax tokens
|
|
|
|
|
;;
|
|
|
|
|
;; NOTE TO SELF:
|
|
|
|
|
;;
|
|
|
|
|
;; Move this into the incremental parser. This is a bug.
|
|
|
|
|
;;
|
|
|
|
|
(semantic-clear-unmatched-syntax-cache)
|
|
|
|
|
(run-hook-with-args ;; Let hooks know the updated tags
|
|
|
|
|
'semantic-after-partial-cache-change-hook res))
|
2009-09-27 03:36:58 +00:00
|
|
|
|
(setq semantic--completion-cache nil))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;;;; Parse the whole system.
|
|
|
|
|
((semantic-parse-tree-needs-rebuild-p)
|
2012-10-01 18:10:29 +00:00
|
|
|
|
;; Use Emacs's built-in progress-reporter (only interactive).
|
|
|
|
|
(if noninteractive
|
|
|
|
|
(setq res (semantic-parse-region (point-min) (point-max)))
|
|
|
|
|
(let ((semantic--progress-reporter
|
|
|
|
|
(and (>= (point-max) semantic-minimum-working-buffer-size)
|
|
|
|
|
(eq semantic-working-type 'percent)
|
|
|
|
|
(make-progress-reporter
|
|
|
|
|
(semantic-parser-working-message (buffer-name))
|
|
|
|
|
0 100))))
|
|
|
|
|
(setq res (semantic-parse-region (point-min) (point-max)))
|
|
|
|
|
(if semantic--progress-reporter
|
|
|
|
|
(progress-reporter-done semantic--progress-reporter))))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;; Clear the caches when we see there were no errors.
|
|
|
|
|
;; But preserve the unmatched syntax cache and warnings!
|
|
|
|
|
(let (semantic-unmatched-syntax-cache
|
|
|
|
|
semantic-unmatched-syntax-cache-check
|
|
|
|
|
semantic-parser-warnings)
|
|
|
|
|
(semantic-clear-toplevel-cache))
|
|
|
|
|
;; Set up the new overlays
|
|
|
|
|
(semantic--tag-link-list-to-buffer res)
|
|
|
|
|
;; Set up the cache with the new results
|
|
|
|
|
(semantic--set-buffer-cache res)
|
|
|
|
|
))))
|
|
|
|
|
|
|
|
|
|
;; Always return the current parse tree.
|
|
|
|
|
semantic--buffer-cache)
|
|
|
|
|
|
|
|
|
|
(defun semantic-refresh-tags-safe ()
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Refresh the current buffer's tags safely.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
Return non-nil if the refresh was successful.
|
|
|
|
|
Return nil if there is some sort of syntax error preventing a reparse.
|
|
|
|
|
|
|
|
|
|
Does nothing if the current buffer doesn't need reparsing."
|
|
|
|
|
|
|
|
|
|
;; These checks actually occur in `semantic-fetch-tags', but if we
|
|
|
|
|
;; do them here, then all the bovination hooks are not run, and
|
|
|
|
|
;; we save lots of time.
|
|
|
|
|
(cond
|
|
|
|
|
;; If the buffer was previously marked unparseable,
|
|
|
|
|
;; then don't waste our time.
|
|
|
|
|
((semantic-parse-tree-unparseable-p)
|
|
|
|
|
nil)
|
|
|
|
|
;; The parse tree is already ok.
|
|
|
|
|
((semantic-parse-tree-up-to-date-p)
|
|
|
|
|
t)
|
|
|
|
|
(t
|
|
|
|
|
(let* ((inhibit-quit nil)
|
|
|
|
|
(lexically-safe t)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(unwind-protect
|
|
|
|
|
;; Perform the parsing.
|
|
|
|
|
(progn
|
|
|
|
|
(when (semantic-lex-catch-errors safe-refresh
|
|
|
|
|
(save-excursion (semantic-fetch-tags))
|
|
|
|
|
nil)
|
|
|
|
|
;; If we are here, it is because the lexical step failed,
|
2011-12-04 08:02:42 +00:00
|
|
|
|
;; probably due to unterminated lists or something like that.
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;; We do nothing, and just wait for the next idle timer
|
|
|
|
|
;; to go off. In the meantime, remember this, and make sure
|
|
|
|
|
;; no other idle services can get executed.
|
|
|
|
|
(setq lexically-safe nil))
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
;; Return if we are lexically safe
|
|
|
|
|
lexically-safe))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-bovinate-toplevel (&optional ignored)
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Backward compatibility function."
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(semantic-fetch-tags))
|
2009-10-03 19:28:05 +00:00
|
|
|
|
(make-obsolete 'semantic-bovinate-toplevel 'semantic-fetch-tags "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
;; Another approach is to let Emacs call the parser on idle time, when
|
|
|
|
|
;; needed, use `semantic-fetch-available-tags' to only retrieve
|
|
|
|
|
;; available tags, and setup the `semantic-after-*-hook' hooks to
|
|
|
|
|
;; synchronize with new tags when they become available.
|
|
|
|
|
|
|
|
|
|
(defsubst semantic-fetch-available-tags ()
|
|
|
|
|
"Fetch available semantic tags from the current buffer.
|
|
|
|
|
That is, return tags currently in the cache without parsing the
|
|
|
|
|
current buffer.
|
|
|
|
|
Parse operations happen asynchronously when needed on Emacs idle time.
|
|
|
|
|
Use the `semantic-after-toplevel-cache-change-hook' and
|
|
|
|
|
`semantic-after-partial-cache-change-hook' hooks to synchronize with
|
|
|
|
|
new tags when they become available."
|
|
|
|
|
semantic--buffer-cache)
|
|
|
|
|
|
|
|
|
|
;;; Iterative parser helper function
|
|
|
|
|
;;
|
|
|
|
|
;; Iterative parsers are better than rule-based iterative functions
|
|
|
|
|
;; in that they can handle obscure errors more cleanly.
|
|
|
|
|
;;
|
|
|
|
|
;; `semantic-repeat-parse-whole-stream' abstracts this action for
|
|
|
|
|
;; other parser centric routines.
|
|
|
|
|
;;
|
|
|
|
|
(defun semantic-repeat-parse-whole-stream
|
|
|
|
|
(stream nonterm &optional returnonerror)
|
|
|
|
|
"Iteratively parse the entire stream STREAM starting with NONTERM.
|
|
|
|
|
Optional argument RETURNONERROR indicates that the parser should exit
|
|
|
|
|
with the current results on a parse error.
|
|
|
|
|
This function returns semantic tags without overlays."
|
|
|
|
|
(let ((result nil)
|
|
|
|
|
(case-fold-search semantic-case-fold)
|
|
|
|
|
nontermsym tag)
|
|
|
|
|
(while stream
|
|
|
|
|
(setq nontermsym (semantic-parse-stream stream nonterm)
|
|
|
|
|
tag (car (cdr nontermsym)))
|
|
|
|
|
(if (not nontermsym)
|
|
|
|
|
(error "Parse error @ %d" (car (cdr (car stream)))))
|
|
|
|
|
(if (eq (car nontermsym) stream)
|
|
|
|
|
(error "Parser error: Infinite loop?"))
|
|
|
|
|
(if tag
|
|
|
|
|
(if (car tag)
|
|
|
|
|
(setq tag (mapcar
|
|
|
|
|
#'(lambda (tag)
|
|
|
|
|
;; Set the 'reparse-symbol property to
|
|
|
|
|
;; NONTERM unless it was already setup
|
|
|
|
|
;; by a tag expander
|
|
|
|
|
(or (semantic--tag-get-property
|
|
|
|
|
tag 'reparse-symbol)
|
|
|
|
|
(semantic--tag-put-property
|
|
|
|
|
tag 'reparse-symbol nonterm))
|
|
|
|
|
tag)
|
|
|
|
|
(semantic--tag-expand tag))
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 22:11:03 +00:00
|
|
|
|
result (append result tag))
|
2009-08-23 03:46:01 +00:00
|
|
|
|
;; No error in this case, a purposeful nil means don't
|
|
|
|
|
;; store anything.
|
|
|
|
|
)
|
|
|
|
|
(if returnonerror
|
|
|
|
|
(setq stream nil)
|
|
|
|
|
;; The current item in the stream didn't match, so add it to
|
|
|
|
|
;; the list of syntax items which didn't match.
|
|
|
|
|
(setq semantic-unmatched-syntax-cache
|
|
|
|
|
(cons (car stream) semantic-unmatched-syntax-cache))
|
|
|
|
|
))
|
|
|
|
|
;; Designated to ignore.
|
|
|
|
|
(setq stream (car nontermsym))
|
|
|
|
|
(if stream
|
2012-02-28 08:17:21 +00:00
|
|
|
|
;; Use Emacs's built-in progress reporter:
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(and (boundp 'semantic--progress-reporter)
|
|
|
|
|
semantic--progress-reporter
|
cedet/cedet.el (cedet-packages): Bump srecode version.
cedet/data-debug.el: Require `ring' for use of ring-length.
cedet/semantic.el (semantic-repeat-parse-whole-stream): Check
semantic-working-type before updating progress reporter.
cedet/semantic/adebug.el: Fix file header.
cedet/semantic/analyze.el: eval-when-compile semantic/find, for
semantic-find-tags-by-name. Declare semanticdb-strip-find-results and
semanticdb-find-tags-by-name.
cedet/semantic/chart.el: Require semantic/find, semantic/db-mode,
semantic/db-typecache, and semantic/scope.
cedet/semantic/complete.el: Declare
semantic-displayor-focus-abstract-child-p function (needed as the
semantic-displayor-focus-abstract class is defined only after used).
Move semantic-complete-inline-custom-type and
semantic-complete-inline-analyzer-displayor-class variable definitions
up, before they are used, to avoid compiler warning.
Require semantic/decorate, semantic/tag-file, eieio-opt, and
semantic/analyze/complete.
cedet/semantic/ctxt.el: Require semantic/find. Don't
eval-when-compile semantic/db
(semantic-get-local-variables): Use Emacs' built-in progress reporter
instead of working-status-forms.
cedet/semantic/db-debug.el: Require data-debug, semantic/db-mode, and
semantic/format.
cedet/semantic/db-ebrowse.el: Require semantic/db-mode, semantic/find,
semantic/sort, data-debug
(semanticdb-create-database): Require semantic/dep for
semantic-add-system-include.
(semanticdb-table-ebrowse, semanticdb-project-database-ebrowse): Move
class definitions near top of file, before they are used, to avoid
compiler warnings.
(semanticdb-ebrowse-add-tree-to-table): Use split-string.
2009-08-30 21:16:39 +00:00
|
|
|
|
(eq semantic-working-type 'percent)
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(progress-reporter-update
|
|
|
|
|
semantic--progress-reporter
|
|
|
|
|
(/ (* 100 (semantic-lex-token-start (car stream)))
|
|
|
|
|
(point-max))))))
|
|
|
|
|
result))
|
|
|
|
|
|
|
|
|
|
;;; Parsing Warnings:
|
|
|
|
|
;;
|
|
|
|
|
;; Parsing a buffer may result in non-critical things that we should
|
|
|
|
|
;; alert the user to without interrupting the normal flow.
|
|
|
|
|
;;
|
|
|
|
|
;; Any parser can use this API to provide a list of warnings during a
|
|
|
|
|
;; parse which a user may want to investigate.
|
|
|
|
|
(defvar semantic-parser-warnings nil
|
|
|
|
|
"A list of parser warnings since the last full reparse.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-parser-warnings)
|
|
|
|
|
|
|
|
|
|
(defun semantic-clear-parser-warnings ()
|
|
|
|
|
"Clear the current list of parser warnings for this buffer."
|
|
|
|
|
(setq semantic-parser-warnings nil))
|
|
|
|
|
|
|
|
|
|
(defun semantic-push-parser-warning (warning start end)
|
|
|
|
|
"Add a parser WARNING that covers text from START to END."
|
|
|
|
|
(setq semantic-parser-warnings
|
|
|
|
|
(cons (cons warning (cons start end))
|
|
|
|
|
semantic-parser-warnings)))
|
|
|
|
|
|
|
|
|
|
(defun semantic-dump-parser-warnings ()
|
|
|
|
|
"Dump any parser warnings."
|
|
|
|
|
(interactive)
|
|
|
|
|
(if semantic-parser-warnings
|
|
|
|
|
(let ((pw semantic-parser-warnings))
|
|
|
|
|
(pop-to-buffer "*Parser Warnings*")
|
|
|
|
|
(require 'pp)
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert (pp-to-string pw))
|
|
|
|
|
(goto-char (point-min)))
|
|
|
|
|
(message "No parser warnings.")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Compatibility:
|
|
|
|
|
;;
|
|
|
|
|
;; Semantic 1.x parser action helper functions, used by some parsers.
|
|
|
|
|
;; Please move away from these functions, and try using semantic 2.x
|
|
|
|
|
;; interfaces instead.
|
|
|
|
|
;;
|
|
|
|
|
(defsubst semantic-bovinate-region-until-error
|
|
|
|
|
(start end nonterm &optional depth)
|
|
|
|
|
"NOTE: Use `semantic-parse-region' instead.
|
|
|
|
|
|
|
|
|
|
Bovinate between START and END starting with NONTERM.
|
|
|
|
|
Optional DEPTH specifies how many levels of parenthesis to enter.
|
|
|
|
|
This command will parse until an error is encountered, and return
|
|
|
|
|
the list of everything found until that moment.
|
|
|
|
|
This is meant for finding variable definitions at the beginning of
|
|
|
|
|
code blocks in methods. If `bovine-inner-scope' can also support
|
|
|
|
|
commands, use `semantic-bovinate-from-nonterminal-full'."
|
|
|
|
|
(semantic-parse-region start end nonterm depth t))
|
|
|
|
|
(make-obsolete 'semantic-bovinate-region-until-error
|
2009-10-03 19:28:05 +00:00
|
|
|
|
'semantic-parse-region "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
|
|
|
|
(defsubst semantic-bovinate-from-nonterminal
|
|
|
|
|
(start end nonterm &optional depth length)
|
|
|
|
|
"Bovinate from within a nonterminal lambda from START to END.
|
|
|
|
|
Argument NONTERM is the nonterminal symbol to start with.
|
|
|
|
|
Optional argument DEPTH is the depth of lists to dive into. When used
|
|
|
|
|
in a `lambda' of a MATCH-LIST, there is no need to include a START and
|
|
|
|
|
END part.
|
|
|
|
|
Optional argument LENGTH specifies we are only interested in LENGTH
|
|
|
|
|
tokens."
|
|
|
|
|
(car-safe (cdr (semantic-parse-stream
|
|
|
|
|
(semantic-lex start end (or depth 1) length)
|
|
|
|
|
nonterm))))
|
|
|
|
|
|
|
|
|
|
(defsubst semantic-bovinate-from-nonterminal-full
|
|
|
|
|
(start end nonterm &optional depth)
|
|
|
|
|
"NOTE: Use `semantic-parse-region' instead.
|
|
|
|
|
|
|
|
|
|
Bovinate from within a nonterminal lambda from START to END.
|
|
|
|
|
Iterates until all the space between START and END is exhausted.
|
|
|
|
|
Argument NONTERM is the nonterminal symbol to start with.
|
|
|
|
|
If NONTERM is nil, use `bovine-block-toplevel'.
|
|
|
|
|
Optional argument DEPTH is the depth of lists to dive into.
|
|
|
|
|
When used in a `lambda' of a MATCH-LIST, there is no need to include
|
|
|
|
|
a START and END part."
|
|
|
|
|
(semantic-parse-region start end nonterm (or depth 1)))
|
|
|
|
|
(make-obsolete 'semantic-bovinate-from-nonterminal-full
|
2009-10-03 19:28:05 +00:00
|
|
|
|
'semantic-parse-region "23.2")
|
2009-08-23 03:46:01 +00:00
|
|
|
|
|
2009-09-21 02:14:58 +00:00
|
|
|
|
;;; User interface
|
|
|
|
|
|
2009-09-27 03:36:58 +00:00
|
|
|
|
(defun semantic-force-refresh ()
|
|
|
|
|
"Force a full refresh of the current buffer's tags.
|
|
|
|
|
Throw away all the old tags, and recreate the tag database."
|
|
|
|
|
(interactive)
|
|
|
|
|
(semantic-clear-toplevel-cache)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(semantic-fetch-tags)
|
|
|
|
|
(message "Buffer reparsed."))
|
2009-09-27 03:36:58 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-mode-map
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(let ((map (make-sparse-keymap)))
|
2009-09-27 03:36:58 +00:00
|
|
|
|
;; Key bindings:
|
|
|
|
|
;; (define-key km "f" 'senator-search-set-tag-class-filter)
|
|
|
|
|
;; (define-key km "i" 'senator-isearch-toggle-semantic-mode)
|
|
|
|
|
(define-key map "\C-c,j" 'semantic-complete-jump-local)
|
|
|
|
|
(define-key map "\C-c,J" 'semantic-complete-jump)
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
(define-key map "\C-c,m" 'semantic-complete-jump-local-members)
|
2009-09-27 03:36:58 +00:00
|
|
|
|
(define-key map "\C-c,g" 'semantic-symref-symbol)
|
|
|
|
|
(define-key map "\C-c,G" 'semantic-symref)
|
|
|
|
|
(define-key map "\C-c,p" 'senator-previous-tag)
|
|
|
|
|
(define-key map "\C-c,n" 'senator-next-tag)
|
|
|
|
|
(define-key map "\C-c,u" 'senator-go-to-up-reference)
|
|
|
|
|
(define-key map "\C-c, " 'semantic-complete-analyze-inline)
|
|
|
|
|
(define-key map "\C-c,\C-w" 'senator-kill-tag)
|
|
|
|
|
(define-key map "\C-c,\M-w" 'senator-copy-tag)
|
|
|
|
|
(define-key map "\C-c,\C-y" 'senator-yank-tag)
|
|
|
|
|
(define-key map "\C-c,r" 'senator-copy-tag-to-register)
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
(define-key map "\C-c,," 'semantic-force-refresh)
|
2009-09-27 03:36:58 +00:00
|
|
|
|
(define-key map [?\C-c ?, up] 'senator-transpose-tags-up)
|
|
|
|
|
(define-key map [?\C-c ?, down] 'senator-transpose-tags-down)
|
|
|
|
|
(define-key map "\C-c,l" 'semantic-analyze-possible-completions)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
;; This hack avoids showing the CEDET menu twice if ede-minor-mode
|
|
|
|
|
;; and Semantic are both enabled. Is there a better way?
|
|
|
|
|
(define-key map [menu-bar cedet-menu]
|
|
|
|
|
(list 'menu-item "Development" cedet-menu-map
|
Merge from CEDET upstream (8564).
* lisp/emacs-lisp:
* emacs-lisp/eieio.el (eieio--defalias, eieio-hook)
(eieio-error-unsupported-class-tags, eieio-skip-typecheck)
(eieio-optimize-primary-methods-flag, eieio-initializing-object)
(eieio-unbound, eieio-default-superclass)
(eieio--define-field-accessors, method-static, method-before)
(method-primary, method-after, method-num-lists)
(method-generic-before, method-generic-primary)
(method-generic-after, method-num-slots)
(eieio-specialized-key-to-generic-key)
(eieio--check-type, class-v, class-p)
(eieio-class-name, define-obsolete-function-alias)
(eieio-class-parents-fast, eieio-class-children-fast)
(same-class-fast-p, class-constructor, generic-p)
(generic-primary-only-p, generic-primary-only-one-p)
(class-option-assoc, class-option, eieio-object-p)
(class-abstract-p, class-method-invocation-order)
(eieio-defclass-autoload-map, eieio-defclass-autoload)
(eieio-class-un-autoload, eieio-defclass)
(eieio-eval-default-p, eieio-perform-slot-validation-for-default)
(eieio-add-new-slot, eieio-copy-parents-into-subclass)
(eieio--defgeneric-init-form, eieio-defgeneric-form)
(eieio-defgeneric-reset-generic-form)
(eieio-defgeneric-form-primary-only)
(eieio-defgeneric-reset-generic-form-primary-only)
(eieio-defgeneric-form-primary-only-one)
(eieio-defgeneric-reset-generic-form-primary-only-one)
(eieio-unbind-method-implementations)
(eieio--defmethod, eieio--typep)
(eieio-perform-slot-validation, eieio-validate-slot-value)
(eieio-validate-class-slot-value, eieio-barf-if-slot-unbound)
(eieio-oref, eieio-oref-default, eieio-default-eval-maybe)
(eieio-oset, eieio-oset-default, eieio-slot-originating-class-p)
(eieio-slot-name-index, eieio-class-slot-name-index)
(eieio-set-defaults, eieio-initarg-to-attribute)
(eieio-attribute-to-initarg, eieio-c3-candidate)
(eieio-c3-merge-lists, eieio-class-precedence-c3)
(eieio-class-precedence-dfs, eieio-class-precedence-bfs)
(eieio-class-precedence-list, eieio-generic-call-methodname)
(eieio-generic-call-arglst, eieio-generic-call-key)
(eieio-generic-call-next-method-list)
(eieio-pre-method-execution-functions, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-method-list)
(eieiomt-optimizing-obarray, eieiomt-install)
(eieiomt-add, eieiomt-next, eieiomt-sym-optimize)
(eieio-generic-form, eieio-defmethod, make-obsolete)
(eieio-defgeneric, make-obsolete): Moved to eieio-core.el
(defclass): Remove `eval-and-compile' from macro.
(call-next-method, shared-initialize): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
(initialize-instance): Rename local variable 'scoped-class' to
'this-class' to remove ambiguitity from old global.
* emacs-lisp/eieio-core.el: New file. Derived from key parts of
eieio.el.
(eieio--scoped-class-stack): New variable
(eieio--scoped-class): New fcn
(eieio--with-scoped-class): New scoping macro.
(eieio-defclass): Use pushnew instead of add-to-list.
(eieio-defgeneric-form-primary-only-one, eieio-oset-default)
(eieio-slot-name-index, eieio-set-defaults, eieio-generic-call)
(eieio-generic-call-primary-only, eieiomt-add): Instead of using
`scoped-class' variable, use new eieio--scoped-class, and
eieio--with-scoped-class.
* emacs-lisp/eieio-base.el (cl-lib): Require during compile.
* admin/grammars:
* grammars/srecode-template.wy (variable): Accept a single number
as a variable value. Allows the 'priority' to be set to a number.
(wisent-srecode-template-lexer): Move number up so it can be
created.
* etc/srecode:
* srecode/c.srt (header_guard): Add :c parameter so it works
standalone
* lisp/cedet:
* semantic/edit.el (semantic-change-function): Use
`save-match-data' around running hooks.
* semantic/decorate/mode.el
(semantic-decorate-style-predicate-default)
(semantic-decorate-style-highlighter-default): New.
(semantic-decoration-mode): Do not require
`semantic/decorate/include' anymore.
(semantic-toggle-decoration-style): Error if an unknown decoration
style is toggled.
(define-semantic-decoration-style): Add new :load option. When
:load is specified, add autoload tokens for the definition
functions so that code is loaded when the mode is used.
(semantic-decoration-on-includes): New autoload definition for
highlighting includes.
* semantic/bovine/c.el (semantic-lex-c-ifdef): Allow some misc
characters to appear after the tested variable.
* semantic/ede-grammar.el (project-compile-target): Calculate full
src name via ede-expand-filename instead of the crutch of the
current buffer. Enables this target to compile in batch mode.
* semantic/idle.el
(semantic-idle-symbol-maybe-highlight): Wrap highlighting of
remote symbol with `save-excursion'.
(semantic-idle-scheduler-work-parse-neighboring-files): Instead of
using directory-files on each found mode pattern, collect all the
patterns for the current mode, and then for each file, see if it
matches any of them. If it does, parse the file. (Patch
inspiration from Tomasz Gajewski.)
* semantic/ctxt.el (semantic-ctxt-end-of-symbol): New.
(semantic-ctxt-current-symbol-default): New.
* semantic/bovine/el.el (semantic-default-elisp-setup): Add
autoload cookie. Explain existence.
(footer): Add local variable for loaddefs.
* semantic/db.el (semanticdb-file-table-object): Add new filter,
only checking for regular files too.
* semantic/wisent/python.el
(semantic-format-tag-abbreviate): New override. Cuts back on size
of code tags.
* srecode/compile.el (srecode-compile-templates): Fix warning
punctuation. Remove status messages to clean up testing output
* ede/base.el (ede-project-placeholder-cache-file): Update doc to
mention 'nil' value.
(ede-save-cache): Disable cache save if file is nil.
* ede.el (ede-initialize-state-current-buffer): Flush deleted
projects.
(global-ede-mode): Always append our find-file-hook to the end.
(ede-flush-deleted-projects): New command.
* ede/cpp-root.el (ede-preprocessor-map): Protect against init
problems.
* ede/proj.el (ede-proj-target): Added a new "custom" option for
custom symbols representing a compiler or linker instead of
restricting things to only the predefined compilers and linkers.
* semantic.el (semantic-mode-map): To avoid showing showing
Development menu twice, only disable menu item if menu-bar is
actually enabled, otherwise the popup 'global menu' might display
a disabled Development menu.
* semantic/complete.el
(semantic-displayor-show-request): Fix which slot in obj is set to
the max tags.
2013-06-02 13:33:09 +00:00
|
|
|
|
:enable (quote (not (and menu-bar-mode
|
|
|
|
|
(bound-and-true-p global-ede-mode))))))
|
2009-09-27 03:36:58 +00:00
|
|
|
|
;; (define-key km "-" 'senator-fold-tag)
|
|
|
|
|
;; (define-key km "+" 'senator-unfold-tag)
|
|
|
|
|
map))
|
|
|
|
|
|
2009-09-27 17:50:53 +00:00
|
|
|
|
;; Activate the Semantic items in cedet-menu-map
|
|
|
|
|
(let ((navigate-menu (make-sparse-keymap "Navigate Tags"))
|
|
|
|
|
(edit-menu (make-sparse-keymap "Edit Tags")))
|
|
|
|
|
|
|
|
|
|
;; Edit Tags submenu:
|
|
|
|
|
(define-key edit-menu [semantic-analyze-possible-completions]
|
|
|
|
|
'(menu-item "List Completions" semantic-analyze-possible-completions
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Display a list of completions for the tag at point"))
|
|
|
|
|
(define-key edit-menu [semantic-complete-analyze-inline]
|
|
|
|
|
'(menu-item "Complete Tag Inline" semantic-complete-analyze-inline
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Display inline completion for the tag at point"))
|
|
|
|
|
(define-key edit-menu [semantic-completion-separator]
|
|
|
|
|
'("--"))
|
|
|
|
|
(define-key edit-menu [senator-transpose-tags-down]
|
|
|
|
|
'(menu-item "Transpose Tags Down" senator-transpose-tags-down
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (and (semantic-active-p)
|
|
|
|
|
(semantic-current-tag))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Transpose the current tag and the next tag"))
|
|
|
|
|
(define-key edit-menu [senator-transpose-tags-up]
|
|
|
|
|
'(menu-item "Transpose Tags Up" senator-transpose-tags-up
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (and (semantic-active-p)
|
|
|
|
|
(semantic-current-tag))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Transpose the current tag and the previous tag"))
|
|
|
|
|
(define-key edit-menu [semantic-edit-separator]
|
|
|
|
|
'("--"))
|
|
|
|
|
(define-key edit-menu [senator-yank-tag]
|
|
|
|
|
'(menu-item "Yank Tag" senator-yank-tag
|
Merge with CEDET upstream (rev. 8499).
lisp/
* eieio/eieio-datadebug.el (data-debug/eieio-insert-slots):
Inhibit read only while inserting objects.
lisp/cedet/
* semantic.el (navigate-menu): Yank Tag :enable. Make sure
`senator-tag-ring' is bound.
(semantic-parse-region-default): Stop reversing the output of
parse-whole-stream.
(semantic-repeat-parse-whole-stream): Append returned tags
differently, so they come out in the right order.
* semantic/sb.el (semantic-sb-filter-tags-of-class): New option.
(semantic-sb-fetch-tag-table): Filter tags being bucketed to exclude
tags belonging to above filtered classes.
* semantic/find.el (semantic-filter-tags-by-class): New function.
* semantic/tag-ls.el (semantic-tag-similar-p-default): Add
short-circuit in case tag1 and 2 are identical.
* semantic/analyze/fcn.el
(semantic-analyze-dereference-metatype-stack): Use
`semantic-tag-similar-p' instead of 'eq' when comparing two tags
during metatype evaluation in case they are the same, but not the same
node. (Tweaked patch from Tomasz Gajewski) (Tiny change)
* semantic/db-find.el (semanticdb-partial-synchronize): Fix require to
semantic/db-typecache to be correct.
(semanticdb-find-tags-external-children-of-type): Make this a brutish
search by default.
* semantic/sort.el (semantic-tag-external-member-children-default):
When calling `semanticdb-find-tags-external-children-of-type', pass in
the input tag as the place to start searching for externally defined
methods.
* semantic/db-file.el (semanticdb-default-save-directory): Doc
fix: Add ref to default value.
* semantic/complete.el (semantic-complete-post-command-hook): When
detecting if cursor is outside completion area, do so if cursor moves
before start of overlay, or the original starting location of the
overlay (i.e., if user deletes past beginning of the overlay region).
(semantic-complete-inline-tag-engine): Initialize original start of
`semantic-complete-inline-overlay'.
* semantic/bovine/c.el (semantic-c-describe-environment): Update some
section titles. Test semanticdb table before printing it.
(semantic-c-reset-preprocessor-symbol-map): Update
`semantic-lex-spp-macro-symbol-obarray' outside the loop over all the
files contributing to its value.
(semantic-c-describe-environment): If there is an EDE project but no
spp symbols from it, say so.
* srecode/args.el (srecode-semantic-handle-:project): New argument
handler. Provide variable values if not in an EDE project.
* srecode/srt-mode.el (srecode-template-mode): Fix typo on srecode
name.
* srecode/cpp.el (srecode-semantic-handle-:c): Replace all characters
in FILENAME_SYMBOL that aren't valid CPP symbol chars.
* srecode/map.el (srecode-map-validate-file-for-mode): Force semantic
to load if it is not active in the template being added to the map.
* srecode/srt.el: Add local variables for setting the autoload file
name.
(srecode-semantic-handle-:srt): New autoload cookie
* ede.el (ede-apply-preprocessor-map): Apply map to
`semantic-lex-spp-project-macro-symbol-obarray' instead of the system
one. Add require for semantic.
* ede/proj-elisp.el (ede-update-version-in-source): In case a file has
both a version variable and a Version: comment, always use
`call-next-method'.
* ede/cpp-root.el (ede-set-project-variables): Deleted.
`ede-preprocessor-map' does the job this function was attempting to do
with :spp-table.
(ede-preprocessor-map): Update file tests to provide better messages.
Do not try to get symbols from a file that is the file in the current
buffer.
* ede/base.el (ede-project-placeholder): Add more documentation to
:file slot.
(ede-load-cache): Use `insert-file-contents' instead of
`find-file-noselect' in order to avoid activating other tools.
* semantic/bovine/c.el (semantic-get-local-variables): Also add a new
variable 'this' if we are in an inline member function. For detecting
this, we check overlays at point if there is a class spanning the
current function. Also, the variable 'this' has to be a pointer.
* semantic/bovine/gcc.el (semantic-gcc-setup): Fail gracefully when
querying g++ for defines returns an error.
* srecode/srt-mode.el:
* srecode/compile.el:
* semantic/elp.el:
* semantic/db-el.el:
* semantic/complete.el:
* ede.el:
* cogre.el:
* srecode/table.el:
* srecode/mode.el:
* srecode/insert.el:
* srecode/compile.el:
* semantic/decorate/include.el:
* semantic/db.el:
* semantic/adebug.el:
* ede/auto.el:
* srecode/dictionary.el:
* semantic/ede-grammar.el:
* semantic/db.el:
* semantic/db-find.el:
* semantic/db-file.el:
* semantic/complete.el:
* semantic/bovine/c.el:
* semantic/analyze.el:
* ede/util.el:
* ede/proj.el:
* ede/proj-elisp.el:
* ede/pconf.el:
* ede/locate.el:
* ede.el: Adapt to EIEIO namespace cleanup: Rename `object-name' to
`eieio-object-name', `object-set-name-string' to
`eieio-object-set-name-string', `object-class' to
`eieio-object-class', `class-parent' to `eieio-class-parent',
`class-parents' to `eieio-class-parents', `class-children' to
`eieio-class-children', `object-name-string' to
`eieio-object-name-string', `object-class-fast' to
`eieio--object-class'. Also replace direct access with new accessor
functions.
* ede/cpp-root.el (ede-project-autoload, initialize-instance): Fix EDE
file symbol to match rename. Fix ede-cpp-root symbol to include
-project in name.
* cedet-files.el (cedet-files-list-recursively): New function.
Recursively find files whose names are matching to given regex
* ede.el (ede-current-project): Rewrite to avoid imperative style.
* ede/files.el (ede-find-file): Simplify code.
* ede/base.el (ede-normalize-file/directory): Add function to
normalize :file or :directory slots if they are missing.
* ede/cpp-root.el (ede-cpp-root-project): Add compile-command slot.
(project-compile-project): Compiles project using value specified in
:compule-command slot or in compile-command local variable. Value of
slot or local variable could be string or function that receives
project and should return string that will be invoked as command.
(project-compile-target): Invokes compilation of whole project
* ede/files.el (ede-find-project-root): New function to find root of
project that contains specific file.
(ede-files-find-existing): New function which checks presence of given
directory in the list of registered projects.
etc/
* srecode/ede-autoconf.srt: Change Copyright to FSF.
(ede-empty): Change AC_INIT to use PROJECT_NAME, and PROJECT_VERSION.
* srecode/ede-make.srt (ede-empty): Add a dependency on :project. Add
header comment specifying the project's relative path.
* srecode/c.srt (header_guard): Upcase the filename symbol.
* srecode/java.srt (empty-main): New.
(class-tag): Decapitalize class.
2013-03-21 22:11:03 +00:00
|
|
|
|
:enable (and (boundp 'senator-tag-ring)
|
|
|
|
|
(not (ring-empty-p senator-tag-ring)))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Yank the head of the tag ring into the buffer"))
|
|
|
|
|
(define-key edit-menu [senator-copy-tag-to-register]
|
|
|
|
|
'(menu-item "Copy Tag To Register" senator-copy-tag-to-register
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (and (semantic-active-p)
|
|
|
|
|
(semantic-current-tag))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Yank the head of the tag ring into the buffer"))
|
|
|
|
|
(define-key edit-menu [senator-copy-tag]
|
|
|
|
|
'(menu-item "Copy Tag" senator-copy-tag
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (and (semantic-active-p)
|
|
|
|
|
(semantic-current-tag))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Copy the current tag to the tag ring"))
|
|
|
|
|
(define-key edit-menu [senator-kill-tag]
|
|
|
|
|
'(menu-item "Kill Tag" senator-kill-tag
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (and (semantic-active-p)
|
|
|
|
|
(semantic-current-tag))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Kill the current tag, and copy it to the tag ring"))
|
|
|
|
|
|
|
|
|
|
;; Navigate Tags submenu:
|
|
|
|
|
(define-key navigate-menu [senator-narrow-to-defun]
|
|
|
|
|
'(menu-item "Narrow to Tag" senator-narrow-to-defun
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (and (semantic-active-p)
|
|
|
|
|
(semantic-current-tag))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Narrow the buffer to the bounds of the current tag"))
|
|
|
|
|
(define-key navigate-menu [semantic-narrow-to-defun-separator]
|
|
|
|
|
'("--"))
|
|
|
|
|
(define-key navigate-menu [semantic-symref-symbol]
|
|
|
|
|
'(menu-item "Find Tag References..." semantic-symref-symbol
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Read a tag and list the references to it"))
|
|
|
|
|
(define-key navigate-menu [semantic-complete-jump]
|
|
|
|
|
'(menu-item "Find Tag Globally..." semantic-complete-jump
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Read a tag name and find it in the current project"))
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
(define-key navigate-menu [semantic-complete-jump-local-members]
|
|
|
|
|
'(menu-item "Find Local Members ..." semantic-complete-jump-local-members
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
:help "Read a tag name and find a local member with that name"))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key navigate-menu [semantic-complete-jump-local]
|
|
|
|
|
'(menu-item "Find Tag in This Buffer..." semantic-complete-jump-local
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Read a tag name and find it in this buffer"))
|
|
|
|
|
(define-key navigate-menu [semantic-navigation-separator]
|
|
|
|
|
'("--"))
|
|
|
|
|
(define-key navigate-menu [senator-go-to-up-reference]
|
|
|
|
|
'(menu-item "Parent Tag" senator-go-to-up-reference
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2011-11-20 03:48:53 +00:00
|
|
|
|
:help "Navigate up one reference by tag"))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key navigate-menu [senator-next-tag]
|
|
|
|
|
'(menu-item "Next Tag" senator-next-tag
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Go to the next tag"))
|
|
|
|
|
(define-key navigate-menu [senator-previous-tag]
|
|
|
|
|
'(menu-item "Previous Tag" senator-previous-tag
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:enable (semantic-active-p)
|
2009-09-27 17:50:53 +00:00
|
|
|
|
:help "Go to the previous tag"))
|
|
|
|
|
|
|
|
|
|
;; Top level menu items:
|
|
|
|
|
(define-key cedet-menu-map [semantic-force-refresh]
|
|
|
|
|
'(menu-item "Reparse Buffer" semantic-force-refresh
|
2011-11-20 03:48:53 +00:00
|
|
|
|
:help "Force a full reparse of the current buffer"
|
2012-10-14 19:20:28 +00:00
|
|
|
|
:visible semantic-mode
|
|
|
|
|
:enable (semantic-active-p)))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key cedet-menu-map [semantic-edit-menu]
|
2009-09-27 21:35:46 +00:00
|
|
|
|
`(menu-item "Edit Tags" ,edit-menu
|
|
|
|
|
:visible semantic-mode))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key cedet-menu-map [navigate-menu]
|
2009-09-27 21:35:46 +00:00
|
|
|
|
`(menu-item "Navigate Tags" ,navigate-menu
|
|
|
|
|
:visible semantic-mode))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key cedet-menu-map [semantic-options-separator]
|
|
|
|
|
'("--"))
|
|
|
|
|
(define-key cedet-menu-map [global-semantic-highlight-func-mode]
|
2009-09-27 21:35:46 +00:00
|
|
|
|
'(menu-item "Highlight Current Function" global-semantic-highlight-func-mode
|
|
|
|
|
:help "Highlight the tag at point"
|
|
|
|
|
:visible semantic-mode
|
|
|
|
|
:button (:toggle . global-semantic-highlight-func-mode)))
|
2012-10-01 18:10:29 +00:00
|
|
|
|
(define-key cedet-menu-map [global-semantic-stickyfunc-mode]
|
|
|
|
|
'(menu-item "Stick Top Tag to Headerline" global-semantic-stickyfunc-mode
|
|
|
|
|
:help "Stick the tag scrolled off the top of the buffer into the header line"
|
|
|
|
|
:visible semantic-mode
|
|
|
|
|
:button (:toggle . (bound-and-true-p
|
|
|
|
|
global-semantic-stickyfunc-mode))))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key cedet-menu-map [global-semantic-decoration-mode]
|
2009-09-27 21:35:46 +00:00
|
|
|
|
'(menu-item "Decorate Tags" global-semantic-decoration-mode
|
|
|
|
|
:help "Decorate tags based on tag attributes"
|
|
|
|
|
:visible semantic-mode
|
|
|
|
|
:button (:toggle . (bound-and-true-p
|
|
|
|
|
global-semantic-decoration-mode))))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key cedet-menu-map [global-semantic-idle-completions-mode]
|
2009-09-27 21:35:46 +00:00
|
|
|
|
'(menu-item "Show Tag Completions" global-semantic-idle-completions-mode
|
|
|
|
|
:help "Show tag completions when idle"
|
|
|
|
|
:visible semantic-mode
|
2009-11-20 01:35:49 +00:00
|
|
|
|
:enable global-semantic-idle-scheduler-mode
|
2009-09-27 21:35:46 +00:00
|
|
|
|
:button (:toggle . global-semantic-idle-completions-mode)))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key cedet-menu-map [global-semantic-idle-summary-mode]
|
2009-09-27 21:35:46 +00:00
|
|
|
|
'(menu-item "Show Tag Summaries" global-semantic-idle-summary-mode
|
|
|
|
|
:help "Show tag summaries when idle"
|
|
|
|
|
:visible semantic-mode
|
2009-11-20 01:35:49 +00:00
|
|
|
|
:enable global-semantic-idle-scheduler-mode
|
2009-09-27 21:35:46 +00:00
|
|
|
|
:button (:toggle . global-semantic-idle-summary-mode)))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
(define-key cedet-menu-map [global-semantic-idle-scheduler-mode]
|
2009-09-27 21:35:46 +00:00
|
|
|
|
'(menu-item "Reparse When Idle" global-semantic-idle-scheduler-mode
|
|
|
|
|
:help "Keep a buffer's parse tree up to date when idle"
|
|
|
|
|
:visible semantic-mode
|
2009-11-20 01:35:49 +00:00
|
|
|
|
:button (:toggle . global-semantic-idle-scheduler-mode)))
|
|
|
|
|
(define-key cedet-menu-map [global-semanticdb-minor-mode]
|
|
|
|
|
'(menu-item "Semantic Database" global-semanticdb-minor-mode
|
|
|
|
|
:help "Store tag information in a database"
|
|
|
|
|
:visible semantic-mode
|
|
|
|
|
:button (:toggle . global-semanticdb-minor-mode))))
|
2009-09-27 17:50:53 +00:00
|
|
|
|
|
2011-11-15 07:55:13 +00:00
|
|
|
|
;; The `semantic-mode' command, in conjunction with the
|
2009-09-27 17:50:53 +00:00
|
|
|
|
;; `semantic-default-submodes' variable, toggles Semantic's various
|
2010-01-17 02:25:53 +00:00
|
|
|
|
;; auxiliary minor modes.
|
2009-09-21 02:14:58 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-load-system-cache-loaded nil
|
2010-01-18 04:39:40 +00:00
|
|
|
|
"Non-nil when the Semantic system caches have been loaded.
|
2009-09-21 02:14:58 +00:00
|
|
|
|
Prevent this load system from loading files in twice.")
|
|
|
|
|
|
|
|
|
|
(defconst semantic-submode-list
|
|
|
|
|
'(global-semantic-highlight-func-mode
|
|
|
|
|
global-semantic-decoration-mode
|
|
|
|
|
global-semantic-stickyfunc-mode
|
|
|
|
|
global-semantic-idle-completions-mode
|
|
|
|
|
global-semantic-idle-scheduler-mode
|
|
|
|
|
global-semanticdb-minor-mode
|
|
|
|
|
global-semantic-idle-summary-mode
|
2012-10-01 18:10:29 +00:00
|
|
|
|
global-semantic-mru-bookmark-mode
|
|
|
|
|
global-cedet-m3-minor-mode
|
|
|
|
|
global-semantic-idle-local-symbol-highlight-mode
|
|
|
|
|
global-semantic-highlight-edits-mode
|
|
|
|
|
global-semantic-show-unmatched-syntax-mode
|
|
|
|
|
global-semantic-show-parser-state-mode)
|
2009-10-01 02:39:07 +00:00
|
|
|
|
"List of auxiliary minor modes in the Semantic package.")
|
2009-09-21 02:14:58 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(defcustom semantic-default-submodes
|
|
|
|
|
'(global-semantic-idle-scheduler-mode global-semanticdb-minor-mode)
|
2009-10-01 02:39:07 +00:00
|
|
|
|
"List of auxiliary Semantic minor modes enabled by `semantic-mode'.
|
2009-09-21 02:14:58 +00:00
|
|
|
|
The possible elements of this list include the following:
|
|
|
|
|
|
2009-11-20 01:35:49 +00:00
|
|
|
|
`global-semanticdb-minor-mode' - Maintain tag database.
|
|
|
|
|
`global-semantic-idle-scheduler-mode' - Reparse buffer when idle.
|
|
|
|
|
`global-semantic-idle-summary-mode' - Show summary of tag at point.
|
|
|
|
|
`global-semantic-idle-completions-mode' - Show completions when idle.
|
|
|
|
|
`global-semantic-decoration-mode' - Additional tag decorations.
|
|
|
|
|
`global-semantic-highlight-func-mode' - Highlight the current tag.
|
|
|
|
|
`global-semantic-stickyfunc-mode' - Show current fun in header line.
|
|
|
|
|
`global-semantic-mru-bookmark-mode' - Provide `switch-to-buffer'-like
|
2012-10-01 18:10:29 +00:00
|
|
|
|
keybinding for tag names.
|
|
|
|
|
`global-cedet-m3-minor-mode' - A mouse 3 context menu.
|
|
|
|
|
`global-semantic-idle-local-symbol-highlight-mode' - Highlight references
|
|
|
|
|
of the symbol under point.
|
|
|
|
|
The following modes are more targeted at people who want to see
|
|
|
|
|
some internal information of the semantic parser in action:
|
|
|
|
|
`global-semantic-highlight-edits-mode' - Visualize incremental parser by
|
|
|
|
|
highlighting not-yet parsed changes.
|
|
|
|
|
`global-semantic-show-unmatched-syntax-mode' - Highlight unmatched lexical
|
|
|
|
|
syntax tokens.
|
|
|
|
|
`global-semantic-show-parser-state-mode' - Display the parser cache state."
|
2009-09-21 02:14:58 +00:00
|
|
|
|
:group 'semantic
|
|
|
|
|
:type `(set ,@(mapcar (lambda (c) (list 'const c))
|
|
|
|
|
semantic-submode-list)))
|
|
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
|
(define-minor-mode semantic-mode
|
2011-10-20 00:26:14 +00:00
|
|
|
|
"Toggle parser features (Semantic mode).
|
|
|
|
|
With a prefix argument ARG, enable Semantic mode if ARG is
|
|
|
|
|
positive, and disable it otherwise. If called from Lisp, enable
|
|
|
|
|
Semantic mode if ARG is omitted or nil.
|
2009-09-21 02:14:58 +00:00
|
|
|
|
|
|
|
|
|
In Semantic mode, Emacs parses the buffers you visit for their
|
|
|
|
|
semantic content. This information is used by a variety of
|
2010-01-17 02:25:53 +00:00
|
|
|
|
auxiliary minor modes, listed in `semantic-default-submodes';
|
2009-09-21 02:14:58 +00:00
|
|
|
|
all the minor modes in this list are also enabled when you enable
|
2009-09-27 03:36:58 +00:00
|
|
|
|
Semantic mode.
|
|
|
|
|
|
|
|
|
|
\\{semantic-mode-map}"
|
|
|
|
|
:global t
|
2009-09-21 02:14:58 +00:00
|
|
|
|
:group 'semantic
|
|
|
|
|
(if semantic-mode
|
|
|
|
|
;; Turn on Semantic mode
|
|
|
|
|
(progn
|
2010-01-17 02:25:53 +00:00
|
|
|
|
;; Enable all the global auxiliary minor modes in
|
2009-09-27 03:36:58 +00:00
|
|
|
|
;; `semantic-submode-list'.
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(dolist (mode semantic-submode-list)
|
|
|
|
|
(if (memq mode semantic-default-submodes)
|
|
|
|
|
(funcall mode 1)))
|
|
|
|
|
(unless semantic-load-system-cache-loaded
|
|
|
|
|
(setq semantic-load-system-cache-loaded t)
|
|
|
|
|
(when (and (boundp 'semanticdb-default-system-save-directory)
|
|
|
|
|
(stringp semanticdb-default-system-save-directory)
|
|
|
|
|
(file-exists-p semanticdb-default-system-save-directory))
|
2009-09-21 19:05:56 +00:00
|
|
|
|
(require 'semantic/db-ebrowse)
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(semanticdb-load-ebrowse-caches)))
|
2009-10-04 19:25:26 +00:00
|
|
|
|
(add-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
;; Add semantic-ia-complete-symbol to
|
|
|
|
|
;; completion-at-point-functions, so that it is run from
|
|
|
|
|
;; M-TAB.
|
|
|
|
|
(add-hook 'completion-at-point-functions
|
|
|
|
|
'semantic-completion-at-point-function)
|
2009-10-31 18:03:02 +00:00
|
|
|
|
(if global-ede-mode
|
|
|
|
|
(define-key cedet-menu-map [cedet-menu-separator] '("--")))
|
2009-10-04 19:25:26 +00:00
|
|
|
|
(dolist (b (buffer-list))
|
|
|
|
|
(with-current-buffer b
|
|
|
|
|
(semantic-new-buffer-fcn))))
|
2012-10-01 18:10:29 +00:00
|
|
|
|
;; Disable Semantic features. Removing everything Semantic has
|
|
|
|
|
;; introduced in the buffer is pretty much futile, but we have to
|
|
|
|
|
;; clean the hooks and delete Semantic-related overlays, so that
|
|
|
|
|
;; Semantic can be re-activated cleanly.
|
2009-09-21 02:14:58 +00:00
|
|
|
|
(remove-hook 'mode-local-init-hook 'semantic-new-buffer-fcn)
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
(remove-hook 'completion-at-point-functions
|
|
|
|
|
'semantic-completion-at-point-function)
|
2012-10-01 18:10:29 +00:00
|
|
|
|
(remove-hook 'after-change-functions
|
|
|
|
|
'semantic-change-function)
|
2009-10-31 18:03:02 +00:00
|
|
|
|
(define-key cedet-menu-map [cedet-menu-separator] nil)
|
|
|
|
|
(define-key cedet-menu-map [semantic-options-separator] nil)
|
2009-09-21 02:14:58 +00:00
|
|
|
|
;; FIXME: handle semanticdb-load-ebrowse-caches
|
|
|
|
|
(dolist (mode semantic-submode-list)
|
|
|
|
|
(if (and (boundp mode) (eval mode))
|
2012-10-01 18:10:29 +00:00
|
|
|
|
(funcall mode -1)))
|
|
|
|
|
;; Unlink buffer and clear cache
|
|
|
|
|
(semantic--tag-unlink-cache-from-buffer)
|
|
|
|
|
(setq semantic--buffer-cache nil)
|
|
|
|
|
;; Make sure we run the setup function if Semantic gets
|
|
|
|
|
;; re-activated.
|
|
|
|
|
(setq semantic-new-buffer-fcn-was-run nil)))
|
2009-09-21 02:14:58 +00:00
|
|
|
|
|
Synch Semantic to CEDET 1.0.
Move CEDET ChangeLog entries to new file lisp/cedet/ChangeLog.
* semantic.el (semantic-version): Update to 2.0.
(semantic-mode-map): Add "," and "m" bindings.
(navigate-menu): Update.
* semantic/symref.el (semantic-symref-calculate-rootdir):
New function.
(semantic-symref-detect-symref-tool): Use it.
* semantic/symref/grep.el (semantic-symref-grep-shell): New var.
(semantic-symref-perform-search): Use it. Calculate root dir with
semantic-symref-calculate-rootdir.
(semantic-symref-derive-find-filepatterns): Improve error message.
* semantic/symref/list.el
(semantic-symref-results-mode-map): New bindings.
(semantic-symref-auto-expand-results): New option.
(semantic-symref-results-dump): Obey auto-expand.
(semantic-symref-list-expand-all, semantic-symref-regexp)
(semantic-symref-list-contract-all)
(semantic-symref-list-map-open-hits)
(semantic-symref-list-update-open-hits)
(semantic-symref-list-create-macro-on-open-hit)
(semantic-symref-list-call-macro-on-open-hits): New functions.
(semantic-symref-list-menu-entries)
(semantic-symref-list-menu): New vars.
(semantic-symref-list-map-open-hits): Move cursor to beginning of
match before calling the mapped function.
* semantic/doc.el
(semantic-documentation-comment-preceeding-tag): Do nothing if the
mode doesn't provide comment-start-skip.
* semantic/scope.el
(semantic-analyze-scope-nested-tags-default): Strip duplicates.
(semantic-analyze-scoped-inherited-tag-map): Take the tag we are
looking for as part of the scoped tags list.
* semantic/html.el (semantic-default-html-setup): Add
senator-step-at-tag-classes.
* semantic/decorate/include.el
(semantic-decoration-on-unknown-includes): Change light bgcolor.
(semantic-decoration-on-includes-highlight-default): Check that
the include tag has a postion.
* semantic/complete.el (semantic-collector-local-members):
(semantic-complete-read-tag-local-members)
(semantic-complete-jump-local-members): New class and functions.
(semantic-complete-self-insert): Save excursion before completing.
* semantic/analyze/complete.el
(semantic-analyze-possible-completions-default): If no completions
are found, return the raw by-name-only completion list. Add FLAGS
arguments. Add support for 'no-tc (type constraint) and
'no-unique, or no stripping duplicates.
(semantic-analyze-possible-completions-default): Add FLAGS arg.
* semantic/util-modes.el
(semantic-stickyfunc-show-only-functions-p): New option.
(semantic-stickyfunc-fetch-stickyline): Don't show stickytext for
the very first line in a buffer.
* semantic/util.el (semantic-hack-search)
(semantic-recursive-find-nonterminal-by-name)
(semantic-current-tag-interactive): Deleted.
(semantic-describe-buffer): Fix expand-nonterminal. Add
lex-syntax-mods, type relation separator char, and command
separation char.
(semantic-sanity-check): Only message if called interactively.
* semantic/tag.el (semantic-tag-deep-copy-one-tag): Copy the
:filename property and the tag position.
* semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
Add recursion limit.
* semantic/imenu.el (semantic-imenu-bucketize-type-members):
Make this buffer local, not the obsoleted variable.
* semantic/idle.el: Add breadcrumbs support.
(semantic-idle-summary-current-symbol-info-default)
(semantic-idle-tag-highlight)
(semantic-idle-completion-list-default): Use
semanticdb-without-unloaded-file-searches for speed, and to
conform to the controls that specify if the idle timer is supposed
to be parsing unparsed includes.
(semantic-idle-symbol-highlight-face)
(semantic-idle-symbol-maybe-highlight): Rename from *-summary-*.
Callers changed.
(semantic-idle-work-parse-neighboring-files-flag): Default to nil.
(semantic-idle-work-update-headers-flag): New var.
(semantic-idle-work-for-one-buffer): Use it.
(semantic-idle-local-symbol-highlight): Rename from
semantic-idle-tag-highlight.
(semantic-idle-truncate-long-summaries): New option.
* semantic/ia.el (semantic-ia-cache)
(semantic-ia-get-completions): Deleted. Callers changed.
(semantic-ia-show-variants): New command.
(semantic-ia-show-doc): If doc is empty, don't make a temp buffer.
(semantic-ia-show-summary): If there isn't anything to show, say so.
* semantic/grammar.el (semantic-grammar-create-package):
Save the buffer even in batch mode.
* semantic/fw.el
(semanticdb-without-unloaded-file-searches): New macro.
* semantic/dep.el (semantic-dependency-find-file-on-path):
Fix case dereferencing ede-object when it is a list.
* semantic/db-typecache.el (semanticdb-expand-nested-tag)
(semanticdb-typecache-faux-namespace): New functions.
(semanticdb-typecache-file-tags)
(semanticdb-typecache-merge-streams): Use them.
(semanticdb-typecache-file-tags): When deriving tags from a file,
give the mode a chance to monkey with the tag copy.
(semanticdb-typecache-find-default): Wrap find in save-excursion.
(semanticdb-typecache-find-by-name-helper): Merge found names down.
* semantic/db-global.el
(semanticdb-enable-gnu-global-in-buffer): Don't show messages if
GNU Global is not available and we don't want to throw an error.
* semantic/db-find.el (semanticdb-find-result-nth-in-buffer):
When trying to normalize the tag to a buffer, don't error if
set-buffer method doesn't exist.
* semantic/db-file.el (semanticdb-save-db): Simplify msg.
* semantic/db.el (semanticdb-refresh-table): If forcing a
refresh on a file not in a buffer, use semantic-find-file-noselect
and delete the buffer after use.
(semanticdb-current-database-list): When calculating root via
hooks, force it through true-filename and skip the list of
possible roots.
* semantic/ctxt.el (semantic-ctxt-imported-packages): New.
* semantic/analyze/debug.el
(semantic-analyzer-debug-insert-tag): Reset standard output to
current buffer.
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype): Change "prefix" to
"symbol" in messages.
* semantic/analyze/refs.el: (semantic-analyze-refs-impl)
(semantic-analyze-refs-proto): When calculating value, make sure
the found tag is 'similar' to the originating tag.
(semantic--analyze-refs-find-tags-with-parent): Attempt to
identify matches via imported symbols of parents.
(semantic--analyze-refs-full-lookup-with-parents): Do a deep
search during the brute search.
* semantic/analyze.el
(semantic-analyze-find-tag-sequence-default): Be robust to
calculated scopes being nil.
* semantic/bovine/c.el (semantic-c-describe-environment): Add
project macro symbol array.
(semantic-c-parse-lexical-token): Add recursion limit.
(semantic-ctxt-imported-packages, semanticdb-expand-nested-tag):
New overrides.
(semantic-expand-c-tag-namelist): Split a full type from a typedef
out to its own tag.
(semantic-expand-c-tag-namelist): Do not split out a typedef'd
inline type if it is an anonymous type.
(semantic-c-reconstitute-token): Use the optional initializers as
a clue that some function is probably a constructor. When
defining the type of these constructors, split the parent name,
and use only the class part, if applicable.
* semantic/bovine/c-by.el:
* semantic/wisent/python-wy.el: Regenerate.
2010-09-19 02:49:54 +00:00
|
|
|
|
(defun semantic-completion-at-point-function ()
|
|
|
|
|
'semantic-ia-complete-symbol)
|
|
|
|
|
|
2009-09-21 15:59:48 +00:00
|
|
|
|
;;; Autoload some functions that are not in semantic/loaddefs
|
|
|
|
|
|
|
|
|
|
(autoload 'global-semantic-idle-completions-mode "semantic/idle"
|
|
|
|
|
"Toggle global use of `semantic-idle-completions-mode'.
|
|
|
|
|
If ARG is positive, enable, if it is negative, disable.
|
|
|
|
|
If ARG is nil, then toggle." t nil)
|
|
|
|
|
|
|
|
|
|
(autoload 'semantic-idle-completions-mode "semantic/idle"
|
|
|
|
|
"Display a list of possible completions in a tooltip.
|
|
|
|
|
|
|
|
|
|
This is a minor mode which performs actions during idle time.
|
|
|
|
|
With prefix argument ARG, turn on if positive, otherwise off. The
|
|
|
|
|
minor mode can be turned on only if semantic feature is available and
|
|
|
|
|
the current buffer was set up for parsing. Return non-nil if the
|
|
|
|
|
minor mode is enabled." t nil)
|
|
|
|
|
|
|
|
|
|
(autoload 'global-semantic-idle-summary-mode "semantic/idle"
|
|
|
|
|
"Toggle global use of `semantic-idle-summary-mode'.
|
|
|
|
|
If ARG is positive, enable, if it is negative, disable.
|
|
|
|
|
If ARG is nil, then toggle." t nil)
|
|
|
|
|
|
|
|
|
|
(autoload 'semantic-idle-summary-mode "semantic/idle"
|
|
|
|
|
"Display a tag summary of the lexical token under the cursor.
|
|
|
|
|
Call `semantic-idle-summary-current-symbol-info' for getting the
|
|
|
|
|
current tag to display information.
|
|
|
|
|
|
|
|
|
|
This is a minor mode which performs actions during idle time.
|
|
|
|
|
With prefix argument ARG, turn on if positive, otherwise off. The
|
|
|
|
|
minor mode can be turned on only if semantic feature is available and
|
|
|
|
|
the current buffer was set up for parsing. Return non-nil if the
|
|
|
|
|
minor mode is enabled." t nil)
|
2009-09-21 02:14:58 +00:00
|
|
|
|
|
2012-10-01 18:10:29 +00:00
|
|
|
|
(autoload 'global-semantic-idle-local-symbol-highlight-mode "semantic/idle"
|
|
|
|
|
"Highlight the tag and symbol references of the symbol under point.
|
|
|
|
|
Call `semantic-analyze-current-context' to find the reference tag.
|
|
|
|
|
Call `semantic-symref-hits-in-region' to identify local references." t nil)
|
|
|
|
|
|
2009-10-03 19:28:05 +00:00
|
|
|
|
(autoload 'srecode-template-setup-parser "srecode/srecode-template"
|
|
|
|
|
"Set up buffer for parsing SRecode template files." t nil)
|
|
|
|
|
|
2009-08-23 03:46:01 +00:00
|
|
|
|
(provide 'semantic)
|
|
|
|
|
|
|
|
|
|
;; Semantic-util is a part of the semantic API. Include it last
|
|
|
|
|
;; because it depends on semantic.
|
2009-08-28 15:01:48 +00:00
|
|
|
|
(require 'semantic/util)
|
2009-09-06 21:22:05 +00:00
|
|
|
|
|
2009-09-21 02:14:58 +00:00
|
|
|
|
;; (require 'semantic/load)
|
|
|
|
|
|
2009-09-06 21:22:05 +00:00
|
|
|
|
;;; semantic.el ends here
|