]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/symref/filter.el
Update copyright year to 2016
[gnu-emacs] / lisp / cedet / semantic / symref / filter.el
index f6f4cb134b1a107e465665f5874111f7e117290c..81cef98a71f76f80903b6eb35748b64017cc56df 100644 (file)
@@ -1,6 +1,6 @@
 ;;; semantic/symref/filter.el --- Filter symbol reference hits for accuracy.
 
-;;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009-2016 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <eric@siege-engine.com>
 
 ;;; Code:
 
 (require 'semantic)
+(require 'semantic/analyze)
 (declare-function srecode-active-template-region "srecode/fields")
 (declare-function srecode-delete "srecode/fields")
 (declare-function srecode-field "srecode/fields")
 (declare-function srecode-template-inserted-region "srecode/fields")
 (declare-function srecode-overlaid-activate "srecode/fields")
+(declare-function semantic-idle-summary-useful-context-p "semantic/idle")
 
 ;;; FILTERS
 ;;
@@ -58,13 +60,14 @@ Return non-nil for a match."
 ;; a symref results object.
 
 (defun semantic-symref-hits-in-region (target hookfcn start end)
-  "Find all occurances of the symbol TARGET that match TARGET the tag.
+  "Find all occurrences of the symbol TARGET that match TARGET the tag.
 For each match, call HOOKFCN.
 HOOKFCN takes three arguments that match
-`semantic-analyze-current-symbol's use of HOOKfCN.
+`semantic-analyze-current-symbol's use of HOOKFCN.
   ( START END PREFIX )
 
 Search occurs in the current buffer between START and END."
+  (require 'semantic/idle)
   (save-excursion
     (goto-char start)
     (let* ((str (semantic-tag-name target))
@@ -82,7 +85,6 @@ Search occurs in the current buffer between START and END."
                   (funcall hookfcn start end prefix)))))
           (point)))))))
 
-;;;###autoload
 (defun semantic-symref-test-count-hits-in-tag ()
   "Lookup in the current tag the symbol under point.
 the count all the other references to the same symbol within the
@@ -98,8 +100,8 @@ tag that contains point, and return that."
        target (lambda (start end prefix) (setq Lcount (1+ Lcount)))
        (semantic-tag-start tag)
        (semantic-tag-end tag))
-      (when (interactive-p)
-       (message "Found %d occurances of %s in %.2f seconds"
+      (when (called-interactively-p 'interactive)
+       (message "Found %d occurrences of %s in %.2f seconds"
                 Lcount (semantic-tag-name target)
                 (semantic-elapsed-time start (current-time))))
       Lcount)))
@@ -156,10 +158,4 @@ Depends on the SRecode Field editing API."
 
 (provide 'semantic/symref/filter)
 
-;; Local variables:
-;; generated-autoload-file: "../loaddefs.el"
-;; generated-autoload-feature: semantic/loaddefs
-;; generated-autoload-load-name: "semantic/symref/filter"
-;; End:
-
 ;;; semantic/symref/filter.el ends here