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.
48 (defvar semantic-format-tag-functions
49 '(semantic-format-tag-name
50 semantic-format-tag-canonical-name
51 semantic-format-tag-abbreviate
52 semantic-format-tag-summarize
53 semantic-format-tag-summarize-with-file
54 semantic-format-tag-short-doc
55 semantic-format-tag-prototype
56 semantic-format-tag-concise-prototype
57 semantic-format-tag-uml-abbreviate
58 semantic-format-tag-uml-prototype
59 semantic-format-tag-uml-concise-prototype
60 semantic-format-tag-prin1
62 "List of functions which convert a tag to text.
63 Each function must take the parameters TAG &optional PARENT COLOR.
64 TAG is the tag to convert.
65 PARENT is a parent tag or name which refers to the structure
66 or class which contains TAG. PARENT is NOT a class which a TAG
67 would claim as a parent.
68 COLOR indicates that the generated text should be colored using
71 (semantic-varalias-obsolete 'semantic-token->text-functions
72 'semantic-format-tag-functions)
74 (defvar semantic-format-tag-custom-list
76 (mapcar (lambda (f) (list 'const f))
77 semantic-format-tag-functions)
79 "A List used by customizeable variables to choose a tag to text function.
80 Use this variable in the :type field of a customizable variable.")
82 (semantic-varalias-obsolete 'semantic-token->text-custom-list
83 'semantic-format-tag-custom-list)
85 (defcustom semantic-format-use-images-flag ezimage-use-images
86 "Non-nil means semantic format functions use images.
87 Images can be used as icons instead of some types of text strings."
91 (defvar semantic-function-argument-separator ","
92 "Text used to separate arguments when creating text from tags.")
93 (make-variable-buffer-local 'semantic-function-argument-separator)
95 (defvar semantic-format-parent-separator "::"
96 "Text used to separate names when between namespaces/classes and functions.")
97 (make-variable-buffer-local 'semantic-format-parent-separator)
100 (define-overloadable-function semantic-format-tag-name (tag &optional parent color)
101 "Return the name string describing TAG.
102 The name is the shortest possible representation.
103 Optional argument PARENT is the parent type if TAG is a detail.
104 Optional argument COLOR means highlight the prototype with font-lock colors.")
107 (define-overloadable-function semantic-format-tag-prototype (tag &optional parent color)
108 "Return a prototype for TAG.
109 This function should be overloaded, though it need not be used.
110 This is because it can be used to create code by language independent
112 Optional argument PARENT is the parent type if TAG is a detail.
113 Optional argument COLOR means highlight the prototype with font-lock colors.")
116 (defun semantic-test-all-format-tag-functions (&optional arg)
117 "Test all outputs from `semantic-format-tag-functions'.
118 Output is generated from the function under `point'.
119 Optional argument ARG specifies not to use color."
121 (require 'semantic/find)
122 (semantic-fetch-tags)
123 (let* ((tag (semantic-current-tag))
124 (par (semantic-current-tag-parent))
125 (fns semantic-format-tag-functions))
126 (with-output-to-temp-buffer "*format-tag*"
127 (princ "Tag->format function tests:")
132 (let ((s (funcall (car fns) tag par (not arg))))
134 (set-buffer "*format-tag*")
135 (goto-char (point-max))
137 (setq fns (cdr fns))))
140 (defvar semantic-format-face-alist
141 `( (function . font-lock-function-name-face)
142 (variable . font-lock-variable-name-face)
143 (type . font-lock-type-face)
144 ;; These are different between Emacsen.
145 (include . ,(if (featurep 'xemacs)
146 'font-lock-preprocessor-face
147 'font-lock-constant-face))
148 (package . ,(if (featurep 'xemacs)
149 'font-lock-preprocessor-face
150 'font-lock-constant-face))
151 ;; Not a tag, but instead a feature of output
152 (label . font-lock-string-face)
153 (comment . font-lock-comment-face)
154 (keyword . font-lock-keyword-face)
157 (documentation . font-lock-doc-face)
159 "Face used to colorize tags of different types.
160 Override the value locally if a language supports other tag types.
161 When adding new elements, try to use symbols also returned by the parser.
162 The form of an entry in this list is of the form:
164 where SYMBOL is a tag type symbol used with semantic. FACE
165 is a symbol representing a face.
166 Faces used are generated in `font-lock' for consistency, and will not
167 be used unless font lock is a feature.")
169 (semantic-varalias-obsolete 'semantic-face-alist
170 'semantic-format-face-alist)
174 ;;; Coloring Functions
176 (defun semantic--format-colorize-text (text face-class)
177 "Apply onto TEXT a color associated with FACE-CLASS.
178 FACE-CLASS is a tag type found in `semantic-face-alist'. See this variable
179 for details on adding new types."
180 (if (featurep 'font-lock)
181 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
182 (newtext (concat text)))
183 (put-text-property 0 (length text) 'face face newtext)
187 (make-obsolete 'semantic-colorize-text
188 'semantic--format-colorize-text)
190 (defun semantic--format-colorize-merge-text (precoloredtext face-class)
191 "Apply onto PRECOLOREDTEXT a color associated with FACE-CLASS.
192 FACE-CLASS is a tag type found in 'semantic-face-alist'. See this
193 variable for details on adding new types."
194 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
195 (newtext (concat precoloredtext))
197 (if (featurep 'xemacs)
198 (add-text-properties 0 (length newtext) (list 'face face) newtext)
199 (alter-text-property 0 (length newtext) 'face
200 (lambda (current-face)
202 (cond ((facep current-face)
204 ((listp current-face)
217 ;;; Function Arguments
219 (defun semantic--format-tag-arguments (args formatter color)
220 "Format the argument list ARGS with FORMATTER.
221 FORMATTER is a function used to format a tag.
222 COLOR specifies if color should be used."
225 (push (if (and formatter
226 (semantic-tag-p (car args))
227 (not (string= (semantic-tag-name (car args)) ""))
229 (funcall formatter (car args) nil color)
230 (semantic-format-tag-name-from-anything
231 (car args) nil color 'variable))
233 (setq args (cdr args)))
234 (mapconcat 'identity (nreverse out) semantic-function-argument-separator)
238 (define-overloadable-function semantic-format-tag-type (tag color)
239 "Convert the data type of TAG to a string usable in tag formatting.
240 It is presumed that TYPE is a string or semantic tag.")
242 (defun semantic-format-tag-type-default (tag color)
243 "Convert the data type of TAG to a string usable in tag formatting.
244 Argument COLOR specifies to colorize the text."
245 (let* ((type (semantic-tag-type tag))
246 (out (cond ((semantic-tag-p type)
247 (let* ((typetype (semantic-tag-type type))
248 (name (semantic-tag-name type))
250 (concat typetype " " name)
253 (semantic--format-colorize-text
258 (stringp (car type)))
264 (setq out (semantic--format-colorize-text out 'type))
269 ;;; Abstract formatting functions
271 (defun semantic-format-tag-prin1 (tag &optional parent color)
272 "Convert TAG to a string that is the print name for TAG.
273 PARENT and COLOR are ignored."
276 (defun semantic-format-tag-name-from-anything (anything &optional
279 "Convert just about anything into a name like string.
280 Argument ANYTHING is the thing to be converted.
281 Optional argument PARENT is the parent type if TAG is a detail.
282 Optional argument COLOR means highlight the prototype with font-lock colors.
283 Optional COLORHINT is the type of color to use if ANYTHING is not a tag
284 with a tag class. See `semantic--format-colorize-text' for a definition
285 of FACE-CLASS for which this is used."
286 (cond ((stringp anything)
287 (semantic--format-colorize-text anything colorhint))
288 ((semantic-tag-p anything)
289 (let ((ans (semantic-format-tag-name anything parent color)))
290 ;; If ANS is empty string or nil, then the name wasn't
291 ;; supplied. The implication is as in C where there is a data
292 ;; type but no name for a prototype from an include file, or
293 ;; an argument just wasn't used in the body of the fcn.
294 (if (or (null ans) (string= ans ""))
295 (setq ans (semantic-format-tag-type anything color)))
297 ((and (listp anything)
298 (stringp (car anything)))
299 (semantic--format-colorize-text (car anything) colorhint))))
301 (defun semantic-format-tag-name-default (tag &optional parent color)
302 "Return an abbreviated string describing TAG.
303 Optional argument PARENT is the parent type if TAG is a detail.
304 Optional argument COLOR means highlight the prototype with font-lock colors."
305 (let ((name (semantic-tag-name tag))
307 (if (eq (semantic-tag-class tag) 'function)
308 (semantic-tag-function-destructor-p tag))))
310 (setq name (concat "~" name)))
312 (setq name (semantic--format-colorize-text name (semantic-tag-class tag))))
315 (declare-function semantic-go-to-tag "semantic/tag-file")
317 (defun semantic--format-tag-parent-tree (tag parent)
318 "Under Consideration.
320 Return a list of parents for TAG.
321 PARENT is the first parent, or nil. If nil, then an attempt to
322 determine PARENT is made.
323 Once PARENT is identified, additional parents are looked for.
324 The return list first element is the nearest parent, and the last
325 item is the first parent which may be a string. The root parent may
326 not be the actual first parent as there may just be a failure to find
328 ;; First, validate the PARENT argument.
330 ;; All mechanisms here must be fast as often parent
331 ;; is nil because there isn't one.
332 (setq parent (or (semantic-tag-function-parent tag)
334 (require 'semantic/tag-file)
335 (semantic-go-to-tag tag)
336 (semantic-current-tag-parent)))))
337 (when (stringp parent)
338 (setq parent (semantic-find-first-tag-by-name
339 parent (current-buffer))))
340 ;; Try and find a trail of parents from PARENT
341 (let ((rlist (list parent))
343 ;; IMPLELEMENT ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
346 (define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color)
347 "Return a canonical name for TAG.
348 A canonical name includes the names of any parents or namespaces preceeding
350 Optional argument PARENT is the parent type if TAG is a detail.
351 Optional argument COLOR means highlight the prototype with font-lock colors.")
353 (defun semantic-format-tag-canonical-name-default (tag &optional parent color)
354 "Return a canonical name for TAG.
355 A canonical name includes the names of any parents or namespaces preceeding
356 the tag with colons separating them.
357 Optional argument PARENT is the parent type if TAG is a detail.
358 Optional argument COLOR means highlight the prototype with font-lock colors."
359 (let ((parent-input-str
361 (semantic-tag-p parent)
362 (semantic-tag-of-class-p parent 'type))
364 ;; Choose a class of 'type as the default parent for something.
365 ;; Just a guess though.
366 (semantic-format-tag-name-from-anything parent nil color 'type)
367 ;; Default separator between class/namespace and others.
368 semantic-format-parent-separator)
371 (or (when (and (semantic-tag-of-class-p tag 'function)
372 (semantic-tag-function-parent tag))
373 (concat (semantic-tag-function-parent tag)
374 semantic-format-parent-separator))
377 (concat parent-input-str
379 (semantic-format-tag-name tag parent color))
382 (define-overloadable-function semantic-format-tag-abbreviate (tag &optional parent color)
383 "Return an abbreviated string describing TAG.
384 The abbreviation is to be short, with possible symbols indicating
385 the type of tag, or other information.
386 Optional argument PARENT is the parent type if TAG is a detail.
387 Optional argument COLOR means highlight the prototype with font-lock colors.")
389 (defun semantic-format-tag-abbreviate-default (tag &optional parent color)
390 "Return an abbreviated string describing TAG.
391 Optional argument PARENT is a parent tag in the tag hierarchy.
392 In this case PARENT refers to containment, not inheritance.
393 Optional argument COLOR means highlight the prototype with font-lock colors.
394 This is a simple C like default."
395 ;; Do lots of complex stuff here.
396 (let ((class (semantic-tag-class tag))
397 (name (semantic-format-tag-canonical-name tag parent color))
401 (cond ((eq class 'function)
405 ((eq class 'variable)
406 (setq suffix (if (semantic-tag-variable-default tag)
416 (setq str (concat prefix name suffix))
419 ;; Semantic 1.2.x had this misspelling. Keep it for backwards compatibiity.
420 (semantic-alias-obsolete
421 'semantic-summerize-nonterminal 'semantic-format-tag-summarize)
424 (define-overloadable-function semantic-format-tag-summarize (tag &optional parent color)
425 "Summarize TAG in a reasonable way.
426 Optional argument PARENT is the parent type if TAG is a detail.
427 Optional argument COLOR means highlight the prototype with font-lock colors.")
429 (defun semantic-format-tag-summarize-default (tag &optional parent color)
430 "Summarize TAG in a reasonable way.
431 Optional argument PARENT is the parent type if TAG is a detail.
432 Optional argument COLOR means highlight the prototype with font-lock colors."
433 (let* ((proto (semantic-format-tag-prototype tag nil color))
435 semantic-symbol->name-assoc-list-for-type-parts
436 semantic-symbol->name-assoc-list))
437 (tsymb (semantic-tag-class tag))
438 (label (capitalize (or (cdr-safe (assoc tsymb names))
439 (symbol-name tsymb)))))
441 (setq label (semantic--format-colorize-text label 'label)))
442 (concat label ": " proto)))
444 (define-overloadable-function semantic-format-tag-summarize-with-file (tag &optional parent color)
445 "Like `semantic-format-tag-summarize', but with the file name.
446 Optional argument PARENT is the parent type if TAG is a detail.
447 Optional argument COLOR means highlight the prototype with font-lock colors.")
449 (defun semantic-format-tag-summarize-with-file-default (tag &optional parent color)
450 "Summarize TAG in a reasonable way.
451 Optional argument PARENT is the parent type if TAG is a detail.
452 Optional argument COLOR means highlight the prototype with font-lock colors."
453 (let* ((proto (semantic-format-tag-prototype tag nil color))
454 (file (semantic-tag-file-name tag))
456 ;; Nothing for tag? Try parent.
457 (when (and (not file) (and parent))
458 (setq file (semantic-tag-file-name parent)))
459 ;; Don't include the file name if we can't find one, or it is the
460 ;; same as the current buffer.
462 (string= file (buffer-file-name (current-buffer))))
464 (setq file (file-name-nondirectory file))
466 (setq file (semantic--format-colorize-text file 'label)))
467 (concat file ": " proto))))
469 (define-overloadable-function semantic-format-tag-short-doc (tag &optional parent color)
470 "Display a short form of TAG's documentation. (Comments, or docstring.)
471 Optional argument PARENT is the parent type if TAG is a detail.
472 Optional argument COLOR means highlight the prototype with font-lock colors.")
474 (declare-function semantic-documentation-for-tag "semantic/doc")
476 (defun semantic-format-tag-short-doc-default (tag &optional parent color)
477 "Display a short form of TAG's documentation. (Comments, or docstring.)
478 Optional argument PARENT is the parent type if TAG is a detail.
479 Optional argument COLOR means highlight the prototype with font-lock colors."
481 (let* ((fname (or (semantic-tag-file-name tag)
482 (when parent (semantic-tag-file-name parent))))
483 (buf (or (semantic-tag-buffer tag)
484 (when parent (semantic-tag-buffer parent))))
485 (doc (semantic-tag-docstring tag buf)))
486 (when (and (not doc) (not buf) fname)
487 ;; If there is no doc, and no buffer, but we have a filename,
489 (setq buf (find-file-noselect fname))
490 (setq doc (semantic-tag-docstring tag buf)))
492 (require 'semantic/doc)
493 (setq doc (semantic-documentation-for-tag tag))
497 ;; No doc, use summarize.
498 (semantic-format-tag-summarize tag parent color)
499 ;; We have doc. Can we devise a single line?
500 (if (string-match "$" doc)
501 (substring doc 0 (match-beginning 0))
505 (setq doc (semantic--format-colorize-text doc 'documentation)))
509 ;;; Prototype generation
511 (defun semantic-format-tag-prototype-default (tag &optional parent color)
512 "Default method for returning a prototype for TAG.
513 This will work for C like languages.
514 Optional argument PARENT is the parent type if TAG is a detail.
515 Optional argument COLOR means highlight the prototype with font-lock colors."
516 (let* ((class (semantic-tag-class tag))
517 (name (semantic-format-tag-name tag parent color))
518 (type (if (member class '(function variable type))
519 (semantic-format-tag-type tag color)))
520 (args (if (member class '(function type))
521 (semantic--format-tag-arguments
522 (if (eq class 'function)
523 (semantic-tag-function-arguments tag)
525 ;;(semantic-tag-type-members tag)
527 #'semantic-format-tag-prototype
529 (const (semantic-tag-get-attribute tag :constant-flag))
530 (tm (semantic-tag-get-attribute tag :typemodifiers))
532 (if const '("const") nil)
533 (cond ((stringp tm) (list tm))
537 (array (if (eq class 'variable)
539 (semantic-tag-get-attribute
542 (while (and deref (/= deref 0))
543 (setq r (concat r "[]")
550 (if (eq class 'type) "{" "(")
552 (if (eq class 'type) "}" ")"))))
554 (setq mods (concat (mapconcat 'identity mods " ") " ")))
556 (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
796 ;; generated-autoload-load-name: "semantic/format"
799 ;;; semantic/format.el ends here