;;; semantic/symref.el --- Symbol Reference API
-;;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
;; Author: Eric M. Ludlam <eric@siege-engine.com>
;;
;; Semantic's native parsing tools do not handle symbol references.
;; Tracking such information is a task that requires a huge amount of
-;; space and processing not apropriate for an Emacs Lisp program.
+;; space and processing not appropriate for an Emacs Lisp program.
;;
;; Many desired tools used in refactoring, however, need to have
;; such references available to them. This API aims to provide a
;;
;; ADD A NEW EXTERNAL TOOL
;;
-;; To support a new external tool, sublcass `semantic-symref-tool-baseclass'
+;; To support a new external tool, subclass `semantic-symref-tool-baseclass'
;; and implement the methods. The baseclass provides support for
;; managing external processes that produce parsable output.
;;
;; Your tool should then create an instance of `semantic-symref-result'.
(require 'semantic)
-;; (require 'ede)
+(defvar ede-minor-mode)
(declare-function data-debug-new-buffer "data-debug")
(declare-function data-debug-insert-object-slots "eieio-datadebug")
+(declare-function ede-toplevel "ede/files")
+(declare-function ede-project-root-directory "ede/files")
;;; Code:
(defvar semantic-symref-tool 'detect
;;; EXTERNAL API
;;
+;;;###autoload
(defun semantic-symref-find-references-by-name (name &optional scope tool-return)
"Find a list of references to NAME in the current project.
Optional SCOPE specifies which file set to search. Defaults to 'project.
(set tool-return inst))
(prog1
(setq semantic-symref-last-result result)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(semantic-symref-data-debug-last-result))))
)
+;;;###autoload
(defun semantic-symref-find-tags-by-name (name &optional scope)
"Find a list of references to NAME in the current project.
Optional SCOPE specifies which file set to search. Defaults to 'project.
(result (semantic-symref-get-result inst)))
(prog1
(setq semantic-symref-last-result result)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(semantic-symref-data-debug-last-result))))
)
+;;;###autoload
(defun semantic-symref-find-tags-by-regexp (name &optional scope)
"Find a list of references to NAME in the current project.
Optional SCOPE specifies which file set to search. Defaults to 'project.
(result (semantic-symref-get-result inst)))
(prog1
(setq semantic-symref-last-result result)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(semantic-symref-data-debug-last-result))))
)
+;;;###autoload
(defun semantic-symref-find-tags-by-completion (name &optional scope)
"Find a list of references to NAME in the current project.
Optional SCOPE specifies which file set to search. Defaults to 'project.
(result (semantic-symref-get-result inst)))
(prog1
(setq semantic-symref-last-result result)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(semantic-symref-data-debug-last-result))))
)
+;;;###autoload
(defun semantic-symref-find-file-references-by-name (name &optional scope)
"Find a list of references to NAME in the current project.
Optional SCOPE specifies which file set to search. Defaults to 'project.
(result (semantic-symref-get-result inst)))
(prog1
(setq semantic-symref-last-result result)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(semantic-symref-data-debug-last-result))))
)
+;;;###autoload
(defun semantic-symref-find-text (text &optional scope)
- "Find a list of occurances of TEXT in the current project.
+ "Find a list of occurrences of TEXT in the current project.
TEXT is a regexp formatted for use with egrep.
Optional SCOPE specifies which file set to search. Defaults to 'project.
Refers to `semantic-symref-tool', to determine the reference tool to use
(result (semantic-symref-get-result inst)))
(prog1
(setq semantic-symref-last-result result)
- (when (interactive-p)
+ (when (called-interactively-p 'interactive)
(semantic-symref-data-debug-last-result))))
)
"Parse the entire OUTPUTBUFFER of a symref tool.
Calls the method `semantic-symref-parse-tool-output-one-line' over and
over until it returns nil."
- (save-excursion
- (set-buffer outputbuffer)
+ (with-current-buffer outputbuffer
(goto-char (point-min))
(let ((result nil)
(hit nil))
(provide 'semantic/symref)
+;; Local variables:
+;; generated-autoload-file: "loaddefs.el"
+;; generated-autoload-load-name: "semantic/symref"
+;; End:
+
+;; arch-tag: 928394b7-19ef-4f76-8cb3-37e9a9891984
;;; semantic/symref.el ends here