From: Chong Yidong Date: Wed, 2 Sep 2009 04:37:10 +0000 (+0000) Subject: lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el. X-Git-Url: http://git.hcoop.net/bpt/emacs.git/commitdiff_plain/3d9d848682f41fff87e19103f8b12968e9ba14e3?hp=5fcb5c7e2aa0e7f2ade1228fe17ae06d554894dc lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el. lisp/emacs-lisp/autoload.el (generated-autoload-feature): New var. (autoload-rubric): Use it. lisp/cedet/semantic/adebug.el (data-debug-insert-find-results-button): Require db-find. lisp/cedet/semantic/analyze.el: Require semantic/tag. Don't declare autoloaded functions. lisp/cedet/semantic/chart.el: Don't declare autoloaded functions. lisp/cedet/semantic/complete.el: eval-when-compile semantic/find for macro. (semantic-collector-calculate-completions-raw): Require semantic/db-find. lisp/cedet/semantic/ctxt.el (semantic-up-context): Require semantic/find. Don't require it at top-level. lisp/cedet/semantic/db-ebrowse.el (semanticdb-ebrowse-dump): Require data-debug. Don't require it at top-level. Don't require semantic/sort. lisp/cedet/semantic/db-find.el: Add local vars for autoloading. Don't require semantic/tag-file and semantic/sort. (semanticdb-find-default-throttle, semanticdb-find-result-length) (semanticdb-find-result-nth, semanticdb-find-result-nth-in-buffer) (semanticdb-find-tags-by-name, semanticdb-find-tags-for-completion) (semanticdb-find-translate-path, semanticdb-find-table-for-include): Autoload. lisp/cedet/semantic/db-ref.el: Require semantic and semantic/tag. (semanticdb-ref-test): Require data-debug. Don't require it at top-level. lisp/cedet/semantic/db-typecache.el: Require semantic and semantic/tag. Declare semantic-sort-tags-by-name-then-type-increasing and semantic-scope-tag-clone-with-scope. eval-when-compile semantic/find for semantic-find-tags-by-* macros. Add local vars for autoloading. (semanticdb-typecache-find): Autoload. lisp/cedet/semantic/db.el: Add local vars for autoloading. (semanticdb-current-database, semanticdb-current-table) (semanticdb-file-table-object): Autoload. lisp/cedet/semantic/decorate.el: Don't requirements for autoloaded functions. lisp/cedet/semantic/doc.el: Add local vars for autoloading. (semantic-documentation-for-tag): Autoload. lisp/cedet/semantic/edit.el: Drop requirements for autoloaded functions. lisp/cedet/semantic/find.el: Add local vars for autoloading. (semantic-current-tag, semantic-find-tag-by-overlay) (semantic-find-first-tag-by-name): Autoload. lisp/cedet/semantic/format.el: Add local vars for autoloading. (semantic-format-tag-name, semantic-format-tag-custom-list) (semantic-format-tag-functions): Autoload. lisp/cedet/semantic/fw.el: Require semantic/loaddefs. lisp/cedet/semantic/html.el (semantic-html-recursive-combobulate-list): Use assoc-string instead of assoc-case. lisp/cedet/semantic/ia.el (semantic-ia-insert-tag): Move up to avoid compiler error. (semantic-ia-complete-symbol-menu): Require imenu. (semantic-ia-fast-jump): Require semantic/decorate/include. lisp/cedet/semantic/idle.el: Require semantic and semantic/tag. Declare semanticdb-typecache-refresh-for-buffer and eldoc-message. eval-when-compile semantic/find for semantic-find-tags-by-name macro. lisp/cedet/semantic/sort.el: Add local vars for autoloading. (semantic-flatten-tags-table, semantic-tag-external-member-parent): Autoload. lisp/cedet/semantic/tag-file.el: Add local vars for autoloading. (semantic-go-to-tag, semantic-dependency-tag-file): Autoload. lisp/cedet/semantic/tag-ls.el: Add local vars for autoloading. (semantic-tag-prototype-p): Autoload. lisp/cedet/semantic/tag.el: Don't declare autoloaded functions. lisp/cedet/semantic/analyze/complete.el: Add local variables for autoloading. (semantic-analyze-possible-completions): Autoload. lisp/cedet/semantic/analyze/fcn.el: Require mode-local. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0427c319c9..52aeab38dd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,4 +1,10 @@ -2009-08-22 Chong Yidong +2009-09-02 Chong Yidong + + * emacs-lisp/autoload.el (generated-autoload-feature): New var. + (autoload-rubric): Use it. + + * Makefile.in (setwins): Ignore CEDET subdirectories when making + subdirs.el. * emacs-lisp/cl-loaddefs.el (deftype): Add autoload for deftype. diff --git a/lisp/Makefile.in b/lisp/Makefile.in index d83b2660bf..c75e2dac12 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -91,6 +91,16 @@ setwins_almost=subdirs=`(cd $$wd; find . -type d -print)`; \ esac; \ done +# Find all subdirectories except `cedet' + +setwins_nocedet=subdirs=`(cd $$wd; find . -type d -print)`; \ + for file in $$subdirs; do \ + case $$file in */Old | */RCS | */CVS | */CVS/* | */.* | */.*/* | */=* | */cedet* ) ;; \ + *) wins="$$wins $$wd/$$file" ;; \ + esac; \ + done + + # `compile-main' tends to be slower than `recompile' but can be parallelized # with "make -j" and results in more deterministic compilation warnings. # cus-load and finder-inf are not explicitly requested by anything, so @@ -143,7 +153,7 @@ autoloads: $(LOADDEFS) doit $(lisp)/subdirs.el: $(MAKE) $(MFLAGS) update-subdirs update-subdirs: doit - wd=$(lisp); $(setwins); \ + wd=$(lisp); $(setwins_nocedet); \ for file in $$wins; do \ $(srcdir)/update-subdirs $$file; \ done; diff --git a/lisp/cedet/semantic/adebug.el b/lisp/cedet/semantic/adebug.el index 7756ffb93d..fa474d3a0f 100644 --- a/lisp/cedet/semantic/adebug.el +++ b/lisp/cedet/semantic/adebug.el @@ -206,10 +206,13 @@ PARENT is the tag that represents the parent of all the tags." (goto-char start) )) +(declare-function semanticdb-find-result-prin1-to-string "semantic/db-find") + (defun data-debug-insert-find-results-button (findres prefix prebuttontext) "Insert a single summary of a find results FINDRES. PREFIX is the text that preceeds the button. PREBUTTONTEXT is some text between prefix and the find results button." + (require 'semantic/db-find) (let ((start (point)) (end nil) (str (semanticdb-find-result-prin1-to-string findres)) diff --git a/lisp/cedet/semantic/analyze.el b/lisp/cedet/semantic/analyze.el index c55186b3b0..23c6169b7e 100644 --- a/lisp/cedet/semantic/analyze.el +++ b/lisp/cedet/semantic/analyze.el @@ -71,13 +71,9 @@ (require 'semantic/sort) (eval-when-compile (require 'semantic/find)) (require 'semantic/scope) +(require 'semantic/tag) (require 'semantic/analyze/fcn) -;; `semanticdb-typecache-find' autoloads from semantic/db-typecache, -;; which requires semantic/db-find. -(declare-function semanticdb-strip-find-results "semantic/db-find") -(declare-function semanticdb-find-tags-by-name "semantic/db-find") - ;;; Code: (defvar semantic-analyze-error-stack nil "Collection of any errors thrown during analysis.") diff --git a/lisp/cedet/semantic/analyze/complete.el b/lisp/cedet/semantic/analyze/complete.el index a01814b666..ee0a807ef3 100644 --- a/lisp/cedet/semantic/analyze/complete.el +++ b/lisp/cedet/semantic/analyze/complete.el @@ -76,7 +76,7 @@ Used as options when completing.") ;;; MAIN completion calculator ;; -;; +;;;###autoload (define-overloadable-function semantic-analyze-possible-completions (context) "Return a list of semantic tags which are possible completions. CONTEXT is either a position (such as point), or a precalculated @@ -266,8 +266,11 @@ Argument CONTEXT is an object specifying the locally derived context." c)) - - (provide 'semantic/analyze/complete) +;; Local variables: +;; generated-autoload-file: "../loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic/analyze/complete.el ends here diff --git a/lisp/cedet/semantic/analyze/fcn.el b/lisp/cedet/semantic/analyze/fcn.el index e2e0502407..304ab12cbe 100644 --- a/lisp/cedet/semantic/analyze/fcn.el +++ b/lisp/cedet/semantic/analyze/fcn.el @@ -25,6 +25,8 @@ ;;; Code: +(require 'mode-local) + ;;; Small Mode Specific Options ;; ;; These queries allow a major mode to help the analyzer make decisions. diff --git a/lisp/cedet/semantic/chart.el b/lisp/cedet/semantic/chart.el index d920121286..ec7685916c 100644 --- a/lisp/cedet/semantic/chart.el +++ b/lisp/cedet/semantic/chart.el @@ -28,9 +28,14 @@ (require 'chart) (require 'semantic) -(require 'semantic/db-mode) -(require 'semantic/db-typecache) -(require 'semantic/scope) +(require 'semantic/db) +(require 'semantic/tag) + +(eval-when-compile (require 'semantic/find)) + +;; (require 'semantic/db-mode) +;; (require 'semantic/db-typecache) +;; (require 'semantic/scope) ;;; Code: @@ -63,9 +68,9 @@ Each bar represents how many toplevel tags in TAGTABLE exist in each database entry. TAGTABLE is passed to `semantic-something-to-tag-table'." (interactive) - (if (or (not (fboundp 'semanticdb-minor-mode-p)) - (not (semanticdb-minor-mode-p))) - (error "Semanticdb is not enabled")) + (unless (and (fboundp 'semanticdb-minor-mode-p) + (semanticdb-minor-mode-p)) + (error "Semanticdb is not enabled")) (let* ((db semanticdb-current-database) (dbt (semanticdb-get-database-tables db)) (names (mapcar 'car @@ -142,9 +147,14 @@ items are charted. TAGTABLE is passedto nums "Complexity (Lines of code)") )) +(declare-function semanticdb-get-typecache "semantic/db-typecache") +(declare-function semantic-calculate-scope "semantic/scope") + (defun semantic-chart-analyzer () "Chart the extent of the context analysis." (interactive) + (require 'semantic/db-typecache) + (require 'semantic/scope) (let* ((p (semanticdb-find-translate-path nil nil)) (plen (length p)) (tab semanticdb-current-table) diff --git a/lisp/cedet/semantic/complete.el b/lisp/cedet/semantic/complete.el index f0fd80e088..fce7613902 100644 --- a/lisp/cedet/semantic/complete.el +++ b/lisp/cedet/semantic/complete.el @@ -109,17 +109,16 @@ (require 'eieio) (require 'eieio-opt) -(require 'semantic/tag-file) +(require 'semantic) (require 'semantic/analyze) -(require 'semantic/format) (require 'semantic/ctxt) -;; Keep semanticdb optional. -;; (eval-when-compile -;; (require 'semantic/db) -;; (require 'semantic/db-find)) (require 'semantic/decorate) -(require 'semantic/analyze/complete) +(require 'semantic/format) +(require 'semantic/tag) +(eval-when-compile + ;; For the semantic-find-tags-for-completion macro. + (require 'semantic/find)) (eval-when-compile (condition-case nil @@ -1211,9 +1210,13 @@ Uses semanticdb for searching all tags in the current project." () "Completion engine for tags in a project.") +(declare-function semanticdb-brute-deep-find-tags-for-completion + "semantic/db-find") + (defmethod semantic-collector-calculate-completions-raw ((obj semantic-collector-project-brutish) prefix completionlist) "Calculate the completions for prefix from completionlist." + (require 'semantic/db-find) (semanticdb-brute-deep-find-tags-for-completion prefix (oref obj path))) (defclass semantic-collector-analyze-completions (semantic-collector-abstract) diff --git a/lisp/cedet/semantic/ctxt.el b/lisp/cedet/semantic/ctxt.el index 40da8153ae..852bd24233 100644 --- a/lisp/cedet/semantic/ctxt.el +++ b/lisp/cedet/semantic/ctxt.el @@ -31,7 +31,6 @@ ;; the current context is calculated. ;; (require 'semantic) -(require 'semantic/find) ;;; Code: (defvar semantic-command-separation-character @@ -50,6 +49,8 @@ Used for identifying arguments to functions.") ;; ;; These context are nested blocks of code, such as code in an ;; if clause +(declare-function semantic-current-tag-of-class "semantic/find") + (define-overloadable-function semantic-up-context (&optional point bounds-type) "Move point up one context from POINT. Return non-nil if there are no more context levels. @@ -59,6 +60,7 @@ movement to. If this is nil, 'function is used. This will find the smallest tag of that class (function, variable, type, etc) and make sure non-nil is returned if you cannot go up past the bounds of that tag." + (require 'semantic/find) (if point (goto-char point)) (let ((nar (semantic-current-tag-of-class (or bounds-type 'function)))) (if nar diff --git a/lisp/cedet/semantic/db-ebrowse.el b/lisp/cedet/semantic/db-ebrowse.el index bccd6748a2..dcd27e786e 100644 --- a/lisp/cedet/semantic/db-ebrowse.el +++ b/lisp/cedet/semantic/db-ebrowse.el @@ -57,10 +57,10 @@ ) (require 'semantic/db-file) (require 'semantic/find) -(require 'semantic/sort) -(require 'data-debug) (declare-function semantic-add-system-include "semantic/dep") +(declare-function data-debug-new-buffer "data-debug") +(declare-function data-debug-insert-thing "data-debug") (eval-and-compile ;; Hopefully, this will allow semanticdb-ebrowse to compile under @@ -698,6 +698,7 @@ run the test again..") (defun semanticdb-ebrowse-dump () "Find the first loaded ebrowse table, and dump out the contents." (interactive) + (require 'data-debug) (let ((db semanticdb-database-list) (ab nil)) (while db diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el index 65028545ed..6d4fdc1fcc 100644 --- a/lisp/cedet/semantic/db-find.el +++ b/lisp/cedet/semantic/db-find.el @@ -121,9 +121,6 @@ (require 'eieio) (require 'semantic/find)) -(require 'semantic/tag-file) -(require 'semantic/sort) - ;;; Code: (defvar data-debug-thing-alist) @@ -261,6 +258,7 @@ This class will cache data derived during various searches.") ;; These routines needed to be overloaded by specific language modes. ;; They are needed for translating an INCLUDE tag into a semanticdb ;; TABLE object. +;;;###autoload (define-overloadable-function semanticdb-find-translate-path (path brutish) "Translate PATH into a list of semantic tables. Path translation involves identifying the PATH input argument @@ -314,6 +312,7 @@ Default action as described in `semanticdb-find-translate-path'." (semanticdb-find-translate-path-brutish-default path) (semanticdb-find-translate-path-includes-default path)))) +;;;###autoload (define-overloadable-function semanticdb-find-table-for-include (includetag &optional table) "For a single INCLUDETAG found in TABLE, find a `semanticdb-table' object INCLUDETAG is a semantic TAG of class 'include. @@ -855,6 +854,7 @@ Examines the variable `semanticdb-find-lost-includes'." ;; Once you have a search result, use these routines to operate ;; on the search results at a higher level +;;;###autoload (defun semanticdb-strip-find-results (results &optional find-file-match) "Strip a semanticdb search RESULTS to exclude objects. This makes it appear more like the results of a `semantic-find-' call. @@ -952,6 +952,7 @@ but should be good enough for debugging assertions." (null tag-to-test)))) ))) +;;;###autoload (defun semanticdb-find-result-length (result) "Number of tags found in RESULT." (let ((count 0)) @@ -960,6 +961,7 @@ but should be good enough for debugging assertions." result) count)) +;;;###autoload (defun semanticdb-find-result-nth (result n) "In RESULT, return the Nth search result. This is a 0 based search result, with the first match being element 0. @@ -996,6 +998,7 @@ the TAG was found. Sometimes TABLE can be nil." (error "%d entry is not a tag" i))) (setq i (1+ i))))) +;;;###autoload (defun semanticdb-find-result-nth-in-buffer (result n) "In RESULT, return the Nth search result. Like `semanticdb-find-result-nth', except that only the TAG @@ -1160,6 +1163,7 @@ and search all tables in this project tree." ;; It must be reversed. (nreverse found))) +;;;###autoload (defun semanticdb-find-tags-by-name (name &optional path find-file-match) "Search for all tags matching NAME on PATH. See `semanticdb-find-translate-path' for details on PATH. @@ -1170,6 +1174,7 @@ associated with that tag should be loaded into a buffer." (semanticdb-find-tags-by-name-method table name tags)) path find-file-match)) +;;;###autoload (defun semanticdb-find-tags-by-name-regexp (regexp &optional path find-file-match) "Search for all tags matching REGEXP on PATH. See `semanticdb-find-translate-path' for details on PATH. @@ -1180,6 +1185,7 @@ associated with that tag should be loaded into a buffer." (semanticdb-find-tags-by-name-regexp-method table regexp tags)) path find-file-match)) +;;;###autoload (defun semanticdb-find-tags-for-completion (prefix &optional path find-file-match) "Search for all tags matching PREFIX on PATH. See `semanticdb-find-translate-path' for details on PATH. @@ -1190,6 +1196,7 @@ associated with that tag should be loaded into a buffer." (semanticdb-find-tags-for-completion-method table prefix tags)) path find-file-match)) +;;;###autoload (defun semanticdb-find-tags-by-class (class &optional path find-file-match) "Search for all tags of CLASS on PATH. See `semanticdb-find-translate-path' for details on PATH. @@ -1235,6 +1242,7 @@ associated with that tag should be loaded into a buffer." path find-file-match)) ;;; Brutish Search Routines +;; (defun semanticdb-brute-deep-find-tags-by-name (name &optional path find-file-match) "Search for all tags matching NAME on PATH. See `semanticdb-find-translate-path' for details on PATH. @@ -1363,4 +1371,9 @@ Return a table of all matching tags." (provide 'semantic/db-find) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic/db-find.el ends here diff --git a/lisp/cedet/semantic/db-ref.el b/lisp/cedet/semantic/db-ref.el index 45f87edbc6..0928668651 100644 --- a/lisp/cedet/semantic/db-ref.el +++ b/lisp/cedet/semantic/db-ref.el @@ -37,13 +37,14 @@ ;;; Code: (require 'eieio) -(require 'semantic/db) -(require 'semantic/util) +(require 'semantic) +(require 'semantic/tag) (defvar semanticdb-find-default-throttle) ;; For the semantic-find-tags-by-name-regexp macro. (eval-when-compile (require 'semantic/find)) + (defvar semantic-case-fold) (defmethod semanticdb-add-reference ((dbt semanticdb-abstract-table) @@ -157,7 +158,6 @@ If REFRESH is non-nil, cause the current table to have it's references refreshed before dumping the result." (interactive "p") (require 'data-debug) - (require 'semantic/db) ;; If we need to refresh... then do so. (when refresh (semanticdb-refresh-references semanticdb-current-table)) diff --git a/lisp/cedet/semantic/db-typecache.el b/lisp/cedet/semantic/db-typecache.el index a0827ee0fe..db2f260d5d 100644 --- a/lisp/cedet/semantic/db-typecache.el +++ b/lisp/cedet/semantic/db-typecache.el @@ -28,14 +28,21 @@ ;; ;; It is likely this feature will only be needed for C/C++. +(require 'semantic) (require 'semantic/db) (require 'semantic/db-find) -(require 'semantic/tag-ls) +(require 'semantic/tag) (require 'semantic/analyze/fcn) -(require 'semantic/scope) + +;; For semantic-find-tags-by-* macros +(eval-when-compile (require 'semantic/find)) + +;; (require 'semantic/scope) (declare-function data-debug-insert-thing "data-debug") (declare-function data-debug-new-buffer "data-debug") +(declare-function semantic-sort-tags-by-name-then-type-increasing "semantic/sort") +(declare-function semantic-scope-tag-clone-with-scope "semantic/scope") ;;; Code: @@ -225,6 +232,7 @@ Adds a filename and copies the tags." ;; Assume we always have datatypes, as this typecache isn't really ;; useful without a typed language. + (require 'semantic/sort) (let ((S (semantic-sort-tags-by-name-then-type-increasing ;; I used to use append, but it copied cache1 but not cache2. ;; Since sort was permuting cache2, I already had to make sure @@ -365,7 +373,7 @@ a master list." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Search Routines -;; +;;;###autoload (define-overloadable-function semanticdb-typecache-find (type &optional path find-file-match) "Search the typecache for TYPE in PATH. If type is a string, split the string, and search for the parts. @@ -496,8 +504,10 @@ found tag to be loaded." (if (and lastans calculated-scope) ;; Put our discovered scope into the tag if we have a tag - (semantic-scope-tag-clone-with-scope - lastans (reverse (cdr calculated-scope))) + (progn + (require 'semantic/scope) + (semantic-scope-tag-clone-with-scope + lastans (reverse (cdr calculated-scope)))) ;; Else, just return lastans @@ -586,6 +596,11 @@ If there isn't one, create it. )) - (provide 'semantic/db-typecache) + +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semanticdb-typecache.el ends here diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index ea544f7364..352d3d0cf1 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el @@ -59,10 +59,12 @@ mechanism.") This can be changed to try out new types of search indicies.") (make-variable-buffer-local 'semanticdb-default-find=index-class) +;;;###autoload (defvar semanticdb-current-database nil "For a given buffer, this is the currently active database.") (make-variable-buffer-local 'semanticdb-current-database) +;;;###autoload (defvar semanticdb-current-table nil "For a given buffer, this is the currently active database table.") (make-variable-buffer-local 'semanticdb-current-table) @@ -849,6 +851,7 @@ Does not use `file-truename'." "For FILE, associate DBTABLE in the hash table." (puthash file dbtable semanticdb-file-table-hash)) +;;;###autoload (defun semanticdb-file-table-object (file &optional dontload) "Return a semanticdb table belonging to FILE, make it up to date. If file has database tags available in the database, return it. @@ -1010,4 +1013,9 @@ If file does not have tags available, then load the file, and create them." (provide 'semantic/db) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic/db.el ends here diff --git a/lisp/cedet/semantic/decorate.el b/lisp/cedet/semantic/decorate.el index ba86176f00..4623332c56 100644 --- a/lisp/cedet/semantic/decorate.el +++ b/lisp/cedet/semantic/decorate.el @@ -29,7 +29,6 @@ ;; (require 'semantic) -(require 'semantic/tag-file) (require 'pulse) ;;; Code: @@ -310,7 +309,6 @@ nil implies the tag should be fully shown." (defun semantic-set-tag-folded-isearch (overlay) "Called by isearch if it discovers text in the folded region. OVERLAY is passed in by isearch." - (require 'semantic/find) (semantic-set-tag-folded (semantic-current-tag) nil) ) diff --git a/lisp/cedet/semantic/doc.el b/lisp/cedet/semantic/doc.el index b5574548ab..c9037ba83e 100644 --- a/lisp/cedet/semantic/doc.el +++ b/lisp/cedet/semantic/doc.el @@ -30,11 +30,10 @@ ;; the symbol on the same line. (require 'semantic/tag) -(require 'semantic/tag-file) -(require 'semantic/find) ;;; Code: +;;;###autoload (define-overloadable-function semantic-documentation-for-tag (&optional tag nosnarf) "Find documentation from TAG and return it as a clean string. TAG might have DOCUMENTATION set in it already. If not, there may be @@ -127,4 +126,9 @@ If NOSNARF is 'lex, then return the lex token." (provide 'semantic/doc) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic/doc.el ends here diff --git a/lisp/cedet/semantic/edit.el b/lisp/cedet/semantic/edit.el index 580d7ba253..79cfe185de 100644 --- a/lisp/cedet/semantic/edit.el +++ b/lisp/cedet/semantic/edit.el @@ -59,8 +59,6 @@ ;; (require 'semantic) -(require 'semantic/find) -(require 'semantic/format) ;;; Code: (defvar semantic-after-partial-cache-change-hook nil diff --git a/lisp/cedet/semantic/find.el b/lisp/cedet/semantic/find.el index 4751c3e1c2..a8351baa51 100644 --- a/lisp/cedet/semantic/find.el +++ b/lisp/cedet/semantic/find.el @@ -53,6 +53,8 @@ ;; ;; These routines provide fast access to tokens based on a buffer that ;; has parsed tokens in it. Uses overlays to perform the hard work. + +;;;###autoload (defun semantic-find-tag-by-overlay (&optional positionormarker buffer) "Find all tags covering POSITIONORMARKER by using overlays. If POSITIONORMARKER is nil, use the current point. @@ -79,6 +81,7 @@ from largest to smallest via the start location." (sort ret (lambda (a b) (< (semantic-tag-start a) (semantic-tag-start b))))))) +;;;###autoload (defun semantic-find-tag-by-overlay-in-region (start end &optional buffer) "Find all tags which exist in whole or in part between START and END. Uses overlays to determine positin. @@ -97,6 +100,7 @@ Optional BUFFER argument specifies the buffer to use." (sort ret (lambda (a b) (< (semantic-tag-start a) (semantic-tag-start b))))))) +;;;###autoload (defun semantic-find-tag-by-overlay-next (&optional start buffer) "Find the next tag after START in BUFFER. If START is in an overlay, find the tag which starts next, @@ -123,6 +127,7 @@ not the current tag." (when (and ol (semantic-tag-p (semantic-overlay-get ol 'semantic))) (semantic-overlay-get ol 'semantic))))) +;;;###autoload (defun semantic-find-tag-by-overlay-prev (&optional start buffer) "Find the next tag before START in BUFFER. If START is in an overlay, find the tag which starts next, @@ -152,6 +157,7 @@ not the current tag." (semantic-tag-p (semantic-overlay-get ol 'semantic))) (semantic-overlay-get ol 'semantic))))) +;;;###autoload (defun semantic-find-tag-parent-by-overlay (tag) "Find the parent of TAG by overlays. Overlays are a fast way of finding this information for active buffers." @@ -162,6 +168,7 @@ Overlays are a fast way of finding this information for active buffers." ;; the same start unless they are siblings. (car (cdr tag)))) +;;;###autoload (defun semantic-current-tag () "Return the current tag in the current buffer. If there are more than one in the same location, return the @@ -249,8 +256,9 @@ TABLE is a semantic tags table. See `semantic-something-to-tag-table'." (nreverse result))) ;;; Top level Searches -;; -(defsubst semantic-find-first-tag-by-name (name &optional table) + +;;;###autoload +(defun semantic-find-first-tag-by-name (name &optional table) "Find the first tag with NAME in TABLE. NAME is a string. TABLE is a semantic tags table. See `semantic-something-to-tag-table'. @@ -399,7 +407,6 @@ attempting to do completions." "Find all tags in whose parent is TYPE in TABLE. These tags are defined outside the scope of the original TYPE declaration. TABLE is a tag table. See `semantic-something-to-tag-table'." - (require 'semantic/sort) (semantic--find-tags-by-macro (equal (semantic-tag-external-member-parent (car tags)) type) @@ -796,7 +803,11 @@ Optional argument ARG is the number of iterations to run." (car b-comp)) )) - (provide 'semantic/find) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic/find.el ends here diff --git a/lisp/cedet/semantic/format.el b/lisp/cedet/semantic/format.el index 2e4f16a509..52cd0f841e 100644 --- a/lisp/cedet/semantic/format.el +++ b/lisp/cedet/semantic/format.el @@ -45,6 +45,7 @@ ;;; Tag to text overload functions ;; ;; abbreviations, prototypes, and coloring support. +;;;###autoload (defvar semantic-format-tag-functions '(semantic-format-tag-name semantic-format-tag-canonical-name @@ -70,6 +71,7 @@ COLOR indicates that the generated text should be colored using (semantic-varalias-obsolete 'semantic-token->text-functions 'semantic-format-tag-functions) +;;;###autoload (defvar semantic-format-tag-custom-list (append '(radio) (mapcar (lambda (f) (list 'const f)) @@ -95,6 +97,7 @@ Images can be used as icons instead of some types of text strings." "Text used to separate names when between namespaces/classes and functions.") (make-variable-buffer-local 'semantic-format-parent-separator) +;;;###autoload (define-overloadable-function semantic-format-tag-name (tag &optional parent color) "Return the name string describing TAG. The name is the shortest possible representation. @@ -785,4 +788,9 @@ Optional argument COLOR means highlight the prototype with font-lock colors." (provide 'semantic/format) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic/format.el ends here diff --git a/lisp/cedet/semantic/fw.el b/lisp/cedet/semantic/fw.el index 8909da3ac2..b960a4274e 100644 --- a/lisp/cedet/semantic/fw.el +++ b/lisp/cedet/semantic/fw.el @@ -31,6 +31,7 @@ ;; (require 'mode-local) (require 'eieio) +(require 'semantic/loaddefs) ;;; Compatibility ;; diff --git a/lisp/cedet/semantic/html.el b/lisp/cedet/semantic/html.el index 012dd8e9db..a815792c64 100644 --- a/lisp/cedet/semantic/html.el +++ b/lisp/cedet/semantic/html.el @@ -1,4 +1,4 @@ -;;; html.el --- Semantic details for html files +;;; semantic/html.el --- Semantic details for html files ;;; Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. @@ -184,8 +184,8 @@ tag with greater section value than LEVEL is found." (goto-char (car oldl)) (if (looking-at "<\\(\\w+\\)") (let* ((word (match-string 1)) - (levelmatch (assoc-ignore-case - word semantic-html-section-list)) + (levelmatch (assoc-string + word semantic-html-section-list t)) text begin tmp ) (when (not levelmatch) @@ -260,4 +260,4 @@ tag with greater section value than LEVEL is found." (provide 'semantic/html) -;;; semantic-html.el ends here +;;; semantic/html.el ends here diff --git a/lisp/cedet/semantic/ia.el b/lisp/cedet/semantic/ia.el index 5db798685e..d060f47842 100644 --- a/lisp/cedet/semantic/ia.el +++ b/lisp/cedet/semantic/ia.el @@ -42,6 +42,8 @@ (require 'semantic/analyze) (require 'semantic/analyze/refs)) +(declare-function imenu--mouse-menu "imenu") + ;;; Code: ;;; COMPLETION @@ -63,6 +65,30 @@ of semantic tag names that provide logical completions from that location.") (make-variable-buffer-local 'semantic-ia-cache) +;;; COMPLETION HELPER +;; +;; This overload function handles inserting a tag +;; into a buffer for these local completion routines. +;; +;; By creating the functions as overloadable, it can be +;; customized. For example, the default will put a paren "(" +;; character after function names. For Lisp, it might check +;; to put a "(" in front of a function name. + +(define-overloadable-function semantic-ia-insert-tag (tag) + "Insert TAG into the current buffer based on completion.") + +(defun semantic-ia-insert-tag-default (tag) + "Insert TAG into the current buffer based on completion." + (insert (semantic-tag-name tag)) + (let ((tt (semantic-tag-class tag))) + (cond ((eq tt 'function) + (insert "(")) + (t nil)))) + +(declare-function semantic-analyze-possible-completions + "semantic/analyze/complete") + (defun semantic-ia-get-completions (context point) "Fetch the completion of CONTEXT at POINT. Supports caching." @@ -143,6 +169,7 @@ Completion options are calculated with `semantic-analyze-possible-completions'." "Complete the current symbol via a menu based at POINT. Completion options are calculated with `semantic-analyze-possible-completions'." (interactive "d") + (require 'imenu) (let* ((a (semantic-analyze-current-context point)) (syms (semantic-ia-get-completions a point)) ) @@ -176,27 +203,6 @@ Completion options are calculated with `semantic-analyze-possible-completions'." (semantic-ia-insert-tag ans)) )))) -;;; COMPLETION HELPER -;; -;; This overload function handles inserting a tag -;; into a buffer for these local completion routines. -;; -;; By creating the functions as overloadable, it can be -;; customized. For example, the default will put a paren "(" -;; character after function names. For Lisp, it might check -;; to put a "(" in front of a function name. - -(define-overloadable-function semantic-ia-insert-tag (tag) - "Insert TAG into the current buffer based on completion.") - -(defun semantic-ia-insert-tag-default (tag) - "Insert TAG into the current buffer based on completion." - (insert (semantic-tag-name tag)) - (let ((tt (semantic-tag-class tag))) - (cond ((eq tt 'function) - (insert "(")) - (t nil)))) - ;;; Completions Tip ;; ;; This functions shows how to get the list of completions, @@ -290,6 +296,8 @@ This helper manages the mark, buffer switching, and pulsing." (pulse-momentary-highlight-one-line (point)) ) +(declare-function semantic-decoration-include-visit "semantic/decorate/include") + (defun semantic-ia-fast-jump (point) "Jump to the tag referred to by the code at POINT. Uses `semantic-analyze-current-context' output to identify an accurate @@ -338,6 +346,7 @@ origin of the code at point." ((semantic-tag-of-class-p (semantic-current-tag) 'include) ;; Just borrow this cool fcn. + (require 'semantic/decorate/include) (semantic-decoration-include-visit) ) diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el index 9a05924890..51f4f887e2 100644 --- a/lisp/cedet/semantic/idle.el +++ b/lisp/cedet/semantic/idle.el @@ -37,9 +37,18 @@ ;; automatically caches the created context, so it is shared amongst ;; all idle modes that will need it. -(require 'semantic/util-modes) +(require 'semantic) +(require 'semantic/ctxt) +(require 'semantic/tag) +;(require 'semantic/util-modes) (require 'timer) +;; For the semantic-find-tags-by-name macro. +(eval-when-compile (require 'semantic/find)) + +(declare-function semanticdb-typecache-refresh-for-buffer "semantic/db-typecache") +(declare-function eldoc-message "eldoc") + ;;; Code: ;;; TIMER RELATED FUNCTIONS @@ -152,7 +161,8 @@ all buffers regardless of their size." idle-scheduler is disabled when debugging or if the buffer size exceeds the `semantic-idle-scheduler-max-buffer-size' threshold." (and semantic-idle-scheduler-mode - (not semantic-debug-enabled) + (not (and (boundp 'semantic-debug-enabled) + semantic-debug-enabled)) (not semantic-lex-debug) (or (<= semantic-idle-scheduler-max-buffer-size 0) (< (buffer-size) semantic-idle-scheduler-max-buffer-size)))) @@ -694,7 +704,6 @@ minor mode is enabled.") ;;; SUMMARY MODE ;; ;; A mode similar to eldoc using semantic -(require 'semantic/ctxt) (defcustom semantic-idle-summary-function 'semantic-format-tag-summarize-with-file diff --git a/lisp/cedet/semantic/sort.el b/lisp/cedet/semantic/sort.el index 7fa0853067..39ebda7738 100644 --- a/lisp/cedet/semantic/sort.el +++ b/lisp/cedet/semantic/sort.el @@ -236,6 +236,7 @@ typecaching system, see `semanticdb-typecache-merge-streams'." ;; of commands would be better off with a flattened list, where all ;; tags appear at the top level. +;;;###autoload (defun semantic-flatten-tags-table (&optional table) "Flatten the tags table TABLE. All tags in TABLE, and all components of top level tags @@ -463,7 +464,8 @@ buckets with the bucket function." ;; ;; In order to adopt external children, we need a few overload methods ;; to enable the feature. -;; + +;;;###autoload (define-overloadable-function semantic-tag-external-member-parent (tag) "Return a parent for TAG when TAG is an external member. TAG is an external member if it is defined at a toplevel and @@ -589,4 +591,9 @@ See `semantic-tag-external-class' for details." (provide 'semantic/sort) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic-sort.el ends here diff --git a/lisp/cedet/semantic/tag-file.el b/lisp/cedet/semantic/tag-file.el index 4187d3c030..cd2d073bcb 100644 --- a/lisp/cedet/semantic/tag-file.el +++ b/lisp/cedet/semantic/tag-file.el @@ -32,6 +32,7 @@ ;;; Location a TAG came from. ;; +;;;###autoload (define-overloadable-function semantic-go-to-tag (tag &optional parent) "Go to the location of TAG. TAG may be a stripped element, in which case PARENT specifies a @@ -101,6 +102,7 @@ PARENT can also be a `semanticdb-table' object." ;; Dependencies usually represent a file of some sort. ;; Find the file described by a dependency. +;;;###autoload (define-overloadable-function semantic-dependency-tag-file (&optional tag) "Find the filename represented from TAG. Depends on `semantic-dependency-include-path' for searching. Always searches @@ -199,4 +201,9 @@ file prototypes belong in." (provide 'semantic/tag-file) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic-tag-file.el ends here diff --git a/lisp/cedet/semantic/tag-ls.el b/lisp/cedet/semantic/tag-ls.el index 634c41cf09..b80ed46a75 100644 --- a/lisp/cedet/semantic/tag-ls.el +++ b/lisp/cedet/semantic/tag-ls.el @@ -194,6 +194,7 @@ See `semantic-tag-static-p'." (setq mods (cdr mods))) static)) +;;;###autoload (define-overloadable-function semantic-tag-prototype-p (tag) "Return non nil if TAG is a prototype. For some laguages, such as C, a prototype is a declaration of @@ -270,7 +271,11 @@ Return the name of TAG found in the toplevel STREAM." (semantic-alias-obsolete 'semantic-tag-leaf 'semantic-tag-leaf-p) (semantic-alias-obsolete 'semantic-tag-abstract 'semantic-tag-abstract-p) - (provide 'semantic/tag-ls) +;; Local variables: +;; generated-autoload-file: "loaddefs.el" +;; generated-autoload-feature: semantic/loaddefs +;; End: + ;;; semantic-tag-ls.el ends here diff --git a/lisp/cedet/semantic/tag.el b/lisp/cedet/semantic/tag.el index ed79c11ad7..13232ecbbd 100644 --- a/lisp/cedet/semantic/tag.el +++ b/lisp/cedet/semantic/tag.el @@ -52,8 +52,6 @@ (require 'semantic/fw) (require 'semantic/lex) -(declare-function semantic-current-tag "semantic/find") -(declare-function semantic-find-first-tag-by-name "semantic/find") (declare-function semantic-ctxt-current-mode "semantic/ctxt") (declare-function semantic-analyze-split-name "semantic/analyze/fcn") (declare-function semantic-fetch-tags "semantic") @@ -821,10 +819,8 @@ refers to that parent by name, then the :parent attribute should be used." "Find the superclass NAME in the list of SUPERS. If a simple search doesn't do it, try splitting up the names in SUPERS." - (require 'semantic/find) (let ((stag nil)) (setq stag (semantic-find-first-tag-by-name name supers)) - (when (not stag) (require 'semantic/analyze/fcn) (dolist (S supers) diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 2fe333671f..6ccc64b77c 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -42,6 +42,12 @@ trailer starting with a FormFeed character.") ;;;###autoload (put 'generated-autoload-file 'safe-local-variable 'stringp) +(defvar generated-autoload-feature nil + "*Feature that `generated-autoload-file' should provide. +If nil, this defaults to `generated-autoload-file', sans extension.") +;;;###autoload +(put 'generated-autoload-feature 'safe-local-variable 'symbolp) + ;; This feels like it should be a defconst, but MH-E sets it to ;; ";;;###mh-autoload" for the autoloads that are to go into mh-loaddefs.el. (defvar generate-autoload-cookie ";;;###autoload" @@ -245,7 +251,11 @@ information contained in FILE." ";;\n" ";;; Code:\n\n" " \n" - "(provide '" (file-name-sans-extension basename) ")\n" + "(provide '" + (if (symbolp generated-autoload-feature) + (format "%s" generated-autoload-feature) + (file-name-sans-extension basename)) + ")\n" ";; Local Variables:\n" ";; version-control: never\n" ";; no-byte-compile: t\n"