1 ;;; semantic/format.el --- Routines for formatting tags
3 ;;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
4 ;;; 2008, 2009 Free Software Foundation, Inc.
6 ;; Author: Eric M. Ludlam <zappo@gnu.org>
9 ;; This file is part of GNU Emacs.
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
12 ;; it under the terms of the GNU General Public License as published by
13 ;; the Free Software Foundation, either version 3 of the License, or
14 ;; (at your option) any later version.
16 ;; GNU Emacs is distributed in the hope that it will be useful,
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;; GNU General Public License for more details.
21 ;; You should have received a copy of the GNU General Public License
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
26 ;; Once a language file has been parsed into a TAG, it is often useful
27 ;; then display that tag information in browsers, completion engines, or
28 ;; help routines. The functions and setup in this file provide ways
29 ;; to reformat a tag into different standard output types.
31 ;; In addition, macros for setting up customizable variables that let
32 ;; the user choose their default format type are also provided.
37 (require 'semantic/tag)
38 (require 'semantic/tag-ls)
43 (require 'semantic/find))
45 ;;; Tag to text overload functions
47 ;; abbreviations, prototypes, and coloring support.
49 (defvar semantic-format-tag-functions
50 '(semantic-format-tag-name
51 semantic-format-tag-canonical-name
52 semantic-format-tag-abbreviate
53 semantic-format-tag-summarize
54 semantic-format-tag-summarize-with-file
55 semantic-format-tag-short-doc
56 semantic-format-tag-prototype
57 semantic-format-tag-concise-prototype
58 semantic-format-tag-uml-abbreviate
59 semantic-format-tag-uml-prototype
60 semantic-format-tag-uml-concise-prototype
61 semantic-format-tag-prin1
63 "List of functions which convert a tag to text.
64 Each function must take the parameters TAG &optional PARENT COLOR.
65 TAG is the tag to convert.
66 PARENT is a parent tag or name which refers to the structure
67 or class which contains TAG. PARENT is NOT a class which a TAG
68 would claim as a parent.
69 COLOR indicates that the generated text should be colored using
72 (semantic-varalias-obsolete 'semantic-token->text-functions
73 'semantic-format-tag-functions)
75 (defvar semantic-format-tag-custom-list
77 (mapcar (lambda (f) (list 'const f))
78 semantic-format-tag-functions)
80 "A List used by customizeable variables to choose a tag to text function.
81 Use this variable in the :type field of a customizable variable.")
83 (semantic-varalias-obsolete 'semantic-token->text-custom-list
84 'semantic-format-tag-custom-list)
86 (defcustom semantic-format-use-images-flag ezimage-use-images
87 "Non-nil means semantic format functions use images.
88 Images can be used as icons instead of some types of text strings."
92 (defvar semantic-function-argument-separator ","
93 "Text used to separate arguments when creating text from tags.")
94 (make-variable-buffer-local 'semantic-function-argument-separator)
96 (defvar semantic-format-parent-separator "::"
97 "Text used to separate names when between namespaces/classes and functions.")
98 (make-variable-buffer-local 'semantic-format-parent-separator)
101 (define-overloadable-function semantic-format-tag-name (tag &optional parent color)
102 "Return the name string describing TAG.
103 The name is the shortest possible representation.
104 Optional argument PARENT is the parent type if TAG is a detail.
105 Optional argument COLOR means highlight the prototype with font-lock colors.")
108 (define-overloadable-function semantic-format-tag-prototype (tag &optional parent color)
109 "Return a prototype for TAG.
110 This function should be overloaded, though it need not be used.
111 This is because it can be used to create code by language independent
113 Optional argument PARENT is the parent type if TAG is a detail.
114 Optional argument COLOR means highlight the prototype with font-lock colors.")
117 (defun semantic-test-all-format-tag-functions (&optional arg)
118 "Test all outputs from `semantic-format-tag-functions'.
119 Output is generated from the function under `point'.
120 Optional argument ARG specifies not to use color."
122 (require 'semantic/find)
123 (semantic-fetch-tags)
124 (let* ((tag (semantic-current-tag))
125 (par (semantic-current-tag-parent))
126 (fns semantic-format-tag-functions))
127 (with-output-to-temp-buffer "*format-tag*"
128 (princ "Tag->format function tests:")
133 (let ((s (funcall (car fns) tag par (not arg))))
135 (set-buffer "*format-tag*")
136 (goto-char (point-max))
138 (setq fns (cdr fns))))
141 (defvar semantic-format-face-alist
142 `( (function . font-lock-function-name-face)
143 (variable . font-lock-variable-name-face)
144 (type . font-lock-type-face)
145 ;; These are different between Emacsen.
146 (include . ,(if (featurep 'xemacs)
147 'font-lock-preprocessor-face
148 'font-lock-constant-face))
149 (package . ,(if (featurep 'xemacs)
150 'font-lock-preprocessor-face
151 'font-lock-constant-face))
152 ;; Not a tag, but instead a feature of output
153 (label . font-lock-string-face)
154 (comment . font-lock-comment-face)
155 (keyword . font-lock-keyword-face)
158 (documentation . font-lock-doc-face)
160 "Face used to colorize tags of different types.
161 Override the value locally if a language supports other tag types.
162 When adding new elements, try to use symbols also returned by the parser.
163 The form of an entry in this list is of the form:
165 where SYMBOL is a tag type symbol used with semantic. FACE
166 is a symbol representing a face.
167 Faces used are generated in `font-lock' for consistency, and will not
168 be used unless font lock is a feature.")
170 (semantic-varalias-obsolete 'semantic-face-alist
171 'semantic-format-face-alist)
175 ;;; Coloring Functions
177 (defun semantic--format-colorize-text (text face-class)
178 "Apply onto TEXT a color associated with FACE-CLASS.
179 FACE-CLASS is a tag type found in `semantic-face-alist'. See this variable
180 for details on adding new types."
181 (if (featurep 'font-lock)
182 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
183 (newtext (concat text)))
184 (put-text-property 0 (length text) 'face face newtext)
188 (make-obsolete 'semantic-colorize-text
189 'semantic--format-colorize-text)
191 (defun semantic--format-colorize-merge-text (precoloredtext face-class)
192 "Apply onto PRECOLOREDTEXT a color associated with FACE-CLASS.
193 FACE-CLASS is a tag type found in 'semantic-face-alist'. See this
194 variable for details on adding new types."
195 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
196 (newtext (concat precoloredtext))
198 (if (featurep 'xemacs)
199 (add-text-properties 0 (length newtext) (list 'face face) newtext)
200 (alter-text-property 0 (length newtext) 'face
201 (lambda (current-face)
203 (cond ((facep current-face)
205 ((listp current-face)
218 ;;; Function Arguments
220 (defun semantic--format-tag-arguments (args formatter color)
221 "Format the argument list ARGS with FORMATTER.
222 FORMATTER is a function used to format a tag.
223 COLOR specifies if color should be used."
226 (push (if (and formatter
227 (semantic-tag-p (car args))
228 (not (string= (semantic-tag-name (car args)) ""))
230 (funcall formatter (car args) nil color)
231 (semantic-format-tag-name-from-anything
232 (car args) nil color 'variable))
234 (setq args (cdr args)))
235 (mapconcat 'identity (nreverse out) semantic-function-argument-separator)
239 (define-overloadable-function semantic-format-tag-type (tag color)
240 "Convert the data type of TAG to a string usable in tag formatting.
241 It is presumed that TYPE is a string or semantic tag.")
243 (defun semantic-format-tag-type-default (tag color)
244 "Convert the data type of TAG to a string usable in tag formatting.
245 Argument COLOR specifies to colorize the text."
246 (let* ((type (semantic-tag-type tag))
247 (out (cond ((semantic-tag-p type)
248 (let* ((typetype (semantic-tag-type type))
249 (name (semantic-tag-name type))
251 (concat typetype " " name)
254 (semantic--format-colorize-text
259 (stringp (car type)))
265 (setq out (semantic--format-colorize-text out 'type))
270 ;;; Abstract formatting functions
272 (defun semantic-format-tag-prin1 (tag &optional parent color)
273 "Convert TAG to a string that is the print name for TAG.
274 PARENT and COLOR are ignored."
277 (defun semantic-format-tag-name-from-anything (anything &optional
280 "Convert just about anything into a name like string.
281 Argument ANYTHING is the thing to be converted.
282 Optional argument PARENT is the parent type if TAG is a detail.
283 Optional argument COLOR means highlight the prototype with font-lock colors.
284 Optional COLORHINT is the type of color to use if ANYTHING is not a tag
285 with a tag class. See `semantic--format-colorize-text' for a definition
286 of FACE-CLASS for which this is used."
287 (cond ((stringp anything)
288 (semantic--format-colorize-text anything colorhint))
289 ((semantic-tag-p anything)
290 (let ((ans (semantic-format-tag-name anything parent color)))
291 ;; If ANS is empty string or nil, then the name wasn't
292 ;; supplied. The implication is as in C where there is a data
293 ;; type but no name for a prototype from an include file, or
294 ;; an argument just wasn't used in the body of the fcn.
295 (if (or (null ans) (string= ans ""))
296 (setq ans (semantic-format-tag-type anything color)))
298 ((and (listp anything)
299 (stringp (car anything)))
300 (semantic--format-colorize-text (car anything) colorhint))))
302 (defun semantic-format-tag-name-default (tag &optional parent color)
303 "Return an abbreviated string describing TAG.
304 Optional argument PARENT is the parent type if TAG is a detail.
305 Optional argument COLOR means highlight the prototype with font-lock colors."
306 (let ((name (semantic-tag-name tag))
308 (if (eq (semantic-tag-class tag) 'function)
309 (semantic-tag-function-destructor-p tag))))
311 (setq name (concat "~" name)))
313 (setq name (semantic--format-colorize-text name (semantic-tag-class tag))))
316 (declare-function semantic-go-to-tag "semantic/tag-file")
318 (defun semantic--format-tag-parent-tree (tag parent)
319 "Under Consideration.
321 Return a list of parents for TAG.
322 PARENT is the first parent, or nil. If nil, then an attempt to
323 determine PARENT is made.
324 Once PARENT is identified, additional parents are looked for.
325 The return list first element is the nearest parent, and the last
326 item is the first parent which may be a string. The root parent may
327 not be the actual first parent as there may just be a failure to find
329 ;; First, validate the PARENT argument.
331 ;; All mechanisms here must be fast as often parent
332 ;; is nil because there isn't one.
333 (setq parent (or (semantic-tag-function-parent tag)
335 (require 'semantic/tag-file)
336 (semantic-go-to-tag tag)
337 (semantic-current-tag-parent)))))
338 (when (stringp parent)
339 (setq parent (semantic-find-first-tag-by-name
340 parent (current-buffer))))
341 ;; Try and find a trail of parents from PARENT
342 (let ((rlist (list parent))
344 ;; IMPLELEMENT ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
347 (define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color)
348 "Return a canonical name for TAG.
349 A canonical name includes the names of any parents or namespaces preceeding
351 Optional argument PARENT is the parent type if TAG is a detail.
352 Optional argument COLOR means highlight the prototype with font-lock colors.")
354 (defun semantic-format-tag-canonical-name-default (tag &optional parent color)
355 "Return a canonical name for TAG.
356 A canonical name includes the names of any parents or namespaces preceeding
357 the tag with colons separating them.
358 Optional argument PARENT is the parent type if TAG is a detail.
359 Optional argument COLOR means highlight the prototype with font-lock colors."
360 (let ((parent-input-str
362 (semantic-tag-p parent)
363 (semantic-tag-of-class-p parent 'type))
365 ;; Choose a class of 'type as the default parent for something.
366 ;; Just a guess though.
367 (semantic-format-tag-name-from-anything parent nil color 'type)
368 ;; Default separator between class/namespace and others.
369 semantic-format-parent-separator)
372 (or (when (and (semantic-tag-of-class-p tag 'function)
373 (semantic-tag-function-parent tag))
374 (concat (semantic-tag-function-parent tag)
375 semantic-format-parent-separator))
378 (concat parent-input-str
380 (semantic-format-tag-name tag parent color))
383 (define-overloadable-function semantic-format-tag-abbreviate (tag &optional parent color)
384 "Return an abbreviated string describing TAG.
385 The abbreviation is to be short, with possible symbols indicating
386 the type of tag, or other information.
387 Optional argument PARENT is the parent type if TAG is a detail.
388 Optional argument COLOR means highlight the prototype with font-lock colors.")
390 (defun semantic-format-tag-abbreviate-default (tag &optional parent color)
391 "Return an abbreviated string describing TAG.
392 Optional argument PARENT is a parent tag in the tag hierarchy.
393 In this case PARENT refers to containment, not inheritance.
394 Optional argument COLOR means highlight the prototype with font-lock colors.
395 This is a simple C like default."
396 ;; Do lots of complex stuff here.
397 (let ((class (semantic-tag-class tag))
398 (name (semantic-format-tag-canonical-name tag parent color))
402 (cond ((eq class 'function)
406 ((eq class 'variable)
407 (setq suffix (if (semantic-tag-variable-default tag)
417 (setq str (concat prefix name suffix))
420 ;; Semantic 1.2.x had this misspelling. Keep it for backwards compatibiity.
421 (semantic-alias-obsolete
422 'semantic-summerize-nonterminal 'semantic-format-tag-summarize)
425 (define-overloadable-function semantic-format-tag-summarize (tag &optional parent color)
426 "Summarize TAG in a reasonable way.
427 Optional argument PARENT is the parent type if TAG is a detail.
428 Optional argument COLOR means highlight the prototype with font-lock colors.")
430 (defun semantic-format-tag-summarize-default (tag &optional parent color)
431 "Summarize TAG in a reasonable way.
432 Optional argument PARENT is the parent type if TAG is a detail.
433 Optional argument COLOR means highlight the prototype with font-lock colors."
434 (let* ((proto (semantic-format-tag-prototype tag nil color))
436 semantic-symbol->name-assoc-list-for-type-parts
437 semantic-symbol->name-assoc-list))
438 (tsymb (semantic-tag-class tag))
439 (label (capitalize (or (cdr-safe (assoc tsymb names))
440 (symbol-name tsymb)))))
442 (setq label (semantic--format-colorize-text label 'label)))
443 (concat label ": " proto)))
445 (define-overloadable-function semantic-format-tag-summarize-with-file (tag &optional parent color)
446 "Like `semantic-format-tag-summarize', but with the file name.
447 Optional argument PARENT is the parent type if TAG is a detail.
448 Optional argument COLOR means highlight the prototype with font-lock colors.")
450 (defun semantic-format-tag-summarize-with-file-default (tag &optional parent color)
451 "Summarize TAG in a reasonable way.
452 Optional argument PARENT is the parent type if TAG is a detail.
453 Optional argument COLOR means highlight the prototype with font-lock colors."
454 (let* ((proto (semantic-format-tag-prototype tag nil color))
455 (file (semantic-tag-file-name tag))
457 ;; Nothing for tag? Try parent.
458 (when (and (not file) (and parent))
459 (setq file (semantic-tag-file-name parent)))
460 ;; Don't include the file name if we can't find one, or it is the
461 ;; same as the current buffer.
463 (string= file (buffer-file-name (current-buffer))))
465 (setq file (file-name-nondirectory file))
467 (setq file (semantic--format-colorize-text file 'label)))
468 (concat file ": " proto))))
470 (define-overloadable-function semantic-format-tag-short-doc (tag &optional parent color)
471 "Display a short form of TAG's documentation. (Comments, or docstring.)
472 Optional argument PARENT is the parent type if TAG is a detail.
473 Optional argument COLOR means highlight the prototype with font-lock colors.")
475 (declare-function semantic-documentation-for-tag "semantic/doc")
477 (defun semantic-format-tag-short-doc-default (tag &optional parent color)
478 "Display a short form of TAG's documentation. (Comments, or docstring.)
479 Optional argument PARENT is the parent type if TAG is a detail.
480 Optional argument COLOR means highlight the prototype with font-lock colors."
482 (let* ((fname (or (semantic-tag-file-name tag)
483 (when parent (semantic-tag-file-name parent))))
484 (buf (or (semantic-tag-buffer tag)
485 (when parent (semantic-tag-buffer parent))))
486 (doc (semantic-tag-docstring tag buf)))
487 (when (and (not doc) (not buf) fname)
488 ;; If there is no doc, and no buffer, but we have a filename,
490 (setq buf (find-file-noselect fname))
491 (setq doc (semantic-tag-docstring tag buf)))
493 (require 'semantic/doc)
494 (setq doc (semantic-documentation-for-tag tag))
498 ;; No doc, use summarize.
499 (semantic-format-tag-summarize tag parent color)
500 ;; We have doc. Can we devise a single line?
501 (if (string-match "$" doc)
502 (substring doc 0 (match-beginning 0))
506 (setq doc (semantic--format-colorize-text doc 'documentation)))
510 ;;; Prototype generation
512 (defun semantic-format-tag-prototype-default (tag &optional parent color)
513 "Default method for returning a prototype for TAG.
514 This will work for C like languages.
515 Optional argument PARENT is the parent type if TAG is a detail.
516 Optional argument COLOR means highlight the prototype with font-lock colors."
517 (let* ((class (semantic-tag-class tag))
518 (name (semantic-format-tag-name tag parent color))
519 (type (if (member class '(function variable type))
520 (semantic-format-tag-type tag color)))
521 (args (if (member class '(function type))
522 (semantic--format-tag-arguments
523 (if (eq class 'function)
524 (semantic-tag-function-arguments tag)
526 ;;(semantic-tag-type-members tag)
528 #'semantic-format-tag-prototype
530 (const (semantic-tag-get-attribute tag :constant-flag))
531 (tm (semantic-tag-get-attribute tag :typemodifiers))
533 (if const '("const") nil)
534 (cond ((stringp tm) (list tm))
538 (array (if (eq class 'variable)
540 (semantic-tag-get-attribute
543 (while (and deref (/= deref 0))
544 (setq r (concat r "[]")
551 (if (eq class 'type) "{" "(")
553 (if (eq class 'type) "}" ")"))))
555 (setq mods (concat (mapconcat 'identity mods " ") " ")))
557 (if type (concat type " "))
562 (define-overloadable-function semantic-format-tag-concise-prototype (tag &optional parent color)
563 "Return a concise prototype for TAG.
564 Optional argument PARENT is the parent type if TAG is a detail.
565 Optional argument COLOR means highlight the prototype with font-lock colors.")
567 (defun semantic-format-tag-concise-prototype-default (tag &optional parent color)
568 "Return a concise prototype for TAG.
569 This default function will make a cheap concise prototype using C like syntax.
570 Optional argument PARENT is the parent type if TAG is a detail.
571 Optional argument COLOR means highlight the prototype with font-lock colors."
572 (let ((class (semantic-tag-class tag)))
575 (concat (semantic-format-tag-name tag parent color) "{}"))
576 ((eq class 'function)
577 (concat (semantic-format-tag-name tag parent color)
579 (semantic--format-tag-arguments
580 (semantic-tag-function-arguments tag)
581 'semantic-format-tag-concise-prototype
584 ((eq class 'variable)
585 (let* ((deref (semantic-tag-get-attribute
589 (while (and deref (/= deref 0))
590 (setq array (concat array "[]")
592 (concat (semantic-format-tag-name tag parent color)
595 (semantic-format-tag-abbreviate tag parent color)))))
597 ;;; UML display styles
599 (defcustom semantic-uml-colon-string " : "
600 "*String used as a color separator between parts of a UML string.
601 In UML, a variable may appear as `varname : type'.
602 Change this variable to change the output separator."
606 (defcustom semantic-uml-no-protection-string ""
607 "*String used to describe when no protection is specified.
608 Used by `semantic-format-tag-uml-protection-to-string'."
612 (defun semantic--format-uml-post-colorize (text tag parent)
613 "Add color to TEXT created from TAG and PARENT.
614 Adds augmentation for `abstract' and `static' entries."
615 (if (semantic-tag-abstract-p tag parent)
616 (setq text (semantic--format-colorize-merge-text text 'abstract)))
617 (if (semantic-tag-static-p tag parent)
618 (setq text (semantic--format-colorize-merge-text text 'static)))
622 (defun semantic-uml-attribute-string (tag &optional parent)
623 "Return a string for TAG, a child of PARENT representing a UML attribute.
624 UML attribute strings are things like {abstract} or {leaf}."
625 (cond ((semantic-tag-abstract-p tag parent)
627 ((semantic-tag-leaf-p tag parent)
631 (defvar semantic-format-tag-protection-image-alist
632 '(("+" . ezimage-unlock)
636 "Association of protection strings, and images to use.")
638 (defvar semantic-format-tag-protection-symbol-to-string-assoc-list
643 "Association list of the form (SYMBOL . \"STRING\") for protection symbols.
644 This associates a symbol, such as 'public with the st ring \"+\".")
646 (define-overloadable-function semantic-format-tag-uml-protection-to-string (protection-symbol color)
647 "Convert PROTECTION-SYMBOL to a string for UML.
648 By default, uses `semantic-format-tag-protection-symbol-to-string-assoc-list'
650 By defaul character returns are:
654 If PROTECTION-SYMBOL is unknown, then the return value is
655 `semantic-uml-no-protection-string'.
656 COLOR indicates if we should use an image on the text.")
658 (defun semantic-format-tag-uml-protection-to-string-default (protection-symbol color)
659 "Convert PROTECTION-SYMBOL to a string for UML.
660 Uses `semantic-format-tag-protection-symbol-to-string-assoc-list' to convert.
661 If PROTECTION-SYMBOL is unknown, then the return value is
662 `semantic-uml-no-protection-string'.
663 COLOR indicates if we should use an image on the text."
664 (let* ((ezimage-use-images (and semantic-format-use-images-flag color))
665 (key (assoc protection-symbol
666 semantic-format-tag-protection-symbol-to-string-assoc-list))
667 (str (or (cdr-safe key) semantic-uml-no-protection-string)))
668 (ezimage-image-over-string
669 (copy-sequence str) ; make a copy to keep the original pristine.
670 semantic-format-tag-protection-image-alist)))
672 (defsubst semantic-format-tag-uml-protection (tag parent color)
673 "Retrieve the protection string for TAG with PARENT.
674 Argument COLOR specifies that color should be added to the string as
676 (semantic-format-tag-uml-protection-to-string
677 (semantic-tag-protection tag parent)
680 (defun semantic--format-tag-uml-type (tag color)
681 "Format the data type of TAG to a string usable for formatting.
682 COLOR indicates if it should be colorized."
683 (let ((str (semantic-format-tag-type tag color)))
685 (concat semantic-uml-colon-string str))))
687 (define-overloadable-function semantic-format-tag-uml-abbreviate (tag &optional parent color)
688 "Return a UML style abbreviation for TAG.
689 Optional argument PARENT is the parent type if TAG is a detail.
690 Optional argument COLOR means highlight the prototype with font-lock colors.")
692 (defun semantic-format-tag-uml-abbreviate-default (tag &optional parent color)
693 "Return a UML style abbreviation for TAG.
694 Optional argument PARENT is the parent type if TAG is a detail.
695 Optional argument COLOR means highlight the prototype with font-lock colors."
696 (let* ((name (semantic-format-tag-name tag parent color))
697 (type (semantic--format-tag-uml-type tag color))
698 (protstr (semantic-format-tag-uml-protection tag parent color))
703 (if type (concat name type)
706 (setq text (semantic--format-uml-post-colorize text tag parent)))
709 (define-overloadable-function semantic-format-tag-uml-prototype (tag &optional parent color)
710 "Return a UML style prototype for TAG.
711 Optional argument PARENT is the parent type if TAG is a detail.
712 Optional argument COLOR means highlight the prototype with font-lock colors.")
714 (defun semantic-format-tag-uml-prototype-default (tag &optional parent color)
715 "Return a UML style prototype for TAG.
716 Optional argument PARENT is the parent type if TAG is a detail.
717 Optional argument COLOR means highlight the prototype with font-lock colors."
718 (let* ((class (semantic-tag-class tag))
719 (cp (semantic-format-tag-name tag parent color))
720 (type (semantic--format-tag-uml-type tag color))
721 (prot (semantic-format-tag-uml-protection tag parent color))
723 (cond ((eq class 'function)
726 (semantic--format-tag-arguments
727 (semantic-tag-function-arguments tag)
728 #'semantic-format-tag-uml-prototype
734 (setq text (concat prot cp argtext type))
736 (setq text (semantic--format-uml-post-colorize text tag parent)))
740 (define-overloadable-function semantic-format-tag-uml-concise-prototype (tag &optional parent color)
741 "Return a UML style concise prototype for TAG.
742 Optional argument PARENT is the parent type if TAG is a detail.
743 Optional argument COLOR means highlight the prototype with font-lock colors.")
745 (defun semantic-format-tag-uml-concise-prototype-default (tag &optional parent color)
746 "Return a UML style concise prototype for TAG.
747 Optional argument PARENT is the parent type if TAG is a detail.
748 Optional argument COLOR means highlight the prototype with font-lock colors."
749 (let* ((cp (semantic-format-tag-concise-prototype tag parent color))
750 (type (semantic--format-tag-uml-type tag color))
751 (prot (semantic-format-tag-uml-protection tag parent color))
754 (setq text (concat prot cp type))
756 (setq text (semantic--format-uml-post-colorize text tag parent)))
761 ;;; Compatibility and aliases
763 (semantic-alias-obsolete 'semantic-prin1-nonterminal
764 'semantic-format-tag-prin1)
766 (semantic-alias-obsolete 'semantic-name-nonterminal
767 'semantic-format-tag-name)
769 (semantic-alias-obsolete 'semantic-abbreviate-nonterminal
770 'semantic-format-tag-abbreviate)
772 (semantic-alias-obsolete 'semantic-summarize-nonterminal
773 'semantic-format-tag-summarize)
775 (semantic-alias-obsolete 'semantic-prototype-nonterminal
776 'semantic-format-tag-prototype)
778 (semantic-alias-obsolete 'semantic-concise-prototype-nonterminal
779 'semantic-format-tag-concise-prototype)
781 (semantic-alias-obsolete 'semantic-uml-abbreviate-nonterminal
782 'semantic-format-tag-uml-abbreviate)
784 (semantic-alias-obsolete 'semantic-uml-prototype-nonterminal
785 'semantic-format-tag-uml-prototype)
787 (semantic-alias-obsolete 'semantic-uml-concise-prototype-nonterminal
788 'semantic-format-tag-uml-concise-prototype)
791 (provide 'semantic/format)
794 ;; generated-autoload-file: "loaddefs.el"
795 ;; generated-autoload-feature: semantic/loaddefs
798 ;;; semantic/format.el ends here