2009-08-29 19:00:35 +00:00
|
|
|
|
;;; idle.el --- Schedule parsing tasks in idle time
|
|
|
|
|
|
2013-01-01 09:11:05 +00:00
|
|
|
|
;; Copyright (C) 2003-2006, 2008-2013 Free Software Foundation, Inc.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;; Author: Eric M. Ludlam <zappo@gnu.org>
|
|
|
|
|
;; Keywords: syntax
|
|
|
|
|
|
|
|
|
|
;; 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:
|
|
|
|
|
;;
|
|
|
|
|
;; Originally, `semantic-auto-parse-mode' handled refreshing the
|
|
|
|
|
;; tags in a buffer in idle time. Other activities can be scheduled
|
|
|
|
|
;; in idle time, all of which require up-to-date tag tables.
|
|
|
|
|
;; Having a specialized idle time scheduler that first refreshes
|
|
|
|
|
;; the tags buffer, and then enables other idle time tasks reduces
|
|
|
|
|
;; the amount of work needed. Any specialized idle tasks need not
|
|
|
|
|
;; ask for a fresh tags list.
|
|
|
|
|
;;
|
|
|
|
|
;; NOTE ON SEMANTIC_ANALYZE
|
|
|
|
|
;;
|
|
|
|
|
;; Some of the idle modes use the semantic analyzer. The analyzer
|
|
|
|
|
;; automatically caches the created context, so it is shared amongst
|
|
|
|
|
;; all idle modes that will need it.
|
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
(require 'semantic)
|
|
|
|
|
(require 'semantic/ctxt)
|
2009-09-05 01:00:36 +00:00
|
|
|
|
(require 'semantic/format)
|
2009-09-02 04:37:10 +00:00
|
|
|
|
(require 'semantic/tag)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(require 'timer)
|
2012-10-02 02:10:29 +08:00
|
|
|
|
;;(require 'working)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2009-09-02 04:37:10 +00:00
|
|
|
|
;; For the semantic-find-tags-by-name macro.
|
|
|
|
|
(eval-when-compile (require 'semantic/find))
|
|
|
|
|
|
2009-11-15 15:37:17 +00:00
|
|
|
|
(defvar eldoc-last-message)
|
2009-09-02 04:37:10 +00:00
|
|
|
|
(declare-function eldoc-message "eldoc")
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(declare-function semantic-analyze-interesting-tag "semantic/analyze")
|
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-18 22:49:54 -04:00
|
|
|
|
(declare-function semantic-analyze-unsplit-name "semantic/analyze/fcn")
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(declare-function semantic-complete-analyze-inline-idle "semantic/complete")
|
|
|
|
|
(declare-function semanticdb-deep-find-tags-by-name "semantic/db-find")
|
|
|
|
|
(declare-function semanticdb-save-all-db-idle "semantic/db")
|
|
|
|
|
(declare-function semanticdb-typecache-refresh-for-buffer "semantic/db-typecache")
|
|
|
|
|
(declare-function semantic-decorate-flush-pending-decorations
|
|
|
|
|
"semantic/decorate/mode")
|
|
|
|
|
(declare-function pulse-momentary-highlight-region "pulse")
|
|
|
|
|
(declare-function pulse-momentary-highlight-overlay "pulse")
|
2009-09-05 21:09:25 +00:00
|
|
|
|
(declare-function semantic-symref-hits-in-region "semantic/symref/filter")
|
2009-09-02 04:37:10 +00:00
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
|
|
;;; TIMER RELATED FUNCTIONS
|
|
|
|
|
;;
|
|
|
|
|
(defvar semantic-idle-scheduler-timer nil
|
|
|
|
|
"Timer used to schedule tasks in idle time.")
|
|
|
|
|
|
|
|
|
|
(defvar semantic-idle-scheduler-work-timer nil
|
|
|
|
|
"Timer used to schedule tasks in idle time that may take a while.")
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-scheduler-verbose-flag nil
|
2009-09-27 03:36:58 +00:00
|
|
|
|
"Non-nil means that the idle scheduler should provide debug messages.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
Use this setting to debug idle activities."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
2009-09-27 03:36:58 +00:00
|
|
|
|
(defcustom semantic-idle-scheduler-idle-time 1
|
|
|
|
|
"Time in seconds of idle before scheduling events.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
This time should be short enough to ensure that idle-scheduler will be
|
|
|
|
|
run as soon as Emacs is idle."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'number
|
|
|
|
|
:set (lambda (sym val)
|
|
|
|
|
(set-default sym val)
|
|
|
|
|
(when (timerp semantic-idle-scheduler-timer)
|
|
|
|
|
(cancel-timer semantic-idle-scheduler-timer)
|
|
|
|
|
(setq semantic-idle-scheduler-timer nil)
|
|
|
|
|
(semantic-idle-scheduler-setup-timers))))
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-scheduler-work-idle-time 60
|
2009-09-27 03:36:58 +00:00
|
|
|
|
"Time in seconds of idle before scheduling big work.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
This time should be long enough that once any big work is started, it is
|
|
|
|
|
unlikely the user would be ready to type again right away."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'number
|
|
|
|
|
:set (lambda (sym val)
|
|
|
|
|
(set-default sym val)
|
|
|
|
|
(when (timerp semantic-idle-scheduler-timer)
|
|
|
|
|
(cancel-timer semantic-idle-scheduler-timer)
|
|
|
|
|
(setq semantic-idle-scheduler-timer nil)
|
|
|
|
|
(semantic-idle-scheduler-setup-timers))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-scheduler-setup-timers ()
|
|
|
|
|
"Lazy initialization of the auto parse idle timer."
|
|
|
|
|
;; REFRESH THIS FUNCTION for XEMACS FOIBLES
|
|
|
|
|
(or (timerp semantic-idle-scheduler-timer)
|
|
|
|
|
(setq semantic-idle-scheduler-timer
|
|
|
|
|
(run-with-idle-timer
|
|
|
|
|
semantic-idle-scheduler-idle-time t
|
|
|
|
|
#'semantic-idle-scheduler-function)))
|
|
|
|
|
(or (timerp semantic-idle-scheduler-work-timer)
|
|
|
|
|
(setq semantic-idle-scheduler-work-timer
|
|
|
|
|
(run-with-idle-timer
|
|
|
|
|
semantic-idle-scheduler-work-idle-time t
|
|
|
|
|
#'semantic-idle-scheduler-work-function)))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-scheduler-kill-timer ()
|
|
|
|
|
"Kill the auto parse idle timer."
|
|
|
|
|
(if (timerp semantic-idle-scheduler-timer)
|
|
|
|
|
(cancel-timer semantic-idle-scheduler-timer))
|
|
|
|
|
(setq semantic-idle-scheduler-timer nil))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; MINOR MODE
|
|
|
|
|
;;
|
|
|
|
|
;; The minor mode portion of this code just sets up the minor mode
|
|
|
|
|
;; which does the initial scheduling of the idle timers.
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-scheduler-mode-hook nil
|
2009-11-20 01:35:49 +00:00
|
|
|
|
"Hook run at the end of the function `semantic-idle-scheduler-mode'."
|
2009-08-29 19:00:35 +00:00
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'hook)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-idle-scheduler-mode nil
|
|
|
|
|
"Non-nil if idle-scheduler minor mode is enabled.
|
|
|
|
|
Use the command `semantic-idle-scheduler-mode' to change this variable.")
|
|
|
|
|
(make-variable-buffer-local 'semantic-idle-scheduler-mode)
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-scheduler-max-buffer-size 0
|
|
|
|
|
"*Maximum size in bytes of buffers where idle-scheduler is enabled.
|
|
|
|
|
If this value is less than or equal to 0, idle-scheduler is enabled in
|
|
|
|
|
all buffers regardless of their size."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'number)
|
|
|
|
|
|
|
|
|
|
(defsubst semantic-idle-scheduler-enabled-p ()
|
|
|
|
|
"Return non-nil if idle-scheduler is enabled for this buffer.
|
|
|
|
|
idle-scheduler is disabled when debugging or if the buffer size
|
|
|
|
|
exceeds the `semantic-idle-scheduler-max-buffer-size' threshold."
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(let* ((remote-file? (when (stringp buffer-file-name) (file-remote-p buffer-file-name))))
|
|
|
|
|
(and semantic-idle-scheduler-mode
|
|
|
|
|
(not (and (boundp 'semantic-debug-enabled)
|
|
|
|
|
semantic-debug-enabled))
|
|
|
|
|
(not semantic-lex-debug)
|
|
|
|
|
;; local file should exist on disk
|
|
|
|
|
;; remote file should have active connection
|
|
|
|
|
(or (and (null remote-file?) (stringp buffer-file-name)
|
|
|
|
|
(file-exists-p buffer-file-name))
|
|
|
|
|
(and remote-file? (file-remote-p buffer-file-name nil t)))
|
|
|
|
|
(or (<= semantic-idle-scheduler-max-buffer-size 0)
|
|
|
|
|
(< (buffer-size) semantic-idle-scheduler-max-buffer-size)))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2009-09-05 23:25:26 +00:00
|
|
|
|
;;;###autoload
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(define-minor-mode semantic-idle-scheduler-mode
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"Minor mode to auto parse buffer following a change.
|
|
|
|
|
When this mode is off, a buffer is only rescanned for tokens when
|
|
|
|
|
some command requests the list of available tokens. When idle-scheduler
|
|
|
|
|
is enabled, Emacs periodically checks to see if the buffer is out of
|
|
|
|
|
date, and reparses while the user is idle (not typing.)
|
|
|
|
|
|
|
|
|
|
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."
|
2010-05-01 23:38:19 -04:00
|
|
|
|
nil nil nil
|
|
|
|
|
(if semantic-idle-scheduler-mode
|
|
|
|
|
(if (not (and (featurep 'semantic) (semantic-active-p)))
|
|
|
|
|
(progn
|
|
|
|
|
;; Disable minor mode if semantic stuff not available
|
|
|
|
|
(setq semantic-idle-scheduler-mode nil)
|
|
|
|
|
(error "Buffer %s was not set up idle time scheduling"
|
|
|
|
|
(buffer-name)))
|
2010-05-02 01:06:53 -04:00
|
|
|
|
(semantic-idle-scheduler-setup-timers))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(semantic-add-minor-mode 'semantic-idle-scheduler-mode
|
2010-05-01 23:38:19 -04:00
|
|
|
|
"ARP")
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;;; SERVICES services
|
|
|
|
|
;;
|
|
|
|
|
;; These are services for managing idle services.
|
|
|
|
|
;;
|
|
|
|
|
(defvar semantic-idle-scheduler-queue nil
|
|
|
|
|
"List of functions to execute during idle time.
|
|
|
|
|
These functions will be called in the current buffer after that
|
|
|
|
|
buffer has had its tags made up to date. These functions
|
|
|
|
|
will not be called if there are errors parsing the
|
|
|
|
|
current buffer.")
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-scheduler-add (function)
|
|
|
|
|
"Schedule FUNCTION to occur during idle time."
|
|
|
|
|
(add-to-list 'semantic-idle-scheduler-queue function))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-scheduler-remove (function)
|
|
|
|
|
"Unschedule FUNCTION to occur during idle time."
|
|
|
|
|
(setq semantic-idle-scheduler-queue
|
|
|
|
|
(delete function semantic-idle-scheduler-queue)))
|
|
|
|
|
|
|
|
|
|
;;; IDLE Function
|
|
|
|
|
;;
|
|
|
|
|
(defun semantic-idle-core-handler ()
|
|
|
|
|
"Core idle function that handles reparsing.
|
|
|
|
|
And also manages services that depend on tag values."
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
|
|
|
|
(message "IDLE: Core handler..."))
|
|
|
|
|
(semantic-exit-on-input 'idle-timer
|
|
|
|
|
(let* ((inhibit-quit nil)
|
|
|
|
|
(buffers (delq (current-buffer)
|
|
|
|
|
(delq nil
|
|
|
|
|
(mapcar #'(lambda (b)
|
|
|
|
|
(and (buffer-file-name b)
|
|
|
|
|
b))
|
|
|
|
|
(buffer-list)))))
|
|
|
|
|
safe ;; This safe is not used, but could be.
|
|
|
|
|
others
|
|
|
|
|
mode)
|
|
|
|
|
(when (semantic-idle-scheduler-enabled-p)
|
|
|
|
|
(save-excursion
|
|
|
|
|
;; First, reparse the current buffer.
|
|
|
|
|
(setq mode major-mode
|
|
|
|
|
safe (semantic-safe "Idle Parse Error: %S"
|
|
|
|
|
;(error "Goofy error 1")
|
|
|
|
|
(semantic-idle-scheduler-refresh-tags)
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
;; Now loop over other buffers with same major mode, trying to
|
|
|
|
|
;; update them as well. Stop on keypress.
|
|
|
|
|
(dolist (b buffers)
|
|
|
|
|
(semantic-throw-on-input 'parsing-mode-buffers)
|
|
|
|
|
(with-current-buffer b
|
|
|
|
|
(if (eq major-mode mode)
|
|
|
|
|
(and (semantic-idle-scheduler-enabled-p)
|
|
|
|
|
(semantic-safe "Idle Parse Error: %S"
|
|
|
|
|
;(error "Goofy error")
|
|
|
|
|
(semantic-idle-scheduler-refresh-tags)))
|
|
|
|
|
(push (current-buffer) others))))
|
|
|
|
|
(setq buffers others))
|
|
|
|
|
;; If re-parse of current buffer completed, evaluate all other
|
|
|
|
|
;; services. Stop on keypress.
|
|
|
|
|
|
|
|
|
|
;; NOTE ON COMMENTED SAFE HERE
|
2011-11-20 04:48:53 +01:00
|
|
|
|
;; We used to not execute the services if the buffer was
|
2011-12-14 13:05:20 -08:00
|
|
|
|
;; unparsable. We now assume that they are lexically
|
|
|
|
|
;; safe to do, because we have marked the buffer unparsable
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; if there was a problem.
|
|
|
|
|
;;(when safe
|
|
|
|
|
(dolist (service semantic-idle-scheduler-queue)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(semantic-throw-on-input 'idle-queue)
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
2011-11-20 04:48:53 +01:00
|
|
|
|
(message "IDLE: execute service %s..." service))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(semantic-safe (format "Idle Service Error %s: %%S" service)
|
|
|
|
|
(funcall service))
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
2011-11-20 04:48:53 +01:00
|
|
|
|
(message "IDLE: execute service %s...done" service))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
)))
|
|
|
|
|
;;)
|
|
|
|
|
;; Finally loop over remaining buffers, trying to update them as
|
|
|
|
|
;; well. Stop on keypress.
|
|
|
|
|
(save-excursion
|
|
|
|
|
(dolist (b buffers)
|
|
|
|
|
(semantic-throw-on-input 'parsing-other-buffers)
|
|
|
|
|
(with-current-buffer b
|
|
|
|
|
(and (semantic-idle-scheduler-enabled-p)
|
|
|
|
|
(semantic-idle-scheduler-refresh-tags)))))
|
|
|
|
|
))
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
|
|
|
|
(message "IDLE: Core handler...done")))
|
|
|
|
|
|
|
|
|
|
(defun semantic-debug-idle-function ()
|
|
|
|
|
"Run the Semantic idle function with debugging turned on."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((debug-on-error t))
|
|
|
|
|
(semantic-idle-core-handler)
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-scheduler-function ()
|
|
|
|
|
"Function run when after `semantic-idle-scheduler-idle-time'.
|
|
|
|
|
This function will reparse the current buffer, and if successful,
|
|
|
|
|
call additional functions registered with the timer calls."
|
|
|
|
|
(when (zerop (recursion-depth))
|
|
|
|
|
(let ((debug-on-error nil))
|
|
|
|
|
(save-match-data (semantic-idle-core-handler))
|
|
|
|
|
)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; WORK FUNCTION
|
|
|
|
|
;;
|
|
|
|
|
;; Unlike the shorter timer, the WORK timer will kick of tasks that
|
|
|
|
|
;; may take a long time to complete.
|
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-18 22:49:54 -04:00
|
|
|
|
(defcustom semantic-idle-work-parse-neighboring-files-flag nil
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"*Non-nil means to parse files in the same dir as the current buffer.
|
|
|
|
|
Disable to prevent lots of excessive parsing in idle time."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
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-18 22:49:54 -04:00
|
|
|
|
(defcustom semantic-idle-work-update-headers-flag nil
|
|
|
|
|
"*Non-nil means to parse through header files in idle time.
|
|
|
|
|
Disable to prevent idle time parsing of many files. If completion
|
|
|
|
|
is called that work will be done then instead."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'boolean)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(defun semantic-idle-work-for-one-buffer (buffer)
|
2010-01-15 18:51:50 -08:00
|
|
|
|
"Do long-processing work for BUFFER.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
Uses `semantic-safe' and returns the output.
|
2010-01-16 18:54:35 -08:00
|
|
|
|
Returns t if all processing succeeded."
|
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
2009-10-30 02:16:41 +00:00
|
|
|
|
(with-current-buffer buffer
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(not (and
|
|
|
|
|
;; Just in case
|
|
|
|
|
(semantic-safe "Idle Work Parse Error: %S"
|
|
|
|
|
(semantic-idle-scheduler-refresh-tags)
|
|
|
|
|
t)
|
|
|
|
|
|
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-18 22:49:54 -04:00
|
|
|
|
;; Option to disable this work.
|
|
|
|
|
semantic-idle-work-update-headers-flag
|
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Force all our include files to get read in so we
|
|
|
|
|
;; are ready to provide good smart completion and idle
|
|
|
|
|
;; summary information
|
|
|
|
|
(semantic-safe "Idle Work Including Error: %S"
|
|
|
|
|
;; Get the include related path.
|
2009-09-05 01:00:36 +00:00
|
|
|
|
(when (and (featurep 'semantic/db) (semanticdb-minor-mode-p))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(require 'semantic/db-find)
|
|
|
|
|
(semanticdb-find-translate-path buffer nil)
|
|
|
|
|
)
|
|
|
|
|
t)
|
|
|
|
|
|
|
|
|
|
;; Pre-build the typecaches as needed.
|
|
|
|
|
(semantic-safe "Idle Work Typecaching Error: %S"
|
|
|
|
|
(when (featurep 'semantic/db-typecache)
|
|
|
|
|
(semanticdb-typecache-refresh-for-buffer buffer))
|
|
|
|
|
t)
|
|
|
|
|
))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-work-core-handler ()
|
|
|
|
|
"Core handler for idle work processing of long running tasks.
|
2010-01-18 05:39:40 +01:00
|
|
|
|
Visits Semantic controlled buffers, and makes sure all needed
|
2009-08-29 19:00:35 +00:00
|
|
|
|
include files have been parsed, and that the typecache is up to date.
|
|
|
|
|
Uses `semantic-idle-work-for-on-buffer' to do the work."
|
|
|
|
|
(let ((errbuf nil)
|
|
|
|
|
(interrupted
|
|
|
|
|
(semantic-exit-on-input 'idle-work-timer
|
|
|
|
|
(let* ((inhibit-quit nil)
|
|
|
|
|
(cb (current-buffer))
|
|
|
|
|
(buffers (delq (current-buffer)
|
|
|
|
|
(delq nil
|
|
|
|
|
(mapcar #'(lambda (b)
|
|
|
|
|
(and (buffer-file-name b)
|
|
|
|
|
b))
|
|
|
|
|
(buffer-list)))))
|
|
|
|
|
safe errbuf)
|
|
|
|
|
;; First, handle long tasks in the current buffer.
|
|
|
|
|
(when (semantic-idle-scheduler-enabled-p)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(setq safe (semantic-idle-work-for-one-buffer (current-buffer))
|
|
|
|
|
)))
|
|
|
|
|
(when (not safe) (push (current-buffer) errbuf))
|
|
|
|
|
|
|
|
|
|
;; Now loop over other buffers with same major mode, trying to
|
|
|
|
|
;; update them as well. Stop on keypress.
|
|
|
|
|
(dolist (b buffers)
|
|
|
|
|
(semantic-throw-on-input 'parsing-mode-buffers)
|
|
|
|
|
(with-current-buffer b
|
|
|
|
|
(when (semantic-idle-scheduler-enabled-p)
|
|
|
|
|
(and (semantic-idle-scheduler-enabled-p)
|
|
|
|
|
(unless (semantic-idle-work-for-one-buffer (current-buffer))
|
|
|
|
|
(push (current-buffer) errbuf)))
|
|
|
|
|
))
|
|
|
|
|
)
|
|
|
|
|
|
2009-09-05 01:00:36 +00:00
|
|
|
|
(when (and (featurep 'semantic/db) (semanticdb-minor-mode-p))
|
2009-09-03 03:58:13 +00:00
|
|
|
|
;; Save everything.
|
|
|
|
|
(semanticdb-save-all-db-idle)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2009-09-03 03:58:13 +00:00
|
|
|
|
;; Parse up files near our active buffer
|
|
|
|
|
(when semantic-idle-work-parse-neighboring-files-flag
|
|
|
|
|
(semantic-safe "Idle Work Parse Neighboring Files: %S"
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(set-buffer cb)
|
|
|
|
|
(semantic-idle-scheduler-work-parse-neighboring-files))
|
|
|
|
|
t)
|
|
|
|
|
|
2009-09-03 03:58:13 +00:00
|
|
|
|
;; Save everything... again
|
|
|
|
|
(semanticdb-save-all-db-idle)
|
|
|
|
|
)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;; Done w/ processing
|
|
|
|
|
nil))))
|
|
|
|
|
|
|
|
|
|
;; Done
|
|
|
|
|
(if interrupted
|
|
|
|
|
"Interrupted"
|
|
|
|
|
(cond ((not errbuf)
|
|
|
|
|
"done")
|
|
|
|
|
((not (cdr errbuf))
|
|
|
|
|
(format "done with 1 error in %s" (car errbuf)))
|
|
|
|
|
(t
|
|
|
|
|
(format "done with errors in %d buffers."
|
|
|
|
|
(length errbuf)))))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-debug-idle-work-function ()
|
|
|
|
|
"Run the Semantic idle work function with debugging turned on."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((debug-on-error t))
|
|
|
|
|
(semantic-idle-work-core-handler)
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-scheduler-work-function ()
|
|
|
|
|
"Function run when after `semantic-idle-scheduler-work-idle-time'.
|
|
|
|
|
This routine handles difficult tasks that require a lot of parsing, such as
|
|
|
|
|
parsing all the header files used by our active sources, or building up complex
|
|
|
|
|
datasets."
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
|
|
|
|
(message "Long Work Idle Timer..."))
|
|
|
|
|
(let ((exit-type (save-match-data
|
|
|
|
|
(semantic-idle-work-core-handler))))
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
|
|
|
|
(message "Long Work Idle Timer...%s" exit-type)))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-scheduler-work-parse-neighboring-files ()
|
|
|
|
|
"Parse all the files in similar directories to buffers being edited."
|
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 15:33:09 +02:00
|
|
|
|
;; Let's tell EDE to ignore all the files we're about to load
|
|
|
|
|
(let ((ede-auto-add-method 'never)
|
|
|
|
|
(matching-auto-mode-patterns nil))
|
|
|
|
|
;; Collect all patterns matching files of the same mode we edit.
|
|
|
|
|
(mapc (lambda (pat) (and (eq (cdr pat) major-mode)
|
|
|
|
|
(push (car pat) matching-auto-mode-patterns)))
|
|
|
|
|
auto-mode-alist)
|
|
|
|
|
;; Loop over all files, and if one matches our mode, we force its
|
|
|
|
|
;; table to load.
|
|
|
|
|
(dolist (file (directory-files default-directory t ".*" t))
|
|
|
|
|
(catch 'found
|
|
|
|
|
(mapc (lambda (pat)
|
|
|
|
|
(semantic-throw-on-input 'parsing-mode-buffers)
|
|
|
|
|
;; We use string-match instead of passing the pattern
|
|
|
|
|
;; into directory files, because some patterns don't
|
|
|
|
|
;; work with directory files.
|
|
|
|
|
(and (string-match pat file)
|
|
|
|
|
(save-excursion
|
|
|
|
|
(semanticdb-file-table-object file))
|
|
|
|
|
(throw 'found t)))
|
|
|
|
|
matching-auto-mode-patterns)))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; REPARSING
|
|
|
|
|
;;
|
|
|
|
|
;; Reparsing is installed as semantic idle service.
|
|
|
|
|
;; This part ALWAYS happens, and other services occur
|
|
|
|
|
;; afterwards.
|
|
|
|
|
|
2009-09-26 17:47:11 +00:00
|
|
|
|
(defvar semantic-before-idle-scheduler-reparse-hook nil
|
2009-09-26 18:03:54 +00:00
|
|
|
|
"Hook run before option `semantic-idle-scheduler' begins parsing.
|
2009-09-26 17:47:11 +00:00
|
|
|
|
If any hook function throws an error, this variable is reset to nil.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
This hook is not protected from lexical errors.")
|
|
|
|
|
|
2009-09-26 17:47:11 +00:00
|
|
|
|
(defvar semantic-after-idle-scheduler-reparse-hook nil
|
2009-09-26 18:03:54 +00:00
|
|
|
|
"Hook run after option `semantic-idle-scheduler' has parsed.
|
2009-09-26 17:47:11 +00:00
|
|
|
|
If any hook function throws an error, this variable is reset to nil.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
This hook is not protected from lexical errors.")
|
|
|
|
|
|
2009-09-26 18:03:54 +00:00
|
|
|
|
(semantic-varalias-obsolete 'semantic-before-idle-scheduler-reparse-hooks
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic-before-idle-scheduler-reparse-hook "23.2")
|
2009-09-26 18:03:54 +00:00
|
|
|
|
(semantic-varalias-obsolete 'semantic-after-idle-scheduler-reparse-hooks
|
2009-10-25 02:55:27 +00:00
|
|
|
|
'semantic-after-idle-scheduler-reparse-hook "23.2")
|
2009-09-26 17:47:11 +00:00
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(defun semantic-idle-scheduler-refresh-tags ()
|
|
|
|
|
"Refreshes the current buffer's tags.
|
|
|
|
|
This is called by `semantic-idle-scheduler-function' to update the
|
|
|
|
|
tags in the current buffer.
|
|
|
|
|
|
|
|
|
|
Return non-nil if the refresh was successful.
|
|
|
|
|
Return nil if there is some sort of syntax error preventing a full
|
|
|
|
|
reparse.
|
|
|
|
|
|
|
|
|
|
Does nothing if the current buffer doesn't need reparsing."
|
|
|
|
|
|
|
|
|
|
(prog1
|
|
|
|
|
;; 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
|
2011-12-14 13:05:20 -08:00
|
|
|
|
;; If the buffer was previously marked unparsable,
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; 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
|
|
|
|
|
;; If the buffer might need a reparse and it is safe to do so,
|
|
|
|
|
;; give it a try.
|
|
|
|
|
(let* (;(semantic-working-type nil)
|
|
|
|
|
(inhibit-quit nil)
|
|
|
|
|
;; (working-use-echo-area-p
|
|
|
|
|
;; (not semantic-idle-scheduler-working-in-modeline-flag))
|
|
|
|
|
;; (working-status-dynamic-type
|
|
|
|
|
;; (if semantic-idle-scheduler-no-working-message
|
|
|
|
|
;; nil
|
|
|
|
|
;; working-status-dynamic-type))
|
|
|
|
|
;; (working-status-percentage-type
|
|
|
|
|
;; (if semantic-idle-scheduler-no-working-message
|
|
|
|
|
;; nil
|
|
|
|
|
;; working-status-percentage-type))
|
|
|
|
|
(lexically-safe t)
|
|
|
|
|
)
|
|
|
|
|
;; Let people hook into this, but don't let them hose
|
|
|
|
|
;; us over!
|
|
|
|
|
(condition-case nil
|
2009-09-26 17:47:11 +00:00
|
|
|
|
(run-hooks 'semantic-before-idle-scheduler-reparse-hook)
|
|
|
|
|
(error (setq semantic-before-idle-scheduler-reparse-hook nil)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(unwind-protect
|
|
|
|
|
;; Perform the parsing.
|
|
|
|
|
(progn
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
|
|
|
|
(message "IDLE: reparse %s..." (buffer-name)))
|
|
|
|
|
(when (semantic-lex-catch-errors idle-scheduler
|
|
|
|
|
(save-excursion (semantic-fetch-tags))
|
|
|
|
|
nil)
|
|
|
|
|
;; If we are here, it is because the lexical step failed,
|
2011-12-04 00:02:42 -08:00
|
|
|
|
;; probably due to unterminated lists or something like that.
|
2009-08-29 19:00:35 +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))
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
|
|
|
|
(message "IDLE: reparse %s...done" (buffer-name))))
|
|
|
|
|
;; Let people hook into this, but don't let them hose
|
|
|
|
|
;; us over!
|
|
|
|
|
(condition-case nil
|
2009-09-26 17:47:11 +00:00
|
|
|
|
(run-hooks 'semantic-after-idle-scheduler-reparse-hook)
|
|
|
|
|
(error (setq semantic-after-idle-scheduler-reparse-hook nil))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Return if we are lexically safe (from prog1)
|
|
|
|
|
lexically-safe)))
|
|
|
|
|
|
|
|
|
|
;; After updating the tags, handle any pending decorations for this
|
|
|
|
|
;; buffer.
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(require 'semantic/decorate/mode)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(semantic-decorate-flush-pending-decorations (current-buffer))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; IDLE SERVICES
|
|
|
|
|
;;
|
|
|
|
|
;; Idle Services are minor modes which enable or disable a services in
|
|
|
|
|
;; the idle scheduler. Creating a new services only requires calling
|
|
|
|
|
;; `semantic-create-idle-services' which does all the setup
|
|
|
|
|
;; needed to create the minor mode that will enable or disable
|
|
|
|
|
;; a services. The services must provide a single function.
|
|
|
|
|
|
2009-11-24 02:38:08 +00:00
|
|
|
|
;; FIXME doc is incomplete.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(defmacro define-semantic-idle-service (name doc &rest forms)
|
|
|
|
|
"Create a new idle services with NAME.
|
|
|
|
|
DOC will be a documentation string describing FORMS.
|
|
|
|
|
FORMS will be called during idle time after the current buffer's
|
|
|
|
|
semantic tag information has been updated.
|
2010-01-18 05:39:40 +01:00
|
|
|
|
This routine creates the following functions and variables:"
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(let ((global (intern (concat "global-" (symbol-name name) "-mode")))
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(mode (intern (concat (symbol-name name) "-mode")))
|
|
|
|
|
(hook (intern (concat (symbol-name name) "-mode-hook")))
|
|
|
|
|
(map (intern (concat (symbol-name name) "-mode-map")))
|
|
|
|
|
(setup (intern (concat (symbol-name name) "-mode-setup")))
|
|
|
|
|
(func (intern (concat (symbol-name name) "-idle-function"))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2013-06-19 16:29:09 -04:00
|
|
|
|
`(progn
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(define-minor-mode ,global
|
2009-11-20 15:11:16 +00:00
|
|
|
|
,(concat "Toggle " (symbol-name global) ".
|
|
|
|
|
With ARG, turn the minor mode on if ARG is positive, off otherwise.
|
|
|
|
|
|
|
|
|
|
When this minor mode is enabled, `" (symbol-name mode) "' is
|
|
|
|
|
turned on in every Semantic-supported buffer.")
|
2010-05-01 23:38:19 -04:00
|
|
|
|
:global t
|
2009-08-29 19:00:35 +00:00
|
|
|
|
:group 'semantic
|
|
|
|
|
:group 'semantic-modes
|
|
|
|
|
:require 'semantic/idle
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(semantic-toggle-minor-mode-globally
|
|
|
|
|
',mode (if ,global 1 -1)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2010-05-01 23:38:19 -04:00
|
|
|
|
;; FIXME: Get rid of this when define-minor-mode does it for us.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(defcustom ,hook nil
|
2009-11-20 15:11:16 +00:00
|
|
|
|
,(concat "Hook run at the end of function `" (symbol-name mode) "'.")
|
2009-08-29 19:00:35 +00:00
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'hook)
|
|
|
|
|
|
|
|
|
|
(defvar ,map
|
|
|
|
|
(let ((km (make-sparse-keymap)))
|
|
|
|
|
km)
|
2009-11-20 15:11:16 +00:00
|
|
|
|
,(concat "Keymap for `" (symbol-name mode) "'."))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(define-minor-mode ,mode
|
|
|
|
|
,doc
|
|
|
|
|
:keymap ,map
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(if ,mode
|
|
|
|
|
(if (not (and (featurep 'semantic) (semantic-active-p)))
|
|
|
|
|
(progn
|
|
|
|
|
;; Disable minor mode if semantic stuff not available
|
|
|
|
|
(setq ,mode nil)
|
|
|
|
|
(error "Buffer %s was not set up for parsing"
|
|
|
|
|
(buffer-name)))
|
|
|
|
|
;; Enable the mode mode
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(semantic-idle-scheduler-add #',func))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Disable the mode mode
|
2010-05-02 01:06:53 -04:00
|
|
|
|
(semantic-idle-scheduler-remove #',func)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(semantic-add-minor-mode ',mode
|
2010-05-01 23:38:19 -04:00
|
|
|
|
"") ; idle schedulers are quiet?
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(defun ,func ()
|
2009-11-20 15:11:16 +00:00
|
|
|
|
,(concat "Perform idle activity for the minor mode `"
|
|
|
|
|
(symbol-name mode) "'.")
|
|
|
|
|
,@forms))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(put 'define-semantic-idle-service 'lisp-indent-function 1)
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(add-hook 'edebug-setup-hook
|
|
|
|
|
(lambda ()
|
|
|
|
|
(def-edebug-spec define-semantic-idle-service
|
|
|
|
|
(&define name stringp def-body))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;;; SUMMARY MODE
|
|
|
|
|
;;
|
|
|
|
|
;; A mode similar to eldoc using semantic
|
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-18 22:49:54 -04:00
|
|
|
|
(defcustom semantic-idle-truncate-long-summaries t
|
|
|
|
|
"Truncate summaries that are too long to fit in the minibuffer.
|
|
|
|
|
This can prevent minibuffer resizing in idle time."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'boolean)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-summary-function
|
|
|
|
|
'semantic-format-tag-summarize-with-file
|
2009-11-15 15:37:17 +00:00
|
|
|
|
"Function to call when displaying tag information during idle time.
|
|
|
|
|
This function should take a single argument, a Semantic tag, and
|
|
|
|
|
return a string to display.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
Some useful functions are found in `semantic-format-tag-functions'."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type semantic-format-tag-custom-list)
|
|
|
|
|
|
|
|
|
|
(defsubst semantic-idle-summary-find-current-symbol-tag (sym)
|
|
|
|
|
"Search for a semantic tag with name SYM in database tables.
|
|
|
|
|
Return the tag found or nil if not found.
|
|
|
|
|
If semanticdb is not in use, use the current buffer only."
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(car (if (and (featurep 'semantic/db)
|
|
|
|
|
semanticdb-current-database
|
|
|
|
|
(require 'semantic/db-find))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(cdar (semanticdb-deep-find-tags-by-name sym))
|
|
|
|
|
(semantic-deep-find-tags-by-name sym (current-buffer)))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-summary-current-symbol-info-brutish ()
|
|
|
|
|
"Return a string message describing the current context.
|
|
|
|
|
Gets a symbol with `semantic-ctxt-current-thing' and then
|
2009-10-01 04:54:05 +00:00
|
|
|
|
tries to find it with a deep targeted search."
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Try the current "thing".
|
|
|
|
|
(let ((sym (car (semantic-ctxt-current-thing))))
|
|
|
|
|
(when sym
|
|
|
|
|
(semantic-idle-summary-find-current-symbol-tag sym))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-summary-current-symbol-keyword ()
|
|
|
|
|
"Return a string message describing the current symbol.
|
|
|
|
|
Returns a value only if it is a keyword."
|
|
|
|
|
;; Try the current "thing".
|
|
|
|
|
(let ((sym (car (semantic-ctxt-current-thing))))
|
|
|
|
|
(if (and sym (semantic-lex-keyword-p sym))
|
|
|
|
|
(semantic-lex-keyword-get sym 'summary))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-summary-current-symbol-info-context ()
|
|
|
|
|
"Return a string message describing the current context.
|
|
|
|
|
Use the semantic analyzer to find the symbol information."
|
|
|
|
|
(let ((analysis (condition-case nil
|
|
|
|
|
(semantic-analyze-current-context (point))
|
|
|
|
|
(error nil))))
|
|
|
|
|
(when analysis
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(require 'semantic/analyze)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(semantic-analyze-interesting-tag analysis))))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-summary-current-symbol-info-default ()
|
|
|
|
|
"Return a string message describing the current context.
|
2009-10-01 04:54:05 +00:00
|
|
|
|
This function will disable loading of previously unloaded files
|
2009-08-29 19:00:35 +00:00
|
|
|
|
by semanticdb as a time-saving measure."
|
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-18 22:49:54 -04:00
|
|
|
|
(semanticdb-without-unloaded-file-searches
|
|
|
|
|
(save-excursion
|
|
|
|
|
;; use whichever has success first.
|
|
|
|
|
(or
|
|
|
|
|
(semantic-idle-summary-current-symbol-keyword)
|
|
|
|
|
|
|
|
|
|
(semantic-idle-summary-current-symbol-info-context)
|
|
|
|
|
|
|
|
|
|
(semantic-idle-summary-current-symbol-info-brutish)
|
|
|
|
|
))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(defvar semantic-idle-summary-out-of-context-faces
|
|
|
|
|
'(
|
|
|
|
|
font-lock-comment-face
|
|
|
|
|
font-lock-string-face
|
|
|
|
|
font-lock-doc-string-face ; XEmacs.
|
|
|
|
|
font-lock-doc-face ; Emacs 21 and later.
|
|
|
|
|
)
|
|
|
|
|
"List of font-lock faces that indicate a useless summary context.
|
|
|
|
|
Those are generally faces used to highlight comments.
|
|
|
|
|
|
|
|
|
|
It might be useful to override this variable to add comment faces
|
|
|
|
|
specific to a major mode. For example, in jde mode:
|
|
|
|
|
|
|
|
|
|
\(defvar-mode-local jde-mode semantic-idle-summary-out-of-context-faces
|
|
|
|
|
(append (default-value 'semantic-idle-summary-out-of-context-faces)
|
|
|
|
|
'(jde-java-font-lock-doc-tag-face
|
|
|
|
|
jde-java-font-lock-link-face
|
|
|
|
|
jde-java-font-lock-bold-face
|
|
|
|
|
jde-java-font-lock-underline-face
|
|
|
|
|
jde-java-font-lock-pre-face
|
|
|
|
|
jde-java-font-lock-code-face)))")
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-summary-useful-context-p ()
|
2010-01-18 05:39:40 +01:00
|
|
|
|
"Non-nil if we should show a summary based on context."
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(if (and (boundp 'font-lock-mode)
|
|
|
|
|
font-lock-mode
|
|
|
|
|
(memq (get-text-property (point) 'face)
|
|
|
|
|
semantic-idle-summary-out-of-context-faces))
|
|
|
|
|
;; The best I can think of at the moment is to disable
|
|
|
|
|
;; in comments by detecting with font-lock.
|
|
|
|
|
nil
|
|
|
|
|
t))
|
|
|
|
|
|
|
|
|
|
(define-overloadable-function semantic-idle-summary-current-symbol-info ()
|
|
|
|
|
"Return a string message describing the current context.")
|
|
|
|
|
|
|
|
|
|
(make-obsolete-overload 'semantic-eldoc-current-symbol-info
|
2009-10-28 14:01:49 +00:00
|
|
|
|
'semantic-idle-summary-current-symbol-info
|
|
|
|
|
"23.2")
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
2009-11-15 15:37:17 +00:00
|
|
|
|
(defcustom semantic-idle-summary-mode-hook nil
|
|
|
|
|
"Hook run at the end of `semantic-idle-summary'."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'hook)
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-summary-idle-function ()
|
2009-08-29 19:00:35 +00:00
|
|
|
|
"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."
|
|
|
|
|
(or (eq major-mode 'emacs-lisp-mode)
|
|
|
|
|
(not (semantic-idle-summary-useful-context-p))
|
|
|
|
|
(let* ((found (semantic-idle-summary-current-symbol-info))
|
|
|
|
|
(str (cond ((stringp found) found)
|
|
|
|
|
((semantic-tag-p found)
|
|
|
|
|
(funcall semantic-idle-summary-function
|
2009-11-15 15:37:17 +00:00
|
|
|
|
found nil t)))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Show the message with eldoc functions
|
|
|
|
|
(unless (and str (boundp 'eldoc-echo-area-use-multiline-p)
|
|
|
|
|
eldoc-echo-area-use-multiline-p)
|
|
|
|
|
(let ((w (1- (window-width (minibuffer-window)))))
|
|
|
|
|
(if (> (length str) w)
|
|
|
|
|
(setq str (substring str 0 w)))))
|
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-18 22:49:54 -04:00
|
|
|
|
;; I borrowed some bits from eldoc to shorten the
|
|
|
|
|
;; message.
|
|
|
|
|
(when semantic-idle-truncate-long-summaries
|
|
|
|
|
(let ((ea-width (1- (window-width (minibuffer-window))))
|
|
|
|
|
(strlen (length str)))
|
|
|
|
|
(when (> strlen ea-width)
|
|
|
|
|
(setq str (substring str 0 ea-width)))))
|
|
|
|
|
;; Display it
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(eldoc-message str))))
|
2009-11-15 15:37:17 +00:00
|
|
|
|
|
|
|
|
|
(define-minor-mode semantic-idle-summary-mode
|
|
|
|
|
"Toggle Semantic Idle Summary mode.
|
2009-11-20 15:11:16 +00:00
|
|
|
|
With ARG, turn Semantic Idle Summary mode on if ARG is positive,
|
|
|
|
|
off otherwise.
|
|
|
|
|
|
|
|
|
|
When this minor mode is enabled, the echo area displays a summary
|
|
|
|
|
of the lexical token at point whenever Emacs is idle."
|
2009-11-15 15:37:17 +00:00
|
|
|
|
:group 'semantic
|
|
|
|
|
:group 'semantic-modes
|
|
|
|
|
(if semantic-idle-summary-mode
|
|
|
|
|
;; Enable the mode
|
|
|
|
|
(progn
|
|
|
|
|
(unless (and (featurep 'semantic) (semantic-active-p))
|
|
|
|
|
;; Disable minor mode if semantic stuff not available
|
|
|
|
|
(setq semantic-idle-summary-mode nil)
|
|
|
|
|
(error "Buffer %s was not set up for parsing"
|
|
|
|
|
(buffer-name)))
|
|
|
|
|
(require 'eldoc)
|
|
|
|
|
(semantic-idle-scheduler-add 'semantic-idle-summary-idle-function)
|
|
|
|
|
(add-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t))
|
|
|
|
|
;; Disable the mode
|
|
|
|
|
(semantic-idle-scheduler-remove 'semantic-idle-summary-idle-function)
|
2010-05-02 01:06:53 -04:00
|
|
|
|
(remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)))
|
2010-05-01 23:38:19 -04:00
|
|
|
|
|
|
|
|
|
(defun semantic-idle-summary-refresh-echo-area ()
|
|
|
|
|
(and semantic-idle-summary-mode
|
|
|
|
|
eldoc-last-message
|
|
|
|
|
(if (and (not executing-kbd-macro)
|
|
|
|
|
(not (and (boundp 'edebug-active) edebug-active))
|
|
|
|
|
(not cursor-in-echo-area)
|
|
|
|
|
(not (eq (selected-window) (minibuffer-window))))
|
|
|
|
|
(eldoc-message eldoc-last-message)
|
|
|
|
|
(setq eldoc-last-message nil))))
|
2009-11-15 15:37:17 +00:00
|
|
|
|
|
|
|
|
|
(semantic-add-minor-mode 'semantic-idle-summary-mode "")
|
|
|
|
|
|
|
|
|
|
(define-minor-mode global-semantic-idle-summary-mode
|
2009-11-20 15:11:16 +00:00
|
|
|
|
"Toggle Global Semantic Idle Summary mode.
|
|
|
|
|
With ARG, turn Global Semantic Idle Summary mode on if ARG is
|
|
|
|
|
positive, off otherwise.
|
|
|
|
|
|
|
|
|
|
When this minor mode is enabled, `semantic-idle-summary-mode' is
|
|
|
|
|
turned on in every Semantic-supported buffer."
|
2009-11-15 15:37:17 +00:00
|
|
|
|
:global t
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:group 'semantic-modes
|
|
|
|
|
(semantic-toggle-minor-mode-globally
|
|
|
|
|
'semantic-idle-summary-mode
|
|
|
|
|
(if global-semantic-idle-summary-mode 1 -1)))
|
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;;; Current symbol highlight
|
|
|
|
|
;;
|
|
|
|
|
;; This mode will use context analysis to perform highlighting
|
|
|
|
|
;; of all uses of the symbol that is under the cursor.
|
|
|
|
|
;;
|
|
|
|
|
;; This is to mimic the Eclipse tool of a similar nature.
|
2013-10-30 21:50:24 -04:00
|
|
|
|
(defface semantic-idle-symbol-highlight
|
|
|
|
|
'((t :inherit region))
|
|
|
|
|
"Face used for highlighting local symbols."
|
|
|
|
|
:group 'semantic-faces)
|
|
|
|
|
(defvar semantic-idle-symbol-highlight-face 'semantic-idle-symbol-highlight
|
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-18 22:49:54 -04:00
|
|
|
|
"Face used for highlighting local symbols.")
|
2013-10-30 21:50:24 -04:00
|
|
|
|
(make-obsolete-variable 'semantic-idle-symbol-highlight-face
|
|
|
|
|
"customize the face `semantic-idle-symbol-highlight' instead" "24.4" 'set)
|
2009-08-29 19:00:35 +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-18 22:49:54 -04:00
|
|
|
|
(defun semantic-idle-symbol-maybe-highlight (tag)
|
|
|
|
|
"Perhaps add highlighting to the symbol represented by TAG.
|
|
|
|
|
TAG was found as the symbol under point. If it happens to be
|
2009-08-29 19:00:35 +00:00
|
|
|
|
visible, then highlight it."
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(require 'pulse)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(let* ((region (when (and (semantic-tag-p tag)
|
|
|
|
|
(semantic-tag-with-position-p tag))
|
|
|
|
|
(semantic-tag-overlay tag)))
|
|
|
|
|
(file (when (and (semantic-tag-p tag)
|
|
|
|
|
(semantic-tag-with-position-p tag))
|
|
|
|
|
(semantic-tag-file-name tag)))
|
|
|
|
|
(buffer (when file (get-file-buffer file)))
|
|
|
|
|
;; We use pulse, but we don't want the flashy version,
|
|
|
|
|
;; just the stable version.
|
|
|
|
|
(pulse-flag nil)
|
|
|
|
|
)
|
|
|
|
|
(cond ((semantic-overlay-p region)
|
* cedet/srecode/srt-mode.el (semantic-analyze-possible-completions):
* cedet/semantic/symref/list.el (semantic-symref-rb-toggle-expand-tag):
* cedet/semantic/symref/grep.el (semantic-symref-perform-search):
* cedet/semantic/bovine/gcc.el (semantic-gcc-query):
* cedet/semantic/bovine/c.el (semantic-c-parse-lexical-token):
* cedet/semantic/analyze/debug.el (semantic-analyzer-debug-add-buttons)
(semantic-analyzer-debug-global-symbol)
(semantic-analyzer-debug-missing-innertype)
(semantic-analyzer-debug-insert-include-summary):
* cedet/semantic/util.el (semantic-file-tag-table):
(semantic-describe-buffer-var-helper, semantic-something-to-tag-table)
(semantic-recursive-find-nonterminal-by-name):
* cedet/semantic/tag-ls.el (semantic-tag-calculate-parent-default):
* cedet/semantic/tag-file.el (semantic-prototype-file):
* cedet/semantic/symref.el (semantic-symref-parse-tool-output):
* cedet/semantic/sb.el (semantic-sb-fetch-tag-table):
* cedet/semantic/lex-spp.el (semantic-lex-spp-lex-text-string):
* cedet/semantic/idle.el (semantic-idle-work-for-one-buffer):
(semantic-idle-summary-maybe-highlight):
* cedet/semantic/ia-sb.el (semantic-ia-speedbar)
(semantic-ia-sb-tag-info):
* cedet/semantic/grammar.el (semantic-analyze-possible-completions):
* cedet/semantic/find.el (semantic-brute-find-tag-by-position):
* cedet/semantic/ede-grammar.el (project-compile-target):
(ede-proj-makefile-insert-variables):
* cedet/semantic/debug.el (semantic-debug-set-parser-location):
(semantic-debug-set-source-location, semantic-debug-interface-layout)
(semantic-debug-mode, semantic-debug):
* cedet/semantic/db.el (semanticdb-needs-refresh-p):
* cedet/semantic/db-typecache.el (semanticdb-typecache-refresh-for-buffer):
* cedet/semantic/db-javascript.el (semanticdb-equivalent-mode):
* cedet/semantic/db-find.el (semanticdb-find-log-new-search)
(semanticdb-find-translate-path-includes--internal)
(semanticdb-reset-log, semanticdb-find-log-activity):
* cedet/semantic/db-file.el (object-write):
* cedet/semantic/db-el.el (semanticdb-equivalent-mode):
* cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-C-file-p)
(semanticdb-create-ebrowse-database):
* cedet/semantic/db-debug.el (semanticdb-table-sanity-check):
* cedet/semantic/complete.el (semantic-displayor-focus-request)
(semantic-collector-calculate-completions-raw)
(semantic-complete-read-tag-analyzer):
* cedet/semantic/analyze.el (semantic-analyze-pulse):
* cedet/ede/util.el (ede-update-version-in-source):
* cedet/ede/proj.el (project-delete-target):
* cedet/ede/proj-elisp.el (ede-update-version-in-source)
(ede-proj-flush-autoconf):
* cedet/ede/pconf.el (ede-proj-configure-synchronize)
(ede-proj-configure-synchronize):
* cedet/ede/locate.el (ede-locate-file-in-project-impl):
* cedet/ede/linux.el (ede-linux-version):
* cedet/ede/emacs.el (ede-emacs-version):
* cedet/ede/dired.el (ede-dired-add-to-target):
* cedet/ede.el (ede-buffer-header-file, ede-find-target)
(ede-buffer-documentation-files, ede-project-buffers, ede-set)
(ede-target-buffers, ede-buffers, ede-make-project-local-variable):
* cedet/cedet-idutils.el (cedet-idutils-fnid-call):
(cedet-idutils-lid-call, cedet-idutils-expand-filename)
(cedet-idutils-version-check):
* cedet/cedet-global.el (cedet-gnu-global-call):
(cedet-gnu-global-expand-filename, cedet-gnu-global-root)
(cedet-gnu-global-version-check, cedet-gnu-global-scan-hits):
* cedet/cedet-cscope.el (cedet-cscope-call)
(cedet-cscope-expand-filename, cedet-cscope-version-check):
Use with-current-buffer.
* cedet/ede.el (ede-make-project-local-variable)
(ede-set-project-variables, ede-set): Use dolist.
2009-10-30 02:16:41 +00:00
|
|
|
|
(with-current-buffer (semantic-overlay-buffer region)
|
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 15:33:09 +02:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (semantic-overlay-start region))
|
|
|
|
|
(when (pos-visible-in-window-p
|
|
|
|
|
(point) (get-buffer-window (current-buffer) 'visible))
|
|
|
|
|
(if (< (semantic-overlay-end region) (point-at-eol))
|
|
|
|
|
(pulse-momentary-highlight-overlay
|
|
|
|
|
region semantic-idle-symbol-highlight-face)
|
|
|
|
|
;; Not the same
|
|
|
|
|
(pulse-momentary-highlight-region
|
|
|
|
|
(semantic-overlay-start region)
|
|
|
|
|
(point-at-eol)
|
|
|
|
|
semantic-idle-symbol-highlight-face))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
))
|
|
|
|
|
((vectorp region)
|
|
|
|
|
(let ((start (aref region 0))
|
|
|
|
|
(end (aref region 1)))
|
|
|
|
|
(save-excursion
|
|
|
|
|
(when buffer (set-buffer buffer))
|
|
|
|
|
;; As a vector, we have no filename. Perhaps it is a
|
|
|
|
|
;; local variable?
|
|
|
|
|
(when (and (<= end (point-max))
|
|
|
|
|
(pos-visible-in-window-p
|
|
|
|
|
start (get-buffer-window (current-buffer) 'visible)))
|
|
|
|
|
(goto-char start)
|
|
|
|
|
(when (re-search-forward
|
|
|
|
|
(regexp-quote (semantic-tag-name tag))
|
|
|
|
|
end t)
|
|
|
|
|
;; This is likely it, give it a try.
|
|
|
|
|
(pulse-momentary-highlight-region
|
|
|
|
|
start (if (<= end (point-at-eol)) end
|
|
|
|
|
(point-at-eol))
|
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-18 22:49:54 -04:00
|
|
|
|
semantic-idle-symbol-highlight-face)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
))))
|
|
|
|
|
nil))
|
|
|
|
|
|
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-18 22:49:54 -04:00
|
|
|
|
(define-semantic-idle-service semantic-idle-local-symbol-highlight
|
|
|
|
|
"Highlight the tag and symbol references of the symbol under point.
|
2009-08-29 19:00:35 +00:00
|
|
|
|
Call `semantic-analyze-current-context' to find the reference tag.
|
|
|
|
|
Call `semantic-symref-hits-in-region' to identify local references."
|
2009-09-03 03:58:13 +00:00
|
|
|
|
(require 'pulse)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(when (semantic-idle-summary-useful-context-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-18 22:49:54 -04:00
|
|
|
|
(let* ((ctxt
|
|
|
|
|
(semanticdb-without-unloaded-file-searches
|
|
|
|
|
(semantic-analyze-current-context)))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(Hbounds (when ctxt (oref ctxt bounds)))
|
|
|
|
|
(target (when ctxt (car (reverse (oref ctxt prefix)))))
|
|
|
|
|
(tag (semantic-current-tag))
|
|
|
|
|
;; We use pulse, but we don't want the flashy version,
|
|
|
|
|
;; just the stable version.
|
|
|
|
|
(pulse-flag nil))
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(when (and ctxt tag)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Highlight the original tag? Protect against problems.
|
|
|
|
|
(condition-case nil
|
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-18 22:49:54 -04:00
|
|
|
|
(semantic-idle-symbol-maybe-highlight target)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(error nil))
|
|
|
|
|
;; Identify all hits in this current tag.
|
|
|
|
|
(when (semantic-tag-p target)
|
2009-09-05 21:09:25 +00:00
|
|
|
|
(require 'semantic/symref/filter)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(semantic-symref-hits-in-region
|
|
|
|
|
target (lambda (start end prefix)
|
|
|
|
|
(when (/= start (car Hbounds))
|
|
|
|
|
(pulse-momentary-highlight-region
|
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-18 22:49:54 -04:00
|
|
|
|
start end semantic-idle-symbol-highlight-face))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(semantic-throw-on-input 'symref-highlight)
|
|
|
|
|
)
|
|
|
|
|
(semantic-tag-start tag)
|
|
|
|
|
(semantic-tag-end tag)))
|
|
|
|
|
))))
|
|
|
|
|
|
2009-11-24 02:38:08 +00:00
|
|
|
|
|
|
|
|
|
;;;###autoload
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(define-minor-mode global-semantic-idle-scheduler-mode
|
2009-11-24 02:38:08 +00:00
|
|
|
|
"Toggle global use of option `semantic-idle-scheduler-mode'.
|
2010-01-18 05:39:40 +01:00
|
|
|
|
The idle scheduler will automatically reparse buffers in idle time,
|
2009-11-24 02:38:08 +00:00
|
|
|
|
and then schedule other jobs setup with `semantic-idle-scheduler-add'.
|
2010-05-01 23:38:19 -04:00
|
|
|
|
If ARG is positive or nil, enable, if it is negative, disable."
|
|
|
|
|
:global t
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:group 'semantic-modes
|
2009-11-24 02:38:08 +00:00
|
|
|
|
;; When turning off, disable other idle modes.
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(when (null global-semantic-idle-scheduler-mode)
|
2009-11-24 02:38:08 +00:00
|
|
|
|
(global-semantic-idle-summary-mode -1)
|
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-18 22:49:54 -04:00
|
|
|
|
(global-semantic-idle-local-symbol-highlight-mode -1)
|
2009-11-24 02:38:08 +00:00
|
|
|
|
(global-semantic-idle-completions-mode -1))
|
2010-05-01 23:38:19 -04:00
|
|
|
|
(semantic-toggle-minor-mode-globally
|
|
|
|
|
'semantic-idle-scheduler-mode
|
|
|
|
|
(if global-semantic-idle-scheduler-mode 1 -1)))
|
2009-11-24 02:38:08 +00:00
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
;;; Completion Popup Mode
|
|
|
|
|
;;
|
|
|
|
|
;; This mode uses tooltips to display a (hopefully) short list of possible
|
|
|
|
|
;; completions available for the text under point. It provides
|
|
|
|
|
;; NO provision for actually filling in the values from those completions.
|
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-18 22:49:54 -04:00
|
|
|
|
(defun semantic-idle-completions-end-of-symbol-p ()
|
|
|
|
|
"Return non-nil if the cursor is at the END of a symbol.
|
|
|
|
|
If the cursor is in the middle of a symbol, then we shouldn't be
|
|
|
|
|
doing fancy completions."
|
|
|
|
|
(not (looking-at "\\w\\|\\s_")))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
|
|
|
|
|
(defun semantic-idle-completion-list-default ()
|
|
|
|
|
"Calculate and display a list of completions."
|
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-18 22:49:54 -04:00
|
|
|
|
(when (and (semantic-idle-summary-useful-context-p)
|
|
|
|
|
(semantic-idle-completions-end-of-symbol-p))
|
2012-10-02 02:10:29 +08:00
|
|
|
|
;; This mode can be fragile, hence don't raise errors, and only
|
|
|
|
|
;; report problems if semantic-idle-scheduler-verbose-flag is
|
|
|
|
|
;; non-nil. If something doesn't do what you expect, run the
|
|
|
|
|
;; below command by hand instead.
|
|
|
|
|
(condition-case err
|
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-18 22:49:54 -04:00
|
|
|
|
(semanticdb-without-unloaded-file-searches
|
|
|
|
|
;; Use idle version.
|
|
|
|
|
(semantic-complete-analyze-inline-idle)
|
2009-08-29 19:00:35 +00:00
|
|
|
|
)
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(error
|
|
|
|
|
(when semantic-idle-scheduler-verbose-flag
|
|
|
|
|
(message " %s" (error-message-string err)))))
|
2009-08-29 19:00:35 +00:00
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
(define-semantic-idle-service semantic-idle-completions
|
2009-11-20 15:11:16 +00:00
|
|
|
|
"Toggle Semantic Idle Completions mode.
|
|
|
|
|
With ARG, turn Semantic Idle Completions mode on if ARG is
|
|
|
|
|
positive, off otherwise.
|
|
|
|
|
|
|
|
|
|
This minor mode only takes effect if Semantic is active and
|
|
|
|
|
`semantic-idle-scheduler-mode' is enabled.
|
|
|
|
|
|
|
|
|
|
When enabled, Emacs displays a list of possible completions at
|
|
|
|
|
idle time. The method for displaying completions is given by
|
|
|
|
|
`semantic-complete-inline-analyzer-idle-displayor-class'; the
|
|
|
|
|
default is to show completions inline.
|
|
|
|
|
|
|
|
|
|
While a completion is displayed, RET accepts the completion; M-n
|
|
|
|
|
and M-p cycle through completion alternatives; TAB attempts to
|
|
|
|
|
complete as far as possible, and cycles if no additional
|
|
|
|
|
completion is possible; and any other command cancels the
|
|
|
|
|
completion.
|
|
|
|
|
|
|
|
|
|
\\{semantic-complete-inline-map}"
|
2009-08-29 19:00:35 +00:00
|
|
|
|
;; Add the ability to override sometime.
|
|
|
|
|
(semantic-idle-completion-list-default))
|
|
|
|
|
|
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-18 22:49:54 -04:00
|
|
|
|
|
|
|
|
|
;;; Breadcrumbs for tag under point
|
|
|
|
|
;;
|
|
|
|
|
;; Service that displays a breadcrumbs indication of the tag under
|
|
|
|
|
;; point and its parents in the header or mode line.
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-breadcrumbs-display-function
|
|
|
|
|
#'semantic-idle-breadcrumbs--display-in-header-line
|
|
|
|
|
"Function to display the tag under point in idle time.
|
|
|
|
|
This function should take a list of Semantic tags as its only
|
|
|
|
|
argument. The tags are sorted according to their nesting order,
|
|
|
|
|
starting with the outermost tag. The function should call
|
|
|
|
|
`semantic-idle-breadcrumbs-format-tag-list-function' to convert
|
|
|
|
|
the tag list into a string."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Display in header line"
|
|
|
|
|
semantic-idle-breadcrumbs--display-in-header-line)
|
|
|
|
|
(const :tag "Display in mode line"
|
|
|
|
|
semantic-idle-breadcrumbs--display-in-mode-line)
|
|
|
|
|
(function :tag "Other function")))
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-breadcrumbs-format-tag-list-function
|
|
|
|
|
#'semantic-idle-breadcrumbs--format-linear
|
|
|
|
|
"Function to format the list of tags containing point.
|
|
|
|
|
This function should take a list of Semantic tags and an optional
|
|
|
|
|
maximum length of the produced string as its arguments. The
|
|
|
|
|
maximum length is a hint and can be ignored. When the maximum
|
|
|
|
|
length is omitted, an unconstrained string should be
|
|
|
|
|
produced. The tags are sorted according to their nesting order,
|
|
|
|
|
starting with the outermost tag. Single tags should be formatted
|
|
|
|
|
using `semantic-idle-breadcrumbs-format-tag-function' unless
|
|
|
|
|
special formatting is required."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Format tags as list, innermost last"
|
|
|
|
|
semantic-idle-breadcrumbs--format-linear)
|
|
|
|
|
(const :tag "Innermost tag with details, followed by remaining tags"
|
|
|
|
|
semantic-idle-breadcrumbs--format-innermost-first)
|
|
|
|
|
(function :tag "Other function")))
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-breadcrumbs-format-tag-function
|
|
|
|
|
#'semantic-format-tag-abbreviate
|
|
|
|
|
"Function to call to format information about tags.
|
|
|
|
|
This function should take a single argument, a Semantic tag, and
|
|
|
|
|
return a string to display.
|
|
|
|
|
Some useful functions are found in `semantic-format-tag-functions'."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type semantic-format-tag-custom-list)
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-breadcrumbs-separator 'mode-specific
|
|
|
|
|
"Specify how to separate tags in the breadcrumbs string.
|
|
|
|
|
An arbitrary string or a mode-specific scope nesting
|
|
|
|
|
string (like, for example, \"::\" in C++, or \".\" in Java) can
|
|
|
|
|
be used."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type '(choice
|
|
|
|
|
(const :tag "Use mode specific separator"
|
|
|
|
|
mode-specific)
|
|
|
|
|
(string :tag "Specify separator string")))
|
|
|
|
|
|
|
|
|
|
(defcustom semantic-idle-breadcrumbs-header-line-prefix
|
|
|
|
|
semantic-stickyfunc-indent-string ;; TODO not optimal
|
|
|
|
|
"String used to indent the breadcrumbs string.
|
|
|
|
|
Customize this string to match the space used by scrollbars and
|
|
|
|
|
fringe."
|
|
|
|
|
:group 'semantic
|
|
|
|
|
:type 'string)
|
|
|
|
|
|
|
|
|
|
(defvar semantic-idle-breadcrumbs-popup-menu nil
|
|
|
|
|
"Menu used when a tag displayed by `semantic-idle-breadcrumbs-mode' is clicked.")
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-breadcrumbs--popup-menu (event)
|
|
|
|
|
"Popup a menu that displays things to do to the clicked tag.
|
|
|
|
|
Argument EVENT describes the event that caused this function to
|
|
|
|
|
be called."
|
|
|
|
|
(interactive "e")
|
|
|
|
|
(let ((old-window (selected-window))
|
|
|
|
|
(window (semantic-event-window event)))
|
|
|
|
|
(select-window window t)
|
|
|
|
|
(semantic-popup-menu semantic-idle-breadcrumbs-popup-menu)
|
|
|
|
|
(select-window old-window)))
|
|
|
|
|
|
|
|
|
|
(defmacro semantic-idle-breadcrumbs--tag-function (function)
|
|
|
|
|
"Return lambda expression calling FUNCTION when called from a popup."
|
|
|
|
|
`(lambda (event)
|
|
|
|
|
(interactive "e")
|
|
|
|
|
(let* ((old-window (selected-window))
|
|
|
|
|
(window (semantic-event-window event))
|
|
|
|
|
(column (car (nth 6 (nth 1 event)))) ;; TODO semantic-event-column?
|
|
|
|
|
(tag (progn
|
|
|
|
|
(select-window window t)
|
|
|
|
|
(plist-get
|
|
|
|
|
(text-properties-at column header-line-format)
|
|
|
|
|
'tag))))
|
|
|
|
|
(,function tag)
|
|
|
|
|
(select-window old-window)))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
;; TODO does this work for mode-line case?
|
|
|
|
|
(defvar semantic-idle-breadcrumbs-popup-map
|
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
|
;; mouse-1 goes to clicked tag
|
|
|
|
|
(define-key map
|
|
|
|
|
[ header-line mouse-1 ]
|
|
|
|
|
(semantic-idle-breadcrumbs--tag-function
|
|
|
|
|
semantic-go-to-tag))
|
|
|
|
|
;; mouse-3 pops up a context menu
|
|
|
|
|
(define-key map
|
|
|
|
|
[ header-line mouse-3 ]
|
|
|
|
|
'semantic-idle-breadcrumbs--popup-menu)
|
|
|
|
|
map)
|
|
|
|
|
"Keymap for semantic idle breadcrumbs minor mode.")
|
|
|
|
|
|
|
|
|
|
(easy-menu-define
|
|
|
|
|
semantic-idle-breadcrumbs-popup-menu
|
|
|
|
|
semantic-idle-breadcrumbs-popup-map
|
|
|
|
|
"Semantic Breadcrumbs Mode Menu"
|
|
|
|
|
(list
|
|
|
|
|
"Breadcrumb Tag"
|
|
|
|
|
(semantic-menu-item
|
|
|
|
|
(vector
|
|
|
|
|
"Go to Tag"
|
|
|
|
|
(semantic-idle-breadcrumbs--tag-function
|
|
|
|
|
semantic-go-to-tag)
|
|
|
|
|
:active t
|
|
|
|
|
:help "Jump to this tag"))
|
|
|
|
|
;; TODO these entries need minor changes (optional tag argument) in
|
|
|
|
|
;; senator-copy-tag etc
|
|
|
|
|
;; (semantic-menu-item
|
|
|
|
|
;; (vector
|
|
|
|
|
;; "Copy Tag"
|
|
|
|
|
;; (semantic-idle-breadcrumbs--tag-function
|
|
|
|
|
;; senator-copy-tag)
|
|
|
|
|
;; :active t
|
|
|
|
|
;; :help "Copy this tag"))
|
|
|
|
|
;; (semantic-menu-item
|
|
|
|
|
;; (vector
|
|
|
|
|
;; "Kill Tag"
|
|
|
|
|
;; (semantic-idle-breadcrumbs--tag-function
|
|
|
|
|
;; senator-kill-tag)
|
|
|
|
|
;; :active t
|
|
|
|
|
;; :help "Kill tag text to the kill ring, and copy the tag to
|
|
|
|
|
;; the tag ring"))
|
|
|
|
|
;; (semantic-menu-item
|
|
|
|
|
;; (vector
|
|
|
|
|
;; "Copy Tag to Register"
|
|
|
|
|
;; (semantic-idle-breadcrumbs--tag-function
|
|
|
|
|
;; senator-copy-tag-to-register)
|
|
|
|
|
;; :active t
|
|
|
|
|
;; :help "Copy this tag"))
|
|
|
|
|
;; (semantic-menu-item
|
|
|
|
|
;; (vector
|
|
|
|
|
;; "Narrow to Tag"
|
|
|
|
|
;; (semantic-idle-breadcrumbs--tag-function
|
|
|
|
|
;; senator-narrow-to-defun)
|
|
|
|
|
;; :active t
|
|
|
|
|
;; :help "Narrow to the bounds of the current tag"))
|
|
|
|
|
;; (semantic-menu-item
|
|
|
|
|
;; (vector
|
|
|
|
|
;; "Fold Tag"
|
|
|
|
|
;; (semantic-idle-breadcrumbs--tag-function
|
|
|
|
|
;; senator-fold-tag-toggle)
|
|
|
|
|
;; :active t
|
|
|
|
|
;; :style 'toggle
|
|
|
|
|
;; :selected '(let ((tag (semantic-current-tag)))
|
2012-10-02 02:10:29 +08:00
|
|
|
|
;; (and tag (semantic-tag-folded-p tag)))
|
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-18 22:49:54 -04:00
|
|
|
|
;; :help "Fold the current tag to one line"))
|
|
|
|
|
"---"
|
|
|
|
|
(semantic-menu-item
|
|
|
|
|
(vector
|
|
|
|
|
"About this Header Line"
|
|
|
|
|
(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(describe-function 'semantic-idle-breadcrumbs-mode))
|
|
|
|
|
:active t
|
|
|
|
|
:help "Display help about this header line."))
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(define-semantic-idle-service semantic-idle-breadcrumbs
|
|
|
|
|
"Display breadcrumbs for the tag under point and its parents."
|
|
|
|
|
(let* ((scope (semantic-calculate-scope))
|
|
|
|
|
(tag-list (if scope
|
|
|
|
|
;; If there is a scope, extract the tag and its
|
|
|
|
|
;; parents.
|
|
|
|
|
(append (oref scope parents)
|
|
|
|
|
(when (oref scope tag)
|
|
|
|
|
(list (oref scope tag))))
|
|
|
|
|
;; Fall back to tags by overlay
|
|
|
|
|
(semantic-find-tag-by-overlay))))
|
|
|
|
|
;; Display the tags.
|
|
|
|
|
(funcall semantic-idle-breadcrumbs-display-function tag-list)))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-breadcrumbs--display-in-header-line (tag-list)
|
|
|
|
|
"Display the tags in TAG-LIST in the header line of their buffer."
|
|
|
|
|
(let ((width (- (nth 2 (window-edges))
|
|
|
|
|
(nth 0 (window-edges)))))
|
|
|
|
|
;; Format TAG-LIST and put the formatted string into the header
|
|
|
|
|
;; line.
|
|
|
|
|
(setq header-line-format
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(replace-regexp-in-string ;; Since % is interpreted in the
|
|
|
|
|
"\\(%\\)" "%\\1" ;; mode/header line format, we
|
|
|
|
|
(concat ;; have to escape all occurrences.
|
|
|
|
|
semantic-idle-breadcrumbs-header-line-prefix
|
|
|
|
|
(if tag-list
|
|
|
|
|
(semantic-idle-breadcrumbs--format-tag-list
|
|
|
|
|
tag-list
|
|
|
|
|
(- width
|
|
|
|
|
(length semantic-idle-breadcrumbs-header-line-prefix)))
|
|
|
|
|
(propertize
|
|
|
|
|
"<not on tags>"
|
|
|
|
|
'face
|
|
|
|
|
'font-lock-comment-face))))))
|
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-18 22:49:54 -04:00
|
|
|
|
|
|
|
|
|
;; Update the header line.
|
|
|
|
|
(force-mode-line-update))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-breadcrumbs--display-in-mode-line (tag-list)
|
|
|
|
|
"Display the tags in TAG-LIST in the mode line of their buffer.
|
|
|
|
|
TODO THIS FUNCTION DOES NOT WORK YET."
|
|
|
|
|
|
|
|
|
|
(error "This function does not work yet")
|
|
|
|
|
|
|
|
|
|
(let ((width (- (nth 2 (window-edges))
|
|
|
|
|
(nth 0 (window-edges)))))
|
|
|
|
|
(setq mode-line-format
|
2012-10-02 02:10:29 +08:00
|
|
|
|
(replace-regexp-in-string ;; see comment in
|
|
|
|
|
"\\(%\\)" "%\\1" ;; `semantic-idle-breadcrumbs--display-in-header-line'
|
|
|
|
|
(semantic-idle-breadcrumbs--format-tag-list tag-list width))))
|
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-18 22:49:54 -04:00
|
|
|
|
|
|
|
|
|
(force-mode-line-update))
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-breadcrumbs--format-tag-list (tag-list max-length)
|
|
|
|
|
"Format TAG-LIST using configured functions respecting MAX-LENGTH.
|
|
|
|
|
If the initial formatting result is longer than MAX-LENGTH, it is
|
|
|
|
|
shortened at the beginning."
|
|
|
|
|
;; Format TAG-LIST using the configured formatting function.
|
|
|
|
|
(let* ((complete-format (funcall
|
|
|
|
|
semantic-idle-breadcrumbs-format-tag-list-function
|
|
|
|
|
tag-list max-length))
|
|
|
|
|
;; Determine length of complete format.
|
|
|
|
|
(complete-length (length complete-format)))
|
|
|
|
|
;; Shorten string if necessary.
|
|
|
|
|
(if (<= complete-length max-length)
|
|
|
|
|
complete-format
|
|
|
|
|
(concat "... "
|
|
|
|
|
(substring
|
|
|
|
|
complete-format
|
|
|
|
|
(- complete-length (- max-length 4))))))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-breadcrumbs--format-linear
|
|
|
|
|
(tag-list &optional max-length)
|
|
|
|
|
"Format TAG-LIST as a linear list, starting with the outermost tag.
|
|
|
|
|
MAX-LENGTH is not used."
|
|
|
|
|
(require 'semantic/analyze/fcn)
|
|
|
|
|
(let* ((format-pieces (mapcar
|
|
|
|
|
#'semantic-idle-breadcrumbs--format-tag
|
|
|
|
|
tag-list))
|
|
|
|
|
;; Format tag list, putting configured separators between the
|
|
|
|
|
;; tags.
|
|
|
|
|
(complete-format (cond
|
|
|
|
|
;; Mode specific separator.
|
|
|
|
|
((eq semantic-idle-breadcrumbs-separator
|
|
|
|
|
'mode-specific)
|
|
|
|
|
(semantic-analyze-unsplit-name format-pieces))
|
|
|
|
|
|
|
|
|
|
;; Custom separator.
|
|
|
|
|
((stringp semantic-idle-breadcrumbs-separator)
|
|
|
|
|
(mapconcat
|
|
|
|
|
#'identity
|
|
|
|
|
format-pieces
|
|
|
|
|
semantic-idle-breadcrumbs-separator)))))
|
|
|
|
|
complete-format)
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-breadcrumbs--format-innermost-first
|
|
|
|
|
(tag-list &optional max-length)
|
|
|
|
|
"Format TAG-LIST placing the innermost tag first, separated from its parents.
|
|
|
|
|
If MAX-LENGTH is non-nil, the innermost tag is shortened."
|
|
|
|
|
(let* (;; Separate and format remaining tags. Calculate length of
|
|
|
|
|
;; resulting string.
|
|
|
|
|
(rest-tags (butlast tag-list))
|
|
|
|
|
(rest-format (if rest-tags
|
|
|
|
|
(concat
|
|
|
|
|
" | "
|
|
|
|
|
(semantic-idle-breadcrumbs--format-linear
|
|
|
|
|
rest-tags))
|
|
|
|
|
""))
|
|
|
|
|
(rest-length (length rest-format))
|
|
|
|
|
;; Format innermost tag and calculate length of resulting
|
|
|
|
|
;; string.
|
|
|
|
|
(inner-format (semantic-idle-breadcrumbs--format-tag
|
|
|
|
|
(car (last tag-list))
|
|
|
|
|
#'semantic-format-tag-prototype))
|
|
|
|
|
(inner-length (length inner-format))
|
|
|
|
|
;; Calculate complete length and shorten string for innermost
|
|
|
|
|
;; tag if MAX-LENGTH is non-nil and the complete string is
|
|
|
|
|
;; too long.
|
|
|
|
|
(complete-length (+ inner-length rest-length))
|
|
|
|
|
(inner-short (if (and max-length
|
|
|
|
|
(<= complete-length max-length))
|
|
|
|
|
inner-format
|
|
|
|
|
(concat (substring
|
|
|
|
|
inner-format
|
|
|
|
|
0
|
|
|
|
|
(- inner-length
|
|
|
|
|
(- complete-length max-length)
|
|
|
|
|
4))
|
|
|
|
|
" ..."))))
|
|
|
|
|
;; Concat both parts.
|
|
|
|
|
(concat inner-short rest-format))
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
(defun semantic-idle-breadcrumbs--format-tag (tag &optional format-function)
|
|
|
|
|
"Format TAG using the configured function or FORMAT-FUNCTION.
|
|
|
|
|
This function also adds text properties for help-echo, mouse
|
|
|
|
|
highlighting and a keymap."
|
|
|
|
|
(let ((formatted (funcall
|
|
|
|
|
(or format-function
|
|
|
|
|
semantic-idle-breadcrumbs-format-tag-function)
|
|
|
|
|
tag nil t)))
|
|
|
|
|
(add-text-properties
|
|
|
|
|
0 (length formatted)
|
|
|
|
|
(list
|
|
|
|
|
'tag
|
|
|
|
|
tag
|
|
|
|
|
'help-echo
|
|
|
|
|
(format
|
|
|
|
|
"Tag %s
|
|
|
|
|
Type: %s
|
|
|
|
|
mouse-1: jump to tag
|
|
|
|
|
mouse-3: popup context menu"
|
|
|
|
|
(semantic-tag-name tag)
|
|
|
|
|
(semantic-tag-class tag))
|
|
|
|
|
'mouse-face
|
|
|
|
|
'highlight
|
|
|
|
|
'keymap
|
|
|
|
|
semantic-idle-breadcrumbs-popup-map)
|
|
|
|
|
formatted)
|
|
|
|
|
formatted))
|
|
|
|
|
|
|
|
|
|
|
2009-08-29 19:00:35 +00:00
|
|
|
|
(provide 'semantic/idle)
|
|
|
|
|
|
2009-09-05 23:25:26 +00:00
|
|
|
|
;; Local variables:
|
|
|
|
|
;; generated-autoload-file: "loaddefs.el"
|
|
|
|
|
;; generated-autoload-load-name: "semantic/idle"
|
|
|
|
|
;; End:
|
|
|
|
|
|
2011-11-03 21:03:45 +01:00
|
|
|
|
;;; semantic/idle.el ends here
|