diff options
| author | David Engster | 2012-10-25 22:13:16 +0200 |
|---|---|---|
| committer | David Engster | 2012-10-25 22:13:16 +0200 |
| commit | 3f2a848dbeb297cdadfc9dd3cff71bab24679b92 (patch) | |
| tree | 3641e34f25caf6b5a6eca8537afdd24ee074c6a3 /lisp/cedet/semantic | |
| parent | aaabfc8b2744aabe00b9fc97eaca59940b5afdeb (diff) | |
| download | emacs-3f2a848dbeb297cdadfc9dd3cff71bab24679b92.tar.gz emacs-3f2a848dbeb297cdadfc9dd3cff71bab24679b92.zip | |
Merge CEDET upstream.
* emacs-lisp/eieio.el (eieio-update-lisp-imenu-expression):
Removed. This feature is already integrated in imenu.
* emacs-lisp/eieio-opt.el: Remove require for `button' since it is
always loaded. Require `speedbar' unconditionally.
* semantic/analyze.el (semantic-analyze-dereference-alias): New
function to dereference aliases.
(semantic-analyze-current-context-default): Use it.
* semantic/grammar.el (semantic-grammar-create-package):
* srecode/compile.el (srecode-compile-templates): Throw a proper
error if semantic-mode is not enabled (bug#9968).
Compiler warning fixes:
* semantic.el (semantic-elapsed-time): Make it a defsubst.
* srecode/dictionary.el (srecode-adebug-dictionary): Remove
require for `semantic'.
* srecode/map.el:
* srecode/insert.el: Declare functions from `data-debug'.
* semantic/grammar.el: Require `help-fns'. Declare functions from
`eldoc', which is required in function body.
* srecode/java.el:
* semantic/texi.el:
* semantic/grammar-wy.el:
* semantic/db-file.el:
* semantic/db-el.el:
* semantic/chart.el: Fix requires.
* ede/locate.el: Remove useless requires. Declare functions
instead and require in functions when needed.
Diffstat (limited to 'lisp/cedet/semantic')
| -rw-r--r-- | lisp/cedet/semantic/analyze.el | 34 | ||||
| -rw-r--r-- | lisp/cedet/semantic/chart.el | 5 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db-el.el | 7 | ||||
| -rw-r--r-- | lisp/cedet/semantic/db-file.el | 5 | ||||
| -rw-r--r-- | lisp/cedet/semantic/grammar-wy.el | 5 | ||||
| -rw-r--r-- | lisp/cedet/semantic/grammar.el | 12 | ||||
| -rw-r--r-- | lisp/cedet/semantic/texi.el | 10 |
7 files changed, 48 insertions, 30 deletions
diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el index 63acc555343..d03c72a5983 100644 --- a/lisp/cedet/semantic/analyze.el +++ b/lisp/cedet/semantic/analyze.el | |||
| @@ -527,7 +527,7 @@ Returns an object based on symbol `semantic-analyze-context'." | |||
| 527 | (function nil) | 527 | (function nil) |
| 528 | (fntag nil) | 528 | (fntag nil) |
| 529 | arg fntagend argtag | 529 | arg fntagend argtag |
| 530 | assign asstag | 530 | assign asstag newseq |
| 531 | ) | 531 | ) |
| 532 | 532 | ||
| 533 | ;; Pattern for Analysis: | 533 | ;; Pattern for Analysis: |
| @@ -601,16 +601,26 @@ Returns an object based on symbol `semantic-analyze-context'." | |||
| 601 | 601 | ||
| 602 | (if debug-on-error | 602 | (if debug-on-error |
| 603 | (catch 'unfindable | 603 | (catch 'unfindable |
| 604 | ;; If debug on error is on, allow debugging in this fcn. | ||
| 605 | (setq prefix (semantic-analyze-find-tag-sequence | 604 | (setq prefix (semantic-analyze-find-tag-sequence |
| 606 | prefix scope 'prefixtypes 'unfindable))) | 605 | prefix scope 'prefixtypes 'unfindable)) |
| 606 | ;; If there's an alias, dereference it and analyze | ||
| 607 | ;; sequence again. | ||
| 608 | (when (setq newseq | ||
| 609 | (semantic-analyze-dereference-alias prefix)) | ||
| 610 | (setq prefix (semantic-analyze-find-tag-sequence | ||
| 611 | newseq scope 'prefixtypes 'unfindable)))) | ||
| 607 | ;; Debug on error is off. Capture errors and move on | 612 | ;; Debug on error is off. Capture errors and move on |
| 608 | (condition-case err | 613 | (condition-case err |
| 609 | ;; NOTE: This line is duplicated in | 614 | ;; NOTE: This line is duplicated in |
| 610 | ;; semantic-analyzer-debug-global-symbol | 615 | ;; semantic-analyzer-debug-global-symbol |
| 611 | ;; You will need to update both places. | 616 | ;; You will need to update both places. |
| 612 | (setq prefix (semantic-analyze-find-tag-sequence | 617 | (progn |
| 613 | prefix scope 'prefixtypes)) | 618 | (setq prefix (semantic-analyze-find-tag-sequence |
| 619 | prefix scope 'prefixtypes)) | ||
| 620 | (when (setq newseq | ||
| 621 | (semantic-analyze-dereference-alias prefix)) | ||
| 622 | (setq prefix (semantic-analyze-find-tag-sequence | ||
| 623 | newseq scope 'prefixtypes)))) | ||
| 614 | (error (semantic-analyze-push-error err)))) | 624 | (error (semantic-analyze-push-error err)))) |
| 615 | ) | 625 | ) |
| 616 | 626 | ||
| @@ -679,6 +689,20 @@ Returns an object based on symbol `semantic-analyze-context'." | |||
| 679 | ;; Return our context. | 689 | ;; Return our context. |
| 680 | context-return)) | 690 | context-return)) |
| 681 | 691 | ||
| 692 | (defun semantic-analyze-dereference-alias (taglist) | ||
| 693 | "Dereference first tag in TAGLIST if it is an alias. | ||
| 694 | Returns a sequence of names which can then be fed again into | ||
| 695 | `semantic-analyze-find-tag-sequence'. | ||
| 696 | Returns nil if no alias was found." | ||
| 697 | (when (eq (semantic-tag-get-attribute (car taglist) :kind) 'alias) | ||
| 698 | (let ((tagname | ||
| 699 | (semantic-analyze-split-name | ||
| 700 | (semantic-tag-name | ||
| 701 | (car (semantic-tag-get-attribute (car taglist) :members)))))) | ||
| 702 | (append (if (listp tagname) | ||
| 703 | tagname | ||
| 704 | (list tagname)) | ||
| 705 | (cdr taglist))))) | ||
| 682 | 706 | ||
| 683 | (defun semantic-adebug-analyze (&optional ctxt) | 707 | (defun semantic-adebug-analyze (&optional ctxt) |
| 684 | "Perform `semantic-analyze-current-context'. | 708 | "Perform `semantic-analyze-current-context'. |
diff --git a/lisp/cedet/semantic/chart.el b/lisp/cedet/semantic/chart.el index c6b13475862..2c6f7344acf 100644 --- a/lisp/cedet/semantic/chart.el +++ b/lisp/cedet/semantic/chart.el | |||
| @@ -26,12 +26,9 @@ | |||
| 26 | ;; the output of the semantic parser. | 26 | ;; the output of the semantic parser. |
| 27 | ;; | 27 | ;; |
| 28 | 28 | ||
| 29 | (require 'semantic) | ||
| 30 | (require 'chart) | 29 | (require 'chart) |
| 31 | (require 'semantic/db) | 30 | (require 'semantic/db) |
| 32 | (require 'semantic/tag) | 31 | (require 'semantic/find) |
| 33 | |||
| 34 | (eval-when-compile (require 'semantic/find)) | ||
| 35 | 32 | ||
| 36 | ;;; Code: | 33 | ;;; Code: |
| 37 | 34 | ||
diff --git a/lisp/cedet/semantic/db-el.el b/lisp/cedet/semantic/db-el.el index 281479045ea..dbb3bfae34d 100644 --- a/lisp/cedet/semantic/db-el.el +++ b/lisp/cedet/semantic/db-el.el | |||
| @@ -31,12 +31,7 @@ | |||
| 31 | ;; | 31 | ;; |
| 32 | 32 | ||
| 33 | (require 'semantic/db) | 33 | (require 'semantic/db) |
| 34 | 34 | (require 'eieio-opt) | |
| 35 | (eval-when-compile | ||
| 36 | ;; For generic function searching. | ||
| 37 | (require 'eieio) | ||
| 38 | (require 'eieio-opt) | ||
| 39 | (require 'eieio-base)) | ||
| 40 | 35 | ||
| 41 | (declare-function semantic-elisp-desymbolify "semantic/bovine/el") | 36 | (declare-function semantic-elisp-desymbolify "semantic/bovine/el") |
| 42 | (declare-function semantic-tag-similar-p "semantic/tag-ls") | 37 | (declare-function semantic-tag-similar-p "semantic/tag-ls") |
diff --git a/lisp/cedet/semantic/db-file.el b/lisp/cedet/semantic/db-file.el index 4f8e93dc391..905c62a89dd 100644 --- a/lisp/cedet/semantic/db-file.el +++ b/lisp/cedet/semantic/db-file.el | |||
| @@ -25,12 +25,9 @@ | |||
| 25 | ;; A set of semanticdb classes for persistently saving caches on disk. | 25 | ;; A set of semanticdb classes for persistently saving caches on disk. |
| 26 | ;; | 26 | ;; |
| 27 | 27 | ||
| 28 | (require 'semantic) | ||
| 29 | (require 'semantic/db) | 28 | (require 'semantic/db) |
| 30 | (require 'cedet-files) | 29 | (require 'cedet-files) |
| 31 | 30 | (require 'data-debug) | |
| 32 | (eval-when-compile | ||
| 33 | (require 'data-debug)) | ||
| 34 | 31 | ||
| 35 | (defvar semanticdb-file-version semantic-version | 32 | (defvar semanticdb-file-version semantic-version |
| 36 | "Version of semanticdb we are writing files to disk with.") | 33 | "Version of semanticdb we are writing files to disk with.") |
diff --git a/lisp/cedet/semantic/grammar-wy.el b/lisp/cedet/semantic/grammar-wy.el index 8a33c8c8a1a..a926f636b4b 100644 --- a/lisp/cedet/semantic/grammar-wy.el +++ b/lisp/cedet/semantic/grammar-wy.el | |||
| @@ -23,9 +23,8 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Code: | 24 | ;;; Code: |
| 25 | 25 | ||
| 26 | (require 'semantic/lex) | 26 | (require 'semantic) |
| 27 | (eval-when-compile (require 'semantic/bovine)) | 27 | |
| 28 | |||
| 29 | ;;; Prologue | 28 | ;;; Prologue |
| 30 | ;; | 29 | ;; |
| 31 | (defvar semantic-grammar-lex-c-char-re) | 30 | (defvar semantic-grammar-lex-c-char-re) |
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el index b85396a79ae..c0e7b8f9038 100644 --- a/lisp/cedet/semantic/grammar.el +++ b/lisp/cedet/semantic/grammar.el | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | (require 'semantic/format) | 35 | (require 'semantic/format) |
| 36 | (require 'semantic/grammar-wy) | 36 | (require 'semantic/grammar-wy) |
| 37 | (require 'semantic/idle) | 37 | (require 'semantic/idle) |
| 38 | (require 'help-fns) | ||
| 38 | 39 | ||
| 39 | (declare-function semantic-momentary-highlight-tag "semantic/decorate") | 40 | (declare-function semantic-momentary-highlight-tag "semantic/decorate") |
| 40 | (declare-function semantic-analyze-context "semantic/analyze") | 41 | (declare-function semantic-analyze-context "semantic/analyze") |
| @@ -47,6 +48,9 @@ | |||
| 47 | (require 'semantic/find) | 48 | (require 'semantic/find) |
| 48 | (require 'semantic/db)) | 49 | (require 'semantic/db)) |
| 49 | 50 | ||
| 51 | (declare-function semantic-grammar-wy--install-parser | ||
| 52 | "semantic/gram-wy-fallback") | ||
| 53 | |||
| 50 | 54 | ||
| 51 | ;;;; | 55 | ;;;; |
| 52 | ;;;; Set up lexer | 56 | ;;;; Set up lexer |
| @@ -825,6 +829,8 @@ Does nothing if the Lisp code seems up to date. | |||
| 825 | If optional argument FORCE is non-nil, unconditionally re-generate the | 829 | If optional argument FORCE is non-nil, unconditionally re-generate the |
| 826 | Lisp code." | 830 | Lisp code." |
| 827 | (interactive "P") | 831 | (interactive "P") |
| 832 | (unless (semantic-active-p) | ||
| 833 | (error "You have to activate semantic-mode to create a package.")) | ||
| 828 | (setq force (or force current-prefix-arg)) | 834 | (setq force (or force current-prefix-arg)) |
| 829 | (semantic-fetch-tags) | 835 | (semantic-fetch-tags) |
| 830 | (let* ( | 836 | (let* ( |
| @@ -1636,6 +1642,12 @@ Select the buffer containing the tag's definition, and move point there." | |||
| 1636 | ) | 1642 | ) |
| 1637 | "Association of syntax elements, and the corresponding help.") | 1643 | "Association of syntax elements, and the corresponding help.") |
| 1638 | 1644 | ||
| 1645 | (declare-function eldoc-function-argstring "eldoc") | ||
| 1646 | (declare-function eldoc-docstring-format-sym-doc "eldoc") | ||
| 1647 | (declare-function eldoc-last-data-store "eldoc") | ||
| 1648 | (declare-function eldoc-get-fnsym-args-string "eldoc") | ||
| 1649 | (declare-function eldoc-get-var-docstring "eldoc") | ||
| 1650 | |||
| 1639 | (defun semantic-grammar-eldoc-get-macro-docstring (macro expander) | 1651 | (defun semantic-grammar-eldoc-get-macro-docstring (macro expander) |
| 1640 | "Return a one-line docstring for the given grammar MACRO. | 1652 | "Return a one-line docstring for the given grammar MACRO. |
| 1641 | EXPANDER is the name of the function that expands MACRO." | 1653 | EXPANDER is the name of the function that expands MACRO." |
diff --git a/lisp/cedet/semantic/texi.el b/lisp/cedet/semantic/texi.el index 9380940282f..d79e71bb265 100644 --- a/lisp/cedet/semantic/texi.el +++ b/lisp/cedet/semantic/texi.el | |||
| @@ -26,17 +26,11 @@ | |||
| 26 | ;; parser plug-in is the function `semantic-texi-parse-region' that | 26 | ;; parser plug-in is the function `semantic-texi-parse-region' that |
| 27 | ;; overrides `semantic-parse-region'. | 27 | ;; overrides `semantic-parse-region'. |
| 28 | 28 | ||
| 29 | (require 'semantic) | 29 | (require 'semantic/db-find) |
| 30 | (require 'semantic/format) | 30 | (require 'semantic/format) |
| 31 | (require 'semantic/ctxt) | ||
| 31 | (require 'texinfo) | 32 | (require 'texinfo) |
| 32 | 33 | ||
| 33 | (eval-when-compile | ||
| 34 | (require 'semantic/db) | ||
| 35 | (require 'semantic/db-find) | ||
| 36 | (require 'semantic/ctxt) | ||
| 37 | (require 'semantic/find) | ||
| 38 | (require 'semantic/doc)) | ||
| 39 | |||
| 40 | (defvar ede-minor-mode) | 34 | (defvar ede-minor-mode) |
| 41 | (declare-function lookup-words "ispell") | 35 | (declare-function lookup-words "ispell") |
| 42 | (declare-function ede-current-project "ede") | 36 | (declare-function ede-current-project "ede") |