diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2009-08-31 02:16:34 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2009-08-31 02:16:34 +0000 |
commit | 978c25c6a0b0d88568abb91c871363758c678da0 (patch) | |
tree | d1c11f92c2edc3509678acf5f4207b9971e5ef6f /lisp/cedet/semantic/format.el | |
parent | 691a065ecb6920eb73f2a72229b8c803202a00b6 (diff) | |
download | emacs-978c25c6a0b0d88568abb91c871363758c678da0.tar.gz |
cedet/semantic/chart.el: Don't require semantic/find.
cedet/semantic/complete.el: Don't require semantic/find.
cedet/semantic/decorate.el: Require semantic/tag-file.
(semantic-set-tag-folded-isearch): Require semantic/find.
cedet/semantic/dep.el: Change semantic--dependency-find-file-on-path
into a macro, to avoid compiler warning.
Defvar ede-minor-mode and ede-object.
Declare ede-system-include-path.
cedet/semantic/doc.el: Require semantic/tag-file and semantic/find.
cedet/semantic/edit.el: Require semantic/find and semantic/format.
cedet/semantic/find.el: Defvar semantic-case-fold.
Require semantic.
(semantic-find-tags-external-children-of-type): Require semantic/sort.
(semantic-find-tags-by-scope-protection-default): Require semantic/tag-ls.
cedet/semantic/format.el: Require semantic/tag-ls.
eval-when-compile semantic/find.
(semantic-format-tag-name): Move up to avoid compiler error.
(semantic-format-tag-prototype): Move up to avoid compiler error.
(semantic--format-tag-parent-tree): Require semantic/tag-file.
(semantic-format-tag-short-doc-default): Require semantic/doc.
Diffstat (limited to 'lisp/cedet/semantic/format.el')
-rw-r--r-- | lisp/cedet/semantic/format.el | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/lisp/cedet/semantic/format.el b/lisp/cedet/semantic/format.el index ad6523f4fa8..2e4f16a509b 100644 --- a/lisp/cedet/semantic/format.el +++ b/lisp/cedet/semantic/format.el @@ -1,4 +1,4 @@ -;;; format.el --- Routines for formatting tags +;;; semantic/format.el --- Routines for formatting tags ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, ;;; 2008, 2009 Free Software Foundation, Inc. @@ -33,10 +33,15 @@ ;; ;;; Code: -(eval-when-compile (require 'font-lock)) +(require 'semantic) (require 'semantic/tag) +(require 'semantic/tag-ls) (require 'ezimage) +(eval-when-compile + (require 'font-lock) + (require 'semantic/find)) + ;;; Tag to text overload functions ;; ;; abbreviations, prototypes, and coloring support. @@ -90,11 +95,27 @@ 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) +(define-overloadable-function semantic-format-tag-name (tag &optional parent color) + "Return the name string describing TAG. +The name is the shortest possible representation. +Optional argument PARENT is the parent type if TAG is a detail. +Optional argument COLOR means highlight the prototype with font-lock colors.") + +(define-overloadable-function semantic-format-tag-prototype (tag &optional parent color) + "Return a prototype for TAG. +This function should be overloaded, though it need not be used. +This is because it can be used to create code by language independent +tools. +Optional argument PARENT is the parent type if TAG is a detail. +Optional argument COLOR means highlight the prototype with font-lock colors.") + + (defun semantic-test-all-format-tag-functions (&optional arg) "Test all outputs from `semantic-format-tag-functions'. Output is generated from the function under `point'. Optional argument ARG specifies not to use color." (interactive "P") + (require 'semantic/find) (semantic-fetch-tags) (let* ((tag (semantic-current-tag)) (par (semantic-current-tag-parent)) @@ -274,12 +295,6 @@ of FACE-CLASS for which this is used." (stringp (car anything))) (semantic--format-colorize-text (car anything) colorhint)))) -(define-overloadable-function semantic-format-tag-name (tag &optional parent color) - "Return the name string describing TAG. -The name is the shortest possible representation. -Optional argument PARENT is the parent type if TAG is a detail. -Optional argument COLOR means highlight the prototype with font-lock colors.") - (defun semantic-format-tag-name-default (tag &optional parent color) "Return an abbreviated string describing TAG. Optional argument PARENT is the parent type if TAG is a detail. @@ -294,6 +309,8 @@ Optional argument COLOR means highlight the prototype with font-lock colors." (setq name (semantic--format-colorize-text name (semantic-tag-class tag)))) name)) +(declare-function semantic-go-to-tag "semantic/tag-file") + (defun semantic--format-tag-parent-tree (tag parent) "Under Consideration. @@ -311,6 +328,7 @@ local definitions." ;; is nil because there isn't one. (setq parent (or (semantic-tag-function-parent tag) (save-excursion + (require 'semantic/tag-file) (semantic-go-to-tag tag) (semantic-current-tag-parent))))) (when (stringp parent) @@ -449,10 +467,13 @@ Optional argument COLOR means highlight the prototype with font-lock colors." Optional argument PARENT is the parent type if TAG is a detail. Optional argument COLOR means highlight the prototype with font-lock colors.") +(declare-function semantic-documentation-for-tag "semantic/doc") + (defun semantic-format-tag-short-doc-default (tag &optional parent color) "Display a short form of TAG's documentation. (Comments, or docstring.) Optional argument PARENT is the parent type if TAG is a detail. Optional argument COLOR means highlight the prototype with font-lock colors." + (let* ((fname (or (semantic-tag-file-name tag) (when parent (semantic-tag-file-name parent)))) (buf (or (semantic-tag-buffer tag) @@ -464,6 +485,7 @@ Optional argument COLOR means highlight the prototype with font-lock colors." (setq buf (find-file-noselect fname)) (setq doc (semantic-tag-docstring tag buf))) (when (not doc) + (require 'semantic/doc) (setq doc (semantic-documentation-for-tag tag)) ) (setq doc @@ -482,14 +504,6 @@ Optional argument COLOR means highlight the prototype with font-lock colors." ;;; Prototype generation ;; -(define-overloadable-function semantic-format-tag-prototype (tag &optional parent color) - "Return a prototype for TAG. -This function should be overloaded, though it need not be used. -This is because it can be used to create code by language independent -tools. -Optional argument PARENT is the parent type if TAG is a detail. -Optional argument COLOR means highlight the prototype with font-lock colors.") - (defun semantic-format-tag-prototype-default (tag &optional parent color) "Default method for returning a prototype for TAG. This will work for C like languages. @@ -771,4 +785,4 @@ Optional argument COLOR means highlight the prototype with font-lock colors." (provide 'semantic/format) -;;; semantic-format.el ends here +;;; semantic/format.el ends here |