annotate lisp/cedet/semantic/format.el @ 104514:c65d65798b34

Fix last change to use semantic-varalias-obsolete.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 26 Sep 2009 18:03:54 +0000
parents a4e1a12c8b97
children bbd7017a25d9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
1 ;;; semantic/format.el --- Routines for formatting tags
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
2
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
3 ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
4 ;;; 2008, 2009 Free Software Foundation, Inc.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
5
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
6 ;; Author: Eric M. Ludlam <zappo@gnu.org>
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
7 ;; Keywords: syntax
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
8
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
10
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
14 ;; (at your option) any later version.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
15
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
19 ;; GNU General Public License for more details.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
20
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
23
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
24 ;;; Commentary:
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
25 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
26 ;; Once a language file has been parsed into a TAG, it is often useful
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
27 ;; then display that tag information in browsers, completion engines, or
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
28 ;; help routines. The functions and setup in this file provide ways
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
29 ;; to reformat a tag into different standard output types.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
30 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
31 ;; In addition, macros for setting up customizable variables that let
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
32 ;; the user choose their default format type are also provided.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
33 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
34
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
35 ;;; Code:
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
36 (eval-when-compile (require 'font-lock))
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
37 (require 'semantic)
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
38 (require 'semantic/tag-ls)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
39 (require 'ezimage)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
40
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
41 (eval-when-compile (require 'semantic/find))
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
42
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
43 ;;; Tag to text overload functions
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
44 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
45 ;; abbreviations, prototypes, and coloring support.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
46 (defvar semantic-format-tag-functions
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
47 '(semantic-format-tag-name
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
48 semantic-format-tag-canonical-name
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
49 semantic-format-tag-abbreviate
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
50 semantic-format-tag-summarize
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
51 semantic-format-tag-summarize-with-file
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
52 semantic-format-tag-short-doc
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
53 semantic-format-tag-prototype
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
54 semantic-format-tag-concise-prototype
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
55 semantic-format-tag-uml-abbreviate
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
56 semantic-format-tag-uml-prototype
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
57 semantic-format-tag-uml-concise-prototype
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
58 semantic-format-tag-prin1
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
59 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
60 "List of functions which convert a tag to text.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
61 Each function must take the parameters TAG &optional PARENT COLOR.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
62 TAG is the tag to convert.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
63 PARENT is a parent tag or name which refers to the structure
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
64 or class which contains TAG. PARENT is NOT a class which a TAG
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
65 would claim as a parent.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
66 COLOR indicates that the generated text should be colored using
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
67 `font-lock'.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
68
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
69 (semantic-varalias-obsolete 'semantic-token->text-functions
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
70 'semantic-format-tag-functions)
104447
273e528a9f9b * emacs-lisp/autoload.el (generated-autoload-load-name): New var.
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
71
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
72 (defvar semantic-format-tag-custom-list
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
73 (append '(radio)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
74 (mapcar (lambda (f) (list 'const f))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
75 semantic-format-tag-functions)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
76 '(function))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
77 "A List used by customizeable variables to choose a tag to text function.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
78 Use this variable in the :type field of a customizable variable.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
79
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
80 (semantic-varalias-obsolete 'semantic-token->text-custom-list
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
81 'semantic-format-tag-custom-list)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
82
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
83 (defcustom semantic-format-use-images-flag ezimage-use-images
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
84 "Non-nil means semantic format functions use images.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
85 Images can be used as icons instead of some types of text strings."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
86 :group 'semantic
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
87 :type 'boolean)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
88
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
89 (defvar semantic-function-argument-separator ","
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
90 "Text used to separate arguments when creating text from tags.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
91 (make-variable-buffer-local 'semantic-function-argument-separator)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
92
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
93 (defvar semantic-format-parent-separator "::"
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
94 "Text used to separate names when between namespaces/classes and functions.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
95 (make-variable-buffer-local 'semantic-format-parent-separator)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
96
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
97 (defvar semantic-format-face-alist
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
98 `( (function . font-lock-function-name-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
99 (variable . font-lock-variable-name-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
100 (type . font-lock-type-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
101 ;; These are different between Emacsen.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
102 (include . ,(if (featurep 'xemacs)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
103 'font-lock-preprocessor-face
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
104 'font-lock-constant-face))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
105 (package . ,(if (featurep 'xemacs)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
106 'font-lock-preprocessor-face
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
107 'font-lock-constant-face))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
108 ;; Not a tag, but instead a feature of output
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
109 (label . font-lock-string-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
110 (comment . font-lock-comment-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
111 (keyword . font-lock-keyword-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
112 (abstract . italic)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
113 (static . underline)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
114 (documentation . font-lock-doc-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
115 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
116 "Face used to colorize tags of different types.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
117 Override the value locally if a language supports other tag types.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
118 When adding new elements, try to use symbols also returned by the parser.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
119 The form of an entry in this list is of the form:
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
120 ( SYMBOL . FACE )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
121 where SYMBOL is a tag type symbol used with semantic. FACE
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
122 is a symbol representing a face.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
123 Faces used are generated in `font-lock' for consistency, and will not
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
124 be used unless font lock is a feature.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
125
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
126 (semantic-varalias-obsolete 'semantic-face-alist
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
127 'semantic-format-face-alist)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
128
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
129
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
130
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
131 ;;; Coloring Functions
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
132 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
133 (defun semantic--format-colorize-text (text face-class)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
134 "Apply onto TEXT a color associated with FACE-CLASS.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
135 FACE-CLASS is a tag type found in `semantic-face-alist'. See this variable
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
136 for details on adding new types."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
137 (if (featurep 'font-lock)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
138 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
139 (newtext (concat text)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
140 (put-text-property 0 (length text) 'face face newtext)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
141 newtext)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
142 text))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
143
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
144 (make-obsolete 'semantic-colorize-text
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
145 'semantic--format-colorize-text)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
146
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
147 (defun semantic--format-colorize-merge-text (precoloredtext face-class)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
148 "Apply onto PRECOLOREDTEXT a color associated with FACE-CLASS.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
149 FACE-CLASS is a tag type found in 'semantic-face-alist'. See this
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
150 variable for details on adding new types."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
151 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
152 (newtext (concat precoloredtext))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
153 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
154 (if (featurep 'xemacs)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
155 (add-text-properties 0 (length newtext) (list 'face face) newtext)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
156 (alter-text-property 0 (length newtext) 'face
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
157 (lambda (current-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
158 (let ((cf
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
159 (cond ((facep current-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
160 (list current-face))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
161 ((listp current-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
162 current-face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
163 (t nil)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
164 (nf
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
165 (cond ((facep face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
166 (list face))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
167 ((listp face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
168 face)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
169 (t nil))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
170 (append cf nf)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
171 newtext))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
172 newtext))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
173
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
174 ;;; Function Arguments
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
175 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
176 (defun semantic--format-tag-arguments (args formatter color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
177 "Format the argument list ARGS with FORMATTER.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
178 FORMATTER is a function used to format a tag.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
179 COLOR specifies if color should be used."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
180 (let ((out nil))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
181 (while args
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
182 (push (if (and formatter
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
183 (semantic-tag-p (car args))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
184 (not (string= (semantic-tag-name (car args)) ""))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
185 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
186 (funcall formatter (car args) nil color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
187 (semantic-format-tag-name-from-anything
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
188 (car args) nil color 'variable))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
189 out)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
190 (setq args (cdr args)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
191 (mapconcat 'identity (nreverse out) semantic-function-argument-separator)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
192 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
193
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
194 ;;; Data Type
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
195 (define-overloadable-function semantic-format-tag-type (tag color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
196 "Convert the data type of TAG to a string usable in tag formatting.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
197 It is presumed that TYPE is a string or semantic tag.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
198
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
199 (defun semantic-format-tag-type-default (tag color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
200 "Convert the data type of TAG to a string usable in tag formatting.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
201 Argument COLOR specifies to colorize the text."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
202 (let* ((type (semantic-tag-type tag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
203 (out (cond ((semantic-tag-p type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
204 (let* ((typetype (semantic-tag-type type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
205 (name (semantic-tag-name type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
206 (str (if typetype
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
207 (concat typetype " " name)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
208 name)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
209 (if color
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
210 (semantic--format-colorize-text
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
211 str
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
212 'type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
213 str)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
214 ((and (listp type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
215 (stringp (car type)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
216 (car type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
217 ((stringp type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
218 type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
219 (t nil))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
220 (if (and color out)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
221 (setq out (semantic--format-colorize-text out 'type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
222 out)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
223 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
224
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
225
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
226 ;;; Abstract formatting functions
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
227 ;;
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
228
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
229 (defun semantic-format-tag-prin1 (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
230 "Convert TAG to a string that is the print name for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
231 PARENT and COLOR are ignored."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
232 (format "%S" tag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
233
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
234 (defun semantic-format-tag-name-from-anything (anything &optional
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
235 parent color
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
236 colorhint)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
237 "Convert just about anything into a name like string.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
238 Argument ANYTHING is the thing to be converted.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
239 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
240 Optional argument COLOR means highlight the prototype with font-lock colors.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
241 Optional COLORHINT is the type of color to use if ANYTHING is not a tag
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
242 with a tag class. See `semantic--format-colorize-text' for a definition
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
243 of FACE-CLASS for which this is used."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
244 (cond ((stringp anything)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
245 (semantic--format-colorize-text anything colorhint))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
246 ((semantic-tag-p anything)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
247 (let ((ans (semantic-format-tag-name anything parent color)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
248 ;; If ANS is empty string or nil, then the name wasn't
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
249 ;; supplied. The implication is as in C where there is a data
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
250 ;; type but no name for a prototype from an include file, or
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
251 ;; an argument just wasn't used in the body of the fcn.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
252 (if (or (null ans) (string= ans ""))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
253 (setq ans (semantic-format-tag-type anything color)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
254 ans))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
255 ((and (listp anything)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
256 (stringp (car anything)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
257 (semantic--format-colorize-text (car anything) colorhint))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
258
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
259 ;;;###autoload
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
260 (define-overloadable-function semantic-format-tag-name (tag &optional parent color)
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
261 "Return the name string describing TAG.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
262 The name is the shortest possible representation.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
263 Optional argument PARENT is the parent type if TAG is a detail.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
264 Optional argument COLOR means highlight the prototype with font-lock colors.")
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
265
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
266 (defun semantic-format-tag-name-default (tag &optional parent color)
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
267 "Return an abbreviated string describing TAG.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
268 Optional argument PARENT is the parent type if TAG is a detail.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
269 Optional argument COLOR means highlight the prototype with font-lock colors."
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
270 (let ((name (semantic-tag-name tag))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
271 (destructor
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
272 (if (eq (semantic-tag-class tag) 'function)
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
273 (semantic-tag-function-destructor-p tag))))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
274 (when destructor
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
275 (setq name (concat "~" name)))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
276 (if color
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
277 (setq name (semantic--format-colorize-text name (semantic-tag-class tag))))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
278 name))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
279
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
280 (declare-function semantic-go-to-tag "semantic/tag-file")
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
281
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
282 (defun semantic--format-tag-parent-tree (tag parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
283 "Under Consideration.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
284
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
285 Return a list of parents for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
286 PARENT is the first parent, or nil. If nil, then an attempt to
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
287 determine PARENT is made.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
288 Once PARENT is identified, additional parents are looked for.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
289 The return list first element is the nearest parent, and the last
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
290 item is the first parent which may be a string. The root parent may
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
291 not be the actual first parent as there may just be a failure to find
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
292 local definitions."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
293 ;; First, validate the PARENT argument.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
294 (unless parent
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
295 ;; All mechanisms here must be fast as often parent
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
296 ;; is nil because there isn't one.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
297 (setq parent (or (semantic-tag-function-parent tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
298 (save-excursion
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
299 (require 'semantic/tag-file)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
300 (semantic-go-to-tag tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
301 (semantic-current-tag-parent)))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
302 (when (stringp parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
303 (setq parent (semantic-find-first-tag-by-name
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
304 parent (current-buffer))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
305 ;; Try and find a trail of parents from PARENT
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
306 (let ((rlist (list parent))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
307 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
308 ;; IMPLELEMENT ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
309 (reverse rlist)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
310
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
311 (define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
312 "Return a canonical name for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
313 A canonical name includes the names of any parents or namespaces preceeding
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
314 the tag.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
315 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
316 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
317
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
318 (defun semantic-format-tag-canonical-name-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
319 "Return a canonical name for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
320 A canonical name includes the names of any parents or namespaces preceeding
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
321 the tag with colons separating them.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
322 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
323 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
324 (let ((parent-input-str
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
325 (if (and parent
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
326 (semantic-tag-p parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
327 (semantic-tag-of-class-p parent 'type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
328 (concat
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
329 ;; Choose a class of 'type as the default parent for something.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
330 ;; Just a guess though.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
331 (semantic-format-tag-name-from-anything parent nil color 'type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
332 ;; Default separator between class/namespace and others.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
333 semantic-format-parent-separator)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
334 ""))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
335 (tag-parent-str
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
336 (or (when (and (semantic-tag-of-class-p tag 'function)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
337 (semantic-tag-function-parent tag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
338 (concat (semantic-tag-function-parent tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
339 semantic-format-parent-separator))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
340 ""))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
341 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
342 (concat parent-input-str
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
343 tag-parent-str
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
344 (semantic-format-tag-name tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
345 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
346
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
347 (define-overloadable-function semantic-format-tag-abbreviate (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
348 "Return an abbreviated string describing TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
349 The abbreviation is to be short, with possible symbols indicating
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
350 the type of tag, or other information.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
351 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
352 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
353
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
354 (defun semantic-format-tag-abbreviate-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
355 "Return an abbreviated string describing TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
356 Optional argument PARENT is a parent tag in the tag hierarchy.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
357 In this case PARENT refers to containment, not inheritance.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
358 Optional argument COLOR means highlight the prototype with font-lock colors.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
359 This is a simple C like default."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
360 ;; Do lots of complex stuff here.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
361 (let ((class (semantic-tag-class tag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
362 (name (semantic-format-tag-canonical-name tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
363 (suffix "")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
364 (prefix "")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
365 str)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
366 (cond ((eq class 'function)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
367 (setq suffix "()"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
368 ((eq class 'include)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
369 (setq suffix "<>"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
370 ((eq class 'variable)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
371 (setq suffix (if (semantic-tag-variable-default tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
372 "=" "")))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
373 ((eq class 'label)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
374 (setq suffix ":"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
375 ((eq class 'code)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
376 (setq prefix "{"
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
377 suffix "}"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
378 ((eq class 'type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
379 (setq suffix "{}"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
380 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
381 (setq str (concat prefix name suffix))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
382 str))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
383
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
384 ;; Semantic 1.2.x had this misspelling. Keep it for backwards compatibiity.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
385 (semantic-alias-obsolete
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
386 'semantic-summerize-nonterminal 'semantic-format-tag-summarize)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
387
104446
df08b7ab0ba0 lisp/cedet/semantic/analyze.el: Add local vars for autoloading.
Chong Yidong <cyd@stupidchicken.com>
parents: 104444
diff changeset
388 ;;;###autoload
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
389 (define-overloadable-function semantic-format-tag-summarize (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
390 "Summarize TAG in a reasonable way.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
391 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
392 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
393
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
394 (defun semantic-format-tag-summarize-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
395 "Summarize TAG in a reasonable way.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
396 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
397 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
398 (let* ((proto (semantic-format-tag-prototype tag nil color))
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
399 (names (if parent
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
400 semantic-symbol->name-assoc-list-for-type-parts
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
401 semantic-symbol->name-assoc-list))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
402 (tsymb (semantic-tag-class tag))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
403 (label (capitalize (or (cdr-safe (assoc tsymb names))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
404 (symbol-name tsymb)))))
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
405 (if color
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
406 (setq label (semantic--format-colorize-text label 'label)))
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
407 (concat label ": " proto)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
408
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
409 (define-overloadable-function semantic-format-tag-summarize-with-file (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
410 "Like `semantic-format-tag-summarize', but with the file name.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
411 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
412 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
413
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
414 (defun semantic-format-tag-summarize-with-file-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
415 "Summarize TAG in a reasonable way.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
416 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
417 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
418 (let* ((proto (semantic-format-tag-prototype tag nil color))
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
419 (file (semantic-tag-file-name tag))
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
420 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
421 ;; Nothing for tag? Try parent.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
422 (when (and (not file) (and parent))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
423 (setq file (semantic-tag-file-name parent)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
424 ;; Don't include the file name if we can't find one, or it is the
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
425 ;; same as the current buffer.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
426 (if (or (not file)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
427 (string= file (buffer-file-name (current-buffer))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
428 proto
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
429 (setq file (file-name-nondirectory file))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
430 (when color
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
431 (setq file (semantic--format-colorize-text file 'label)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
432 (concat file ": " proto))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
433
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
434 (define-overloadable-function semantic-format-tag-short-doc (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
435 "Display a short form of TAG's documentation. (Comments, or docstring.)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
436 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
437 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
438
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
439 (declare-function semantic-documentation-for-tag "semantic/doc")
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
440
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
441 (defun semantic-format-tag-short-doc-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
442 "Display a short form of TAG's documentation. (Comments, or docstring.)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
443 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
444 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
445 (let* ((fname (or (semantic-tag-file-name tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
446 (when parent (semantic-tag-file-name parent))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
447 (buf (or (semantic-tag-buffer tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
448 (when parent (semantic-tag-buffer parent))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
449 (doc (semantic-tag-docstring tag buf)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
450 (when (and (not doc) (not buf) fname)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
451 ;; If there is no doc, and no buffer, but we have a filename,
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
452 ;; lets try again.
104492
8db96f200ac8 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104489
diff changeset
453 (save-match-data
8db96f200ac8 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104489
diff changeset
454 (setq buf (find-file-noselect fname)))
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
455 (setq doc (semantic-tag-docstring tag buf)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
456 (when (not doc)
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
457 (require 'semantic/doc)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
458 (setq doc (semantic-documentation-for-tag tag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
459 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
460 (setq doc
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
461 (if (not doc)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
462 ;; No doc, use summarize.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
463 (semantic-format-tag-summarize tag parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
464 ;; We have doc. Can we devise a single line?
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
465 (if (string-match "$" doc)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
466 (substring doc 0 (match-beginning 0))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
467 doc)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
468 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
469 (when color
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
470 (setq doc (semantic--format-colorize-text doc 'documentation)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
471 doc
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
472 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
473
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
474 ;;; Prototype generation
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
475 ;;
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
476 ;;;###autoload
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
477 (define-overloadable-function semantic-format-tag-prototype (tag &optional parent color)
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
478 "Return a prototype for TAG.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
479 This function should be overloaded, though it need not be used.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
480 This is because it can be used to create code by language independent
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
481 tools.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
482 Optional argument PARENT is the parent type if TAG is a detail.
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
483 Optional argument COLOR means highlight the prototype with font-lock colors.")
104470
6ccad1511df1 Minor whitespace changes and `require' fixes.
Chong Yidong <cyd@stupidchicken.com>
parents: 104447
diff changeset
484
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
485 (defun semantic-format-tag-prototype-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
486 "Default method for returning a prototype for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
487 This will work for C like languages.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
488 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
489 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
490 (let* ((class (semantic-tag-class tag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
491 (name (semantic-format-tag-name tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
492 (type (if (member class '(function variable type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
493 (semantic-format-tag-type tag color)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
494 (args (if (member class '(function type))
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
495 (semantic--format-tag-arguments
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
496 (if (eq class 'function)
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
497 (semantic-tag-function-arguments tag)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
498 (list "")
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
499 ;;(semantic-tag-type-members tag)
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
500 )
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
501 #'semantic-format-tag-prototype
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
502 color)))
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
503 (const (semantic-tag-get-attribute tag :constant-flag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
504 (tm (semantic-tag-get-attribute tag :typemodifiers))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
505 (mods (append
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
506 (if const '("const") nil)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
507 (cond ((stringp tm) (list tm))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
508 ((consp tm) tm)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
509 (t nil))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
510 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
511 (array (if (eq class 'variable)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
512 (let ((deref
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
513 (semantic-tag-get-attribute
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
514 tag :dereference))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
515 (r ""))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
516 (while (and deref (/= deref 0))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
517 (setq r (concat r "[]")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
518 deref (1- deref)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
519 r)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
520 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
521 (if args
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
522 (setq args
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
523 (concat " "
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
524 (if (eq class 'type) "{" "(")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
525 args
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
526 (if (eq class 'type) "}" ")"))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
527 (when mods
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
528 (setq mods (concat (mapconcat 'identity mods " ") " ")))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
529 (concat (or mods "")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
530 (if type (concat type " "))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
531 name
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
532 (or args "")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
533 (or array ""))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
534
104447
273e528a9f9b * emacs-lisp/autoload.el (generated-autoload-load-name): New var.
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
535 ;;;###autoload
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
536 (define-overloadable-function semantic-format-tag-concise-prototype (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
537 "Return a concise prototype for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
538 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
539 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
540
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
541 (defun semantic-format-tag-concise-prototype-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
542 "Return a concise prototype for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
543 This default function will make a cheap concise prototype using C like syntax.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
544 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
545 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
546 (let ((class (semantic-tag-class tag)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
547 (cond
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
548 ((eq class 'type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
549 (concat (semantic-format-tag-name tag parent color) "{}"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
550 ((eq class 'function)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
551 (concat (semantic-format-tag-name tag parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
552 " ("
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
553 (semantic--format-tag-arguments
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
554 (semantic-tag-function-arguments tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
555 'semantic-format-tag-concise-prototype
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
556 color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
557 ")"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
558 ((eq class 'variable)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
559 (let* ((deref (semantic-tag-get-attribute
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
560 tag :dereference))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
561 (array "")
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
562 )
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
563 (while (and deref (/= deref 0))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
564 (setq array (concat array "[]")
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
565 deref (1- deref)))
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
566 (concat (semantic-format-tag-name tag parent color)
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
567 array)))
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
568 (t
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
569 (semantic-format-tag-abbreviate tag parent color)))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
570
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
571 ;;; UML display styles
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
572 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
573 (defcustom semantic-uml-colon-string " : "
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
574 "*String used as a color separator between parts of a UML string.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
575 In UML, a variable may appear as `varname : type'.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
576 Change this variable to change the output separator."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
577 :group 'semantic
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
578 :type 'string)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
579
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
580 (defcustom semantic-uml-no-protection-string ""
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
581 "*String used to describe when no protection is specified.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
582 Used by `semantic-format-tag-uml-protection-to-string'."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
583 :group 'semantic
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
584 :type 'string)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
585
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
586 (defun semantic--format-uml-post-colorize (text tag parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
587 "Add color to TEXT created from TAG and PARENT.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
588 Adds augmentation for `abstract' and `static' entries."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
589 (if (semantic-tag-abstract-p tag parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
590 (setq text (semantic--format-colorize-merge-text text 'abstract)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
591 (if (semantic-tag-static-p tag parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
592 (setq text (semantic--format-colorize-merge-text text 'static)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
593 text
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
594 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
595
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
596 (defun semantic-uml-attribute-string (tag &optional parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
597 "Return a string for TAG, a child of PARENT representing a UML attribute.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
598 UML attribute strings are things like {abstract} or {leaf}."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
599 (cond ((semantic-tag-abstract-p tag parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
600 "{abstract}")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
601 ((semantic-tag-leaf-p tag parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
602 "{leaf}")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
603 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
604
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
605 (defvar semantic-format-tag-protection-image-alist
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
606 '(("+" . ezimage-unlock)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
607 ("#" . ezimage-key)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
608 ("-" . ezimage-lock)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
609 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
610 "Association of protection strings, and images to use.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
611
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
612 (defvar semantic-format-tag-protection-symbol-to-string-assoc-list
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
613 '((public . "+")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
614 (protected . "#")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
615 (private . "-")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
616 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
617 "Association list of the form (SYMBOL . \"STRING\") for protection symbols.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
618 This associates a symbol, such as 'public with the st ring \"+\".")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
619
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
620 (define-overloadable-function semantic-format-tag-uml-protection-to-string (protection-symbol color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
621 "Convert PROTECTION-SYMBOL to a string for UML.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
622 By default, uses `semantic-format-tag-protection-symbol-to-string-assoc-list'
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
623 to convert.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
624 By defaul character returns are:
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
625 public -- +
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
626 private -- -
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
627 protected -- #.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
628 If PROTECTION-SYMBOL is unknown, then the return value is
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
629 `semantic-uml-no-protection-string'.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
630 COLOR indicates if we should use an image on the text.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
631
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
632 (defun semantic-format-tag-uml-protection-to-string-default (protection-symbol color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
633 "Convert PROTECTION-SYMBOL to a string for UML.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
634 Uses `semantic-format-tag-protection-symbol-to-string-assoc-list' to convert.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
635 If PROTECTION-SYMBOL is unknown, then the return value is
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
636 `semantic-uml-no-protection-string'.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
637 COLOR indicates if we should use an image on the text."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
638 (let* ((ezimage-use-images (and semantic-format-use-images-flag color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
639 (key (assoc protection-symbol
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
640 semantic-format-tag-protection-symbol-to-string-assoc-list))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
641 (str (or (cdr-safe key) semantic-uml-no-protection-string)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
642 (ezimage-image-over-string
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
643 (copy-sequence str) ; make a copy to keep the original pristine.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
644 semantic-format-tag-protection-image-alist)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
645
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
646 (defsubst semantic-format-tag-uml-protection (tag parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
647 "Retrieve the protection string for TAG with PARENT.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
648 Argument COLOR specifies that color should be added to the string as
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
649 needed."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
650 (semantic-format-tag-uml-protection-to-string
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
651 (semantic-tag-protection tag parent)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
652 color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
653
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
654 (defun semantic--format-tag-uml-type (tag color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
655 "Format the data type of TAG to a string usable for formatting.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
656 COLOR indicates if it should be colorized."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
657 (let ((str (semantic-format-tag-type tag color)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
658 (if str
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
659 (concat semantic-uml-colon-string str))))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
660
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
661 (define-overloadable-function semantic-format-tag-uml-abbreviate (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
662 "Return a UML style abbreviation for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
663 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
664 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
665
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
666 (defun semantic-format-tag-uml-abbreviate-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
667 "Return a UML style abbreviation for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
668 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
669 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
670 (let* ((name (semantic-format-tag-name tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
671 (type (semantic--format-tag-uml-type tag color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
672 (protstr (semantic-format-tag-uml-protection tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
673 (text nil))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
674 (setq text
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
675 (concat
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
676 protstr
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
677 (if type (concat name type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
678 name)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
679 (if color
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
680 (setq text (semantic--format-uml-post-colorize text tag parent)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
681 text))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
682
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
683 (define-overloadable-function semantic-format-tag-uml-prototype (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
684 "Return a UML style prototype for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
685 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
686 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
687
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
688 (defun semantic-format-tag-uml-prototype-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
689 "Return a UML style prototype for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
690 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
691 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
692 (let* ((class (semantic-tag-class tag))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
693 (cp (semantic-format-tag-name tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
694 (type (semantic--format-tag-uml-type tag color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
695 (prot (semantic-format-tag-uml-protection tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
696 (argtext
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
697 (cond ((eq class 'function)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
698 (concat
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
699 " ("
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
700 (semantic--format-tag-arguments
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
701 (semantic-tag-function-arguments tag)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
702 #'semantic-format-tag-uml-prototype
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
703 color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
704 ")"))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
705 ((eq class 'type)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
706 "{}")))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
707 (text nil))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
708 (setq text (concat prot cp argtext type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
709 (if color
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
710 (setq text (semantic--format-uml-post-colorize text tag parent)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
711 text
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
712 ))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
713
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
714 (define-overloadable-function semantic-format-tag-uml-concise-prototype (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
715 "Return a UML style concise prototype for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
716 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
717 Optional argument COLOR means highlight the prototype with font-lock colors.")
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
718
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
719 (defun semantic-format-tag-uml-concise-prototype-default (tag &optional parent color)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
720 "Return a UML style concise prototype for TAG.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
721 Optional argument PARENT is the parent type if TAG is a detail.
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
722 Optional argument COLOR means highlight the prototype with font-lock colors."
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
723 (let* ((cp (semantic-format-tag-concise-prototype tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
724 (type (semantic--format-tag-uml-type tag color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
725 (prot (semantic-format-tag-uml-protection tag parent color))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
726 (text nil)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
727 )
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
728 (setq text (concat prot cp type))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
729 (if color
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
730 (setq text (semantic--format-uml-post-colorize text tag parent)))
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
731 text
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
732 ))
104489
25e047f7f6a2 Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents: 104470
diff changeset
733
104417
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
734 ;;; Compatibility and aliases
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
735 ;;
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
736 (semantic-alias-obsolete 'semantic-prin1-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
737 'semantic-format-tag-prin1)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
738
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
739 (semantic-alias-obsolete 'semantic-name-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
740 'semantic-format-tag-name)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
741
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
742 (semantic-alias-obsolete 'semantic-abbreviate-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
743 'semantic-format-tag-abbreviate)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
744
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
745 (semantic-alias-obsolete 'semantic-summarize-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
746 'semantic-format-tag-summarize)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
747
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
748 (semantic-alias-obsolete 'semantic-prototype-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
749 'semantic-format-tag-prototype)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
750
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
751 (semantic-alias-obsolete 'semantic-concise-prototype-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
752 'semantic-format-tag-concise-prototype)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
753
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
754 (semantic-alias-obsolete 'semantic-uml-abbreviate-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
755 'semantic-format-tag-uml-abbreviate)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
756
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
757 (semantic-alias-obsolete 'semantic-uml-prototype-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
758 'semantic-format-tag-uml-prototype)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
759
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
760 (semantic-alias-obsolete 'semantic-uml-concise-prototype-nonterminal
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
761 'semantic-format-tag-uml-concise-prototype)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
762
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
763
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
764 (provide 'semantic/format)
6810f0d84270 cedet/semantic/ctxt.el, cedet/semantic/db-find.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff changeset
765
104444
2bf481006ba4 lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el.
Chong Yidong <cyd@stupidchicken.com>
parents: 104442
diff changeset
766 ;; Local variables:
2bf481006ba4 lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el.
Chong Yidong <cyd@stupidchicken.com>
parents: 104442
diff changeset
767 ;; generated-autoload-file: "loaddefs.el"
2bf481006ba4 lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el.
Chong Yidong <cyd@stupidchicken.com>
parents: 104442
diff changeset
768 ;; generated-autoload-feature: semantic/loaddefs
104447
273e528a9f9b * emacs-lisp/autoload.el (generated-autoload-load-name): New var.
Chong Yidong <cyd@stupidchicken.com>
parents: 104446
diff changeset
769 ;; generated-autoload-load-name: "semantic/format"
104444
2bf481006ba4 lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el.
Chong Yidong <cyd@stupidchicken.com>
parents: 104442
diff changeset
770 ;; End:
2bf481006ba4 lisp/Makefile.in: Ignore CEDET subdirectories when making subdirs.el.
Chong Yidong <cyd@stupidchicken.com>
parents: 104442
diff changeset
771
104442
b22b44e953cb cedet/semantic/chart.el: Don't require semantic/find.
Chong Yidong <cyd@stupidchicken.com>
parents: 104417
diff changeset
772 ;;; semantic/format.el ends here