comparison lisp/cedet/semantic/idle.el @ 104446:df08b7ab0ba0

lisp/cedet/semantic/analyze.el: Add local vars for autoloading. (semantic-analyze-current-context): Autoload. lisp/cedet/semantic/ctxt.el: Add local vars for autoloading. Don't eval-when-compile semantic/db (semantic-ctxt-current-mode): Autoload. (semantic-up-context): Require semantic/find. lisp/cedet/semantic/find.el (semantic-current-tag-parent) (semantic-find-tags-by-scope-protection): Autoload. lisp/cedet/semantic/format.el (semantic-format-tag-prototype) (semantic-format-tag-summarize): Autoload. lisp/cedet/semantic/idle.el: Declare external functions. (semantic-idle-work-for-one-buffer, semantic-idle-work-core-handler): Require semantic/db-mode. (semantic-idle-work-core-handler): Synch to upstream. (semantic-idle-scheduler-refresh-tags): Require semantic/decorate/mode. (semantic-idle-summary-find-current-symbol-tag): Require semantic/db-find. (semantic-idle-summary-current-symbol-info-context): Require semantic/analyze. (semantic-idle-summary-maybe-highlight, semantic-idle-tag-highlight): Require pulse. (semantic-idle-completion-list-default): Require semantic/complete. lisp/cedet/semantic/lex-spp.el: Require semantic. (semantic-lex-spp-analyzer-push-tokens-for-symbol): Synch to upstream. (semantic-lex-spp-first-token-arg-list): Use split-string. lisp/cedet/semantic/lex.el: Declare semantic-elapsed-time. Add local vars for autoloading. (semantic-lex-test): Require semantic. (semantic-lex): Autoload. (semantic-flex): Use semantic-lex-keyword-p to avoid compiler warning. lisp/cedet/semantic/sb.el: Require semantic/sort. Declare semanticdb-minor-mode-p. (semantic-sb-fetch-tag-table): Require semantic/db-mode. lisp/cedet/semantic/scope.el: eval-when-compile semantic/find. Declare external functions. (semantic-analyze-scope-nested-tags-default): Require semantic/analyze. (semantic-analyze-show): Require semantic/analyze. (semantic-calculate-scope): Require semantic/db-typecache. lisp/cedet/semantic/sort.el: Add local vars for autoloading. Declare semanticdb-find-tags-external-children-of-type. (semantic-flatten-tags-table, semantic-tag-external-member-parent): Autoload. (semantic-tag-external-member-children-default): Require semantic/db-find. lisp/cedet/semantic/symref.el: Require semantic. Declare data-debug-new-buffer and data-debug-insert-object-slots. (semantic-symref-data-debug-last-result): Require eieio-datadebug. lisp/cedet/semantic/tag-file.el: Declare external functions. (semantic-go-to-tag): Call semanticdb-table-child-p only if semantic/db is loaded. (semantic-dependency-tag-file): Require semantic/dep. lisp/cedet/semantic/tag-ls.el: Require semantic. Add local variables for autoloading. (semantic-tag-prototype-p): Autoload. lisp/cedet/semantic/tag-write.el: Require semantic. lisp/cedet/semantic/tag.el: Update external function declarations and requirements, removing autoloaded functions. Add local vars for autoloading. (semantic-tag-components): Autoload. lisp/cedet/semantic/texi.el: Declare lookup-words. eval-when-compile semantic/find. lisp/cedet/semantic/util.el: Update file header. lisp/cedet/semantic/analyze/complete.el: Add local variables for autoloading. (semantic-analyze-possible-completions, semantic-analyze-type-constants): Autoload.
author Chong Yidong <cyd@stupidchicken.com>
date Thu, 03 Sep 2009 03:58:13 +0000
parents 2bf481006ba4
children 273e528a9f9b
comparison
equal deleted inserted replaced
104445:43eb1ff3a976 104446:df08b7ab0ba0
44 (require 'timer) 44 (require 'timer)
45 45
46 ;; For the semantic-find-tags-by-name macro. 46 ;; For the semantic-find-tags-by-name macro.
47 (eval-when-compile (require 'semantic/find)) 47 (eval-when-compile (require 'semantic/find))
48 48
49 (declare-function eldoc-message "eldoc")
50 (declare-function semantic-analyze-interesting-tag "semantic/analyze")
51 (declare-function semantic-complete-analyze-inline-idle "semantic/complete")
52 (declare-function semanticdb-deep-find-tags-by-name "semantic/db-find")
53 (declare-function semanticdb-minor-mode-p "semantic/db-mode")
54 (declare-function semanticdb-save-all-db-idle "semantic/db")
49 (declare-function semanticdb-typecache-refresh-for-buffer "semantic/db-typecache") 55 (declare-function semanticdb-typecache-refresh-for-buffer "semantic/db-typecache")
50 (declare-function eldoc-message "eldoc") 56 (declare-function semantic-decorate-flush-pending-decorations
57 "semantic/decorate/mode")
58 (declare-function pulse-momentary-highlight-region "pulse")
59 (declare-function pulse-momentary-highlight-overlay "pulse")
51 60
52 ;;; Code: 61 ;;; Code:
53 62
54 ;;; TIMER RELATED FUNCTIONS 63 ;;; TIMER RELATED FUNCTIONS
55 ;; 64 ;;
356 ;; are ready to provide good smart completion and idle 365 ;; are ready to provide good smart completion and idle
357 ;; summary information 366 ;; summary information
358 (semantic-safe "Idle Work Including Error: %S" 367 (semantic-safe "Idle Work Including Error: %S"
359 ;; Get the include related path. 368 ;; Get the include related path.
360 (when (and (featurep 'semantic/db) 369 (when (and (featurep 'semantic/db)
370 (require 'semantic/db-mode)
361 (semanticdb-minor-mode-p)) 371 (semanticdb-minor-mode-p))
362 (require 'semantic/db-find) 372 (require 'semantic/db-find)
363 (semanticdb-find-translate-path buffer nil) 373 (semanticdb-find-translate-path buffer nil)
364 ) 374 )
365 t) 375 t)
406 (unless (semantic-idle-work-for-one-buffer (current-buffer)) 416 (unless (semantic-idle-work-for-one-buffer (current-buffer))
407 (push (current-buffer) errbuf))) 417 (push (current-buffer) errbuf)))
408 )) 418 ))
409 ) 419 )
410 420
411 ;; Save everything. 421 (when (and (featurep 'semantic/db)
412 (semanticdb-save-all-db-idle) 422 (require 'semantic/db-mode)
413 423 (semanticdb-minor-mode-p))
414 ;; Parse up files near our active buffer 424 ;; Save everything.
415 (when semantic-idle-work-parse-neighboring-files-flag 425 (semanticdb-save-all-db-idle)
416 (semantic-safe "Idle Work Parse Neighboring Files: %S" 426
417 (when (and (featurep 'semantic/db) 427 ;; Parse up files near our active buffer
418 (semanticdb-minor-mode-p)) 428 (when semantic-idle-work-parse-neighboring-files-flag
429 (semantic-safe "Idle Work Parse Neighboring Files: %S"
419 (set-buffer cb) 430 (set-buffer cb)
420 (semantic-idle-scheduler-work-parse-neighboring-files)) 431 (semantic-idle-scheduler-work-parse-neighboring-files))
421 t) 432 t)
433
434 ;; Save everything... again
435 (semanticdb-save-all-db-idle)
422 ) 436 )
423
424 ;; Save everything... again
425 (semanticdb-save-all-db-idle)
426 437
427 ;; Done w/ processing 438 ;; Done w/ processing
428 nil)))) 439 nil))))
429 440
430 ;; Done 441 ;; Done
580 ;; Return if we are lexically safe (from prog1) 591 ;; Return if we are lexically safe (from prog1)
581 lexically-safe))) 592 lexically-safe)))
582 593
583 ;; After updating the tags, handle any pending decorations for this 594 ;; After updating the tags, handle any pending decorations for this
584 ;; buffer. 595 ;; buffer.
596 (require 'semantic/decorate/mode)
585 (semantic-decorate-flush-pending-decorations (current-buffer)) 597 (semantic-decorate-flush-pending-decorations (current-buffer))
586 )) 598 ))
587 599
588 600
589 ;;; IDLE SERVICES 601 ;;; IDLE SERVICES
714 726
715 (defsubst semantic-idle-summary-find-current-symbol-tag (sym) 727 (defsubst semantic-idle-summary-find-current-symbol-tag (sym)
716 "Search for a semantic tag with name SYM in database tables. 728 "Search for a semantic tag with name SYM in database tables.
717 Return the tag found or nil if not found. 729 Return the tag found or nil if not found.
718 If semanticdb is not in use, use the current buffer only." 730 If semanticdb is not in use, use the current buffer only."
719 (car (if (and (featurep 'semantic/db) semanticdb-current-database) 731 (car (if (and (featurep 'semantic/db)
732 semanticdb-current-database
733 (require 'semantic/db-find))
720 (cdar (semanticdb-deep-find-tags-by-name sym)) 734 (cdar (semanticdb-deep-find-tags-by-name sym))
721 (semantic-deep-find-tags-by-name sym (current-buffer))))) 735 (semantic-deep-find-tags-by-name sym (current-buffer)))))
722 736
723 (defun semantic-idle-summary-current-symbol-info-brutish () 737 (defun semantic-idle-summary-current-symbol-info-brutish ()
724 "Return a string message describing the current context. 738 "Return a string message describing the current context.
742 Use the semantic analyzer to find the symbol information." 756 Use the semantic analyzer to find the symbol information."
743 (let ((analysis (condition-case nil 757 (let ((analysis (condition-case nil
744 (semantic-analyze-current-context (point)) 758 (semantic-analyze-current-context (point))
745 (error nil)))) 759 (error nil))))
746 (when analysis 760 (when analysis
761 (require 'semantic/analyze)
747 (semantic-analyze-interesting-tag analysis)))) 762 (semantic-analyze-interesting-tag analysis))))
748 763
749 (defun semantic-idle-summary-current-symbol-info-default () 764 (defun semantic-idle-summary-current-symbol-info-default ()
750 "Return a string message describing the current context. 765 "Return a string message describing the current context.
751 This functin will disable loading of previously unloaded files 766 This functin will disable loading of previously unloaded files
842 857
843 (defun semantic-idle-summary-maybe-highlight (tag) 858 (defun semantic-idle-summary-maybe-highlight (tag)
844 "Perhaps add highlighting onto TAG. 859 "Perhaps add highlighting onto TAG.
845 TAG was found as the thing under point. If it happens to be 860 TAG was found as the thing under point. If it happens to be
846 visible, then highlight it." 861 visible, then highlight it."
862 (require 'pulse)
847 (let* ((region (when (and (semantic-tag-p tag) 863 (let* ((region (when (and (semantic-tag-p tag)
848 (semantic-tag-with-position-p tag)) 864 (semantic-tag-with-position-p tag))
849 (semantic-tag-overlay tag))) 865 (semantic-tag-overlay tag)))
850 (file (when (and (semantic-tag-p tag) 866 (file (when (and (semantic-tag-p tag)
851 (semantic-tag-with-position-p tag)) 867 (semantic-tag-with-position-p tag))
894 910
895 (define-semantic-idle-service semantic-idle-tag-highlight 911 (define-semantic-idle-service semantic-idle-tag-highlight
896 "Highlight the tag, and references of the symbol under point. 912 "Highlight the tag, and references of the symbol under point.
897 Call `semantic-analyze-current-context' to find the reference tag. 913 Call `semantic-analyze-current-context' to find the reference tag.
898 Call `semantic-symref-hits-in-region' to identify local references." 914 Call `semantic-symref-hits-in-region' to identify local references."
915 (require 'pulse)
899 (when (semantic-idle-summary-useful-context-p) 916 (when (semantic-idle-summary-useful-context-p)
900 (let* ((ctxt (semantic-analyze-current-context)) 917 (let* ((ctxt (semantic-analyze-current-context))
901 (Hbounds (when ctxt (oref ctxt bounds))) 918 (Hbounds (when ctxt (oref ctxt bounds)))
902 (target (when ctxt (car (reverse (oref ctxt prefix))))) 919 (target (when ctxt (car (reverse (oref ctxt prefix)))))
903 (tag (semantic-current-tag)) 920 (tag (semantic-current-tag))
943 (if (featurep 'semantic/db-find) 960 (if (featurep 'semantic/db-find)
944 (remq 'unloaded semanticdb-find-default-throttle) 961 (remq 'unloaded semanticdb-find-default-throttle)
945 nil)) 962 nil))
946 ) 963 )
947 ;; Use idle version. 964 ;; Use idle version.
965 (require 'semantic/complete)
948 (semantic-complete-analyze-inline-idle) 966 (semantic-complete-analyze-inline-idle)
949 ) 967 )
950 (error nil)) 968 (error nil))
951 )) 969 ))
952 970