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-ls)
42 (require 'semantic/find))
44 ;;; Tag to text overload functions
46 ;; abbreviations, prototypes, and coloring support.
47 (defvar semantic-format-tag-functions
48 '(semantic-format-tag-name
49 semantic-format-tag-canonical-name
50 semantic-format-tag-abbreviate
51 semantic-format-tag-summarize
52 semantic-format-tag-summarize-with-file
53 semantic-format-tag-short-doc
54 semantic-format-tag-prototype
55 semantic-format-tag-concise-prototype
56 semantic-format-tag-uml-abbreviate
57 semantic-format-tag-uml-prototype
58 semantic-format-tag-uml-concise-prototype
59 semantic-format-tag-prin1
61 "List of functions which convert a tag to text.
62 Each function must take the parameters TAG &optional PARENT COLOR.
63 TAG is the tag to convert.
64 PARENT is a parent tag or name which refers to the structure
65 or class which contains TAG. PARENT is NOT a class which a TAG
66 would claim as a parent.
67 COLOR indicates that the generated text should be colored using
70 (semantic-varalias-obsolete 'semantic-token->text-functions
71 'semantic-format-tag-functions)
73 (defvar semantic-format-tag-custom-list
75 (mapcar (lambda (f) (list 'const f))
76 semantic-format-tag-functions)
78 "A List used by customizeable variables to choose a tag to text function.
79 Use this variable in the :type field of a customizable variable.")
81 (semantic-varalias-obsolete 'semantic-token->text-custom-list
82 'semantic-format-tag-custom-list)
84 (defcustom semantic-format-use-images-flag ezimage-use-images
85 "Non-nil means semantic format functions use images.
86 Images can be used as icons instead of some types of text strings."
90 (defvar semantic-function-argument-separator ","
91 "Text used to separate arguments when creating text from tags.")
92 (make-variable-buffer-local 'semantic-function-argument-separator)
94 (defvar semantic-format-parent-separator "::"
95 "Text used to separate names when between namespaces/classes and functions.")
96 (make-variable-buffer-local 'semantic-format-parent-separator)
99 (define-overloadable-function semantic-format-tag-name (tag &optional parent color)
100 "Return the name string describing TAG.
101 The name is the shortest possible representation.
102 Optional argument PARENT is the parent type if TAG is a detail.
103 Optional argument COLOR means highlight the prototype with font-lock colors.")
105 (defun semantic-format-tag-name-default (tag &optional parent color)
106 "Return an abbreviated string describing TAG.
107 Optional argument PARENT is the parent type if TAG is a detail.
108 Optional argument COLOR means highlight the prototype with font-lock colors."
109 (let ((name (semantic-tag-name tag))
111 (if (eq (semantic-tag-class tag) 'function)
112 (semantic-tag-function-destructor-p tag))))
114 (setq name (concat "~" name)))
116 (setq name (semantic--format-colorize-text name (semantic-tag-class tag))))
120 (define-overloadable-function semantic-format-tag-prototype (tag &optional parent color)
121 "Return a prototype for TAG.
122 This function should be overloaded, though it need not be used.
123 This is because it can be used to create code by language independent
125 Optional argument PARENT is the parent type if TAG is a detail.
126 Optional argument COLOR means highlight the prototype with font-lock colors.")
129 (defun semantic-test-all-format-tag-functions (&optional arg)
130 "Test all outputs from `semantic-format-tag-functions'.
131 Output is generated from the function under `point'.
132 Optional argument ARG specifies not to use color."
134 (require 'semantic/find)
135 (semantic-fetch-tags)
136 (let* ((tag (semantic-current-tag))
137 (par (semantic-current-tag-parent))
138 (fns semantic-format-tag-functions))
139 (with-output-to-temp-buffer "*format-tag*"
140 (princ "Tag->format function tests:")
145 (let ((s (funcall (car fns) tag par (not arg))))
147 (set-buffer "*format-tag*")
148 (goto-char (point-max))
150 (setq fns (cdr fns))))
153 (defvar semantic-format-face-alist
154 `( (function . font-lock-function-name-face)
155 (variable . font-lock-variable-name-face)
156 (type . font-lock-type-face)
157 ;; These are different between Emacsen.
158 (include . ,(if (featurep 'xemacs)
159 'font-lock-preprocessor-face
160 'font-lock-constant-face))
161 (package . ,(if (featurep 'xemacs)
162 'font-lock-preprocessor-face
163 'font-lock-constant-face))
164 ;; Not a tag, but instead a feature of output
165 (label . font-lock-string-face)
166 (comment . font-lock-comment-face)
167 (keyword . font-lock-keyword-face)
170 (documentation . font-lock-doc-face)
172 "Face used to colorize tags of different types.
173 Override the value locally if a language supports other tag types.
174 When adding new elements, try to use symbols also returned by the parser.
175 The form of an entry in this list is of the form:
177 where SYMBOL is a tag type symbol used with semantic. FACE
178 is a symbol representing a face.
179 Faces used are generated in `font-lock' for consistency, and will not
180 be used unless font lock is a feature.")
182 (semantic-varalias-obsolete 'semantic-face-alist
183 'semantic-format-face-alist)
187 ;;; Coloring Functions
189 (defun semantic--format-colorize-text (text face-class)
190 "Apply onto TEXT a color associated with FACE-CLASS.
191 FACE-CLASS is a tag type found in `semantic-face-alist'. See this variable
192 for details on adding new types."
193 (if (featurep 'font-lock)
194 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
195 (newtext (concat text)))
196 (put-text-property 0 (length text) 'face face newtext)
200 (make-obsolete 'semantic-colorize-text
201 'semantic--format-colorize-text)
203 (defun semantic--format-colorize-merge-text (precoloredtext face-class)
204 "Apply onto PRECOLOREDTEXT a color associated with FACE-CLASS.
205 FACE-CLASS is a tag type found in 'semantic-face-alist'. See this
206 variable for details on adding new types."
207 (let ((face (cdr-safe (assoc face-class semantic-format-face-alist)))
208 (newtext (concat precoloredtext))
210 (if (featurep 'xemacs)
211 (add-text-properties 0 (length newtext) (list 'face face) newtext)
212 (alter-text-property 0 (length newtext) 'face
213 (lambda (current-face)
215 (cond ((facep current-face)
217 ((listp current-face)
230 ;;; Function Arguments
232 (defun semantic--format-tag-arguments (args formatter color)
233 "Format the argument list ARGS with FORMATTER.
234 FORMATTER is a function used to format a tag.
235 COLOR specifies if color should be used."
238 (push (if (and formatter
239 (semantic-tag-p (car args))
240 (not (string= (semantic-tag-name (car args)) ""))
242 (funcall formatter (car args) nil color)
243 (semantic-format-tag-name-from-anything
244 (car args) nil color 'variable))
246 (setq args (cdr args)))
247 (mapconcat 'identity (nreverse out) semantic-function-argument-separator)
251 (define-overloadable-function semantic-format-tag-type (tag color)
252 "Convert the data type of TAG to a string usable in tag formatting.
253 It is presumed that TYPE is a string or semantic tag.")
255 (defun semantic-format-tag-type-default (tag color)
256 "Convert the data type of TAG to a string usable in tag formatting.
257 Argument COLOR specifies to colorize the text."
258 (let* ((type (semantic-tag-type tag))
259 (out (cond ((semantic-tag-p type)
260 (let* ((typetype (semantic-tag-type type))
261 (name (semantic-tag-name type))
263 (concat typetype " " name)
266 (semantic--format-colorize-text
271 (stringp (car type)))
277 (setq out (semantic--format-colorize-text out 'type))
282 ;;; Abstract formatting functions
284 (defun semantic-format-tag-prin1 (tag &optional parent color)
285 "Convert TAG to a string that is the print name for TAG.
286 PARENT and COLOR are ignored."
289 (defun semantic-format-tag-name-from-anything (anything &optional
292 "Convert just about anything into a name like string.
293 Argument ANYTHING is the thing to be converted.
294 Optional argument PARENT is the parent type if TAG is a detail.
295 Optional argument COLOR means highlight the prototype with font-lock colors.
296 Optional COLORHINT is the type of color to use if ANYTHING is not a tag
297 with a tag class. See `semantic--format-colorize-text' for a definition
298 of FACE-CLASS for which this is used."
299 (cond ((stringp anything)
300 (semantic--format-colorize-text anything colorhint))
301 ((semantic-tag-p anything)
302 (let ((ans (semantic-format-tag-name anything parent color)))
303 ;; If ANS is empty string or nil, then the name wasn't
304 ;; supplied. The implication is as in C where there is a data
305 ;; type but no name for a prototype from an include file, or
306 ;; an argument just wasn't used in the body of the fcn.
307 (if (or (null ans) (string= ans ""))
308 (setq ans (semantic-format-tag-type anything color)))
310 ((and (listp anything)
311 (stringp (car anything)))
312 (semantic--format-colorize-text (car anything) colorhint))))
314 (declare-function semantic-go-to-tag "semantic/tag-file")
316 (defun semantic--format-tag-parent-tree (tag parent)
317 "Under Consideration.
319 Return a list of parents for TAG.
320 PARENT is the first parent, or nil. If nil, then an attempt to
321 determine PARENT is made.
322 Once PARENT is identified, additional parents are looked for.
323 The return list first element is the nearest parent, and the last
324 item is the first parent which may be a string. The root parent may
325 not be the actual first parent as there may just be a failure to find
327 ;; First, validate the PARENT argument.
329 ;; All mechanisms here must be fast as often parent
330 ;; is nil because there isn't one.
331 (setq parent (or (semantic-tag-function-parent tag)
333 (require 'semantic/tag-file)
334 (semantic-go-to-tag tag)
335 (semantic-current-tag-parent)))))
336 (when (stringp parent)
337 (setq parent (semantic-find-first-tag-by-name
338 parent (current-buffer))))
339 ;; Try and find a trail of parents from PARENT
340 (let ((rlist (list parent))
342 ;; IMPLELEMENT ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
345 (define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color)
346 "Return a canonical name for TAG.
347 A canonical name includes the names of any parents or namespaces preceeding
349 Optional argument PARENT is the parent type if TAG is a detail.
350 Optional argument COLOR means highlight the prototype with font-lock colors.")
352 (defun semantic-format-tag-canonical-name-default (tag &optional parent color)
353 "Return a canonical name for TAG.
354 A canonical name includes the names of any parents or namespaces preceeding
355 the tag with colons separating them.
356 Optional argument PARENT is the parent type if TAG is a detail.
357 Optional argument COLOR means highlight the prototype with font-lock colors."
358 (let ((parent-input-str
360 (semantic-tag-p parent)
361 (semantic-tag-of-class-p parent 'type))
363 ;; Choose a class of 'type as the default parent for something.
364 ;; Just a guess though.
365 (semantic-format-tag-name-from-anything parent nil color 'type)
366 ;; Default separator between class/namespace and others.
367 semantic-format-parent-separator)
370 (or (when (and (semantic-tag-of-class-p tag 'function)
371 (semantic-tag-function-parent tag))
372 (concat (semantic-tag-function-parent tag)
373 semantic-format-parent-separator))
376 (concat parent-input-str
378 (semantic-format-tag-name tag parent color))
381 (define-overloadable-function semantic-format-tag-abbreviate (tag &optional parent color)
382 "Return an abbreviated string describing TAG.
383 The abbreviation is to be short, with possible symbols indicating
384 the type of tag, or other information.
385 Optional argument PARENT is the parent type if TAG is a detail.
386 Optional argument COLOR means highlight the prototype with font-lock colors.")
388 (defun semantic-format-tag-abbreviate-default (tag &optional parent color)
389 "Return an abbreviated string describing TAG.
390 Optional argument PARENT is a parent tag in the tag hierarchy.
391 In this case PARENT refers to containment, not inheritance.
392 Optional argument COLOR means highlight the prototype with font-lock colors.
393 This is a simple C like default."
394 ;; Do lots of complex stuff here.
395 (let ((class (semantic-tag-class tag))
396 (name (semantic-format-tag-canonical-name tag parent color))
400 (cond ((eq class 'function)
404 ((eq class 'variable)
405 (setq suffix (if (semantic-tag-variable-default tag)
415 (setq str (concat prefix name suffix))
418 ;; Semantic 1.2.x had this misspelling. Keep it for backwards compatibiity.
419 (semantic-alias-obsolete
420 'semantic-summerize-nonterminal 'semantic-format-tag-summarize)
423 (define-overloadable-function semantic-format-tag-summarize (tag &optional parent color)
424 "Summarize TAG in a reasonable way.
425 Optional argument PARENT is the parent type if TAG is a detail.
426 Optional argument COLOR means highlight the prototype with font-lock colors.")
428 (defun semantic-format-tag-summarize-default (tag &optional parent color)
429 "Summarize TAG in a reasonable way.
430 Optional argument PARENT is the parent type if TAG is a detail.
431 Optional argument COLOR means highlight the prototype with font-lock colors."
432 (let* ((proto (semantic-format-tag-prototype tag nil color))
434 semantic-symbol->name-assoc-list-for-type-parts
435 semantic-symbol->name-assoc-list))
436 (tsymb (semantic-tag-class tag))
437 (label (capitalize (or (cdr-safe (assoc tsymb names))
438 (symbol-name tsymb)))))
440 (setq label (semantic--format-colorize-text label 'label)))
441 (concat label ": " proto)))
443 (define-overloadable-function semantic-format-tag-summarize-with-file (tag &optional parent color)
444 "Like `semantic-format-tag-summarize', but with the file name.
445 Optional argument PARENT is the parent type if TAG is a detail.
446 Optional argument COLOR means highlight the prototype with font-lock colors.")
448 (defun semantic-format-tag-summarize-with-file-default (tag &optional parent color)
449 "Summarize TAG in a reasonable way.
450 Optional argument PARENT is the parent type if TAG is a detail.
451 Optional argument COLOR means highlight the prototype with font-lock colors."
452 (let* ((proto (semantic-format-tag-prototype tag nil color))
453 (file (semantic-tag-file-name tag))
455 ;; Nothing for tag? Try parent.
456 (when (and (not file) (and parent))
457 (setq file (semantic-tag-file-name parent)))
458 ;; Don't include the file name if we can't find one, or it is the
459 ;; same as the current buffer.
461 (string= file (buffer-file-name (current-buffer))))
463 (setq file (file-name-nondirectory file))
465 (setq file (semantic--format-colorize-text file 'label)))
466 (concat file ": " proto))))
468 (define-overloadable-function semantic-format-tag-short-doc (tag &optional parent color)
469 "Display a short form of TAG's documentation. (Comments, or docstring.)
470 Optional argument PARENT is the parent type if TAG is a detail.
471 Optional argument COLOR means highlight the prototype with font-lock colors.")
473 (declare-function semantic-documentation-for-tag "semantic/doc")
475 (defun semantic-format-tag-short-doc-default (tag &optional parent color)
476 "Display a short form of TAG's documentation. (Comments, or docstring.)
477 Optional argument PARENT is the parent type if TAG is a detail.
478 Optional argument COLOR means highlight the prototype with font-lock colors."
479 (let* ((fname (or (semantic-tag-file-name tag)
480 (when parent (semantic-tag-file-name parent))))
481 (buf (or (semantic-tag-buffer tag)
482 (when parent (semantic-tag-buffer parent))))
483 (doc (semantic-tag-docstring tag buf)))
484 (when (and (not doc) (not buf) fname)
485 ;; If there is no doc, and no buffer, but we have a filename,
487 (setq buf (find-file-noselect fname))
488 (setq doc (semantic-tag-docstring tag buf)))
490 (require 'semantic/doc)
491 (setq doc (semantic-documentation-for-tag tag))
495 ;; No doc, use summarize.
496 (semantic-format-tag-summarize tag parent color)
497 ;; We have doc. Can we devise a single line?
498 (if (string-match "$" doc)
499 (substring doc 0 (match-beginning 0))
503 (setq doc (semantic--format-colorize-text doc 'documentation)))
507 ;;; Prototype generation
509 (defun semantic-format-tag-prototype-default (tag &optional parent color)
510 "Default method for returning a prototype for TAG.
511 This will work for C like languages.
512 Optional argument PARENT is the parent type if TAG is a detail.
513 Optional argument COLOR means highlight the prototype with font-lock colors."
514 (let* ((class (semantic-tag-class tag))
515 (name (semantic-format-tag-name tag parent color))
516 (type (if (member class '(function variable type))
517 (semantic-format-tag-type tag color)))
518 (args (if (member class '(function type))
519 (semantic--format-tag-arguments
520 (if (eq class 'function)
521 (semantic-tag-function-arguments tag)
523 ;;(semantic-tag-type-members tag)
525 #'semantic-format-tag-prototype
527 (const (semantic-tag-get-attribute tag :constant-flag))
528 (tm (semantic-tag-get-attribute tag :typemodifiers))
530 (if const '("const") nil)
531 (cond ((stringp tm) (list tm))
535 (array (if (eq class 'variable)
537 (semantic-tag-get-attribute
540 (while (and deref (/= deref 0))
541 (setq r (concat r "[]")
548 (if (eq class 'type) "{" "(")
550 (if (eq class 'type) "}" ")"))))
552 (setq mods (concat (mapconcat 'identity mods " ") " ")))
554 (if type (concat type " "))
560 (define-overloadable-function semantic-format-tag-concise-prototype (tag &optional parent color)
561 "Return a concise prototype for TAG.
562 Optional argument PARENT is the parent type if TAG is a detail.
563 Optional argument COLOR means highlight the prototype with font-lock colors.")
565 (defun semantic-format-tag-concise-prototype-default (tag &optional parent color)
566 "Return a concise prototype for TAG.
567 This default function will make a cheap concise prototype using C like syntax.
568 Optional argument PARENT is the parent type if TAG is a detail.
569 Optional argument COLOR means highlight the prototype with font-lock colors."
570 (let ((class (semantic-tag-class tag)))
573 (concat (semantic-format-tag-name tag parent color) "{}"))
574 ((eq class 'function)
575 (concat (semantic-format-tag-name tag parent color)
577 (semantic--format-tag-arguments
578 (semantic-tag-function-arguments tag)
579 'semantic-format-tag-concise-prototype
582 ((eq class 'variable)
583 (let* ((deref (semantic-tag-get-attribute
587 (while (and deref (/= deref 0))
588 (setq array (concat array "[]")
590 (concat (semantic-format-tag-name tag parent color)
593 (semantic-format-tag-abbreviate tag parent color)))))
595 ;;; UML display styles
597 (defcustom semantic-uml-colon-string " : "
598 "*String used as a color separator between parts of a UML string.
599 In UML, a variable may appear as `varname : type'.
600 Change this variable to change the output separator."
604 (defcustom semantic-uml-no-protection-string ""
605 "*String used to describe when no protection is specified.
606 Used by `semantic-format-tag-uml-protection-to-string'."
610 (defun semantic--format-uml-post-colorize (text tag parent)
611 "Add color to TEXT created from TAG and PARENT.
612 Adds augmentation for `abstract' and `static' entries."
613 (if (semantic-tag-abstract-p tag parent)
614 (setq text (semantic--format-colorize-merge-text text 'abstract)))
615 (if (semantic-tag-static-p tag parent)
616 (setq text (semantic--format-colorize-merge-text text 'static)))
620 (defun semantic-uml-attribute-string (tag &optional parent)
621 "Return a string for TAG, a child of PARENT representing a UML attribute.
622 UML attribute strings are things like {abstract} or {leaf}."
623 (cond ((semantic-tag-abstract-p tag parent)
625 ((semantic-tag-leaf-p tag parent)
629 (defvar semantic-format-tag-protection-image-alist
630 '(("+" . ezimage-unlock)
634 "Association of protection strings, and images to use.")
636 (defvar semantic-format-tag-protection-symbol-to-string-assoc-list
641 "Association list of the form (SYMBOL . \"STRING\") for protection symbols.
642 This associates a symbol, such as 'public with the st ring \"+\".")
644 (define-overloadable-function semantic-format-tag-uml-protection-to-string (protection-symbol color)
645 "Convert PROTECTION-SYMBOL to a string for UML.
646 By default, uses `semantic-format-tag-protection-symbol-to-string-assoc-list'
648 By defaul character returns are:
652 If PROTECTION-SYMBOL is unknown, then the return value is
653 `semantic-uml-no-protection-string'.
654 COLOR indicates if we should use an image on the text.")
656 (defun semantic-format-tag-uml-protection-to-string-default (protection-symbol color)
657 "Convert PROTECTION-SYMBOL to a string for UML.
658 Uses `semantic-format-tag-protection-symbol-to-string-assoc-list' to convert.
659 If PROTECTION-SYMBOL is unknown, then the return value is
660 `semantic-uml-no-protection-string'.
661 COLOR indicates if we should use an image on the text."
662 (let* ((ezimage-use-images (and semantic-format-use-images-flag color))
663 (key (assoc protection-symbol
664 semantic-format-tag-protection-symbol-to-string-assoc-list))
665 (str (or (cdr-safe key) semantic-uml-no-protection-string)))
666 (ezimage-image-over-string
667 (copy-sequence str) ; make a copy to keep the original pristine.
668 semantic-format-tag-protection-image-alist)))
670 (defsubst semantic-format-tag-uml-protection (tag parent color)
671 "Retrieve the protection string for TAG with PARENT.
672 Argument COLOR specifies that color should be added to the string as
674 (semantic-format-tag-uml-protection-to-string
675 (semantic-tag-protection tag parent)
678 (defun semantic--format-tag-uml-type (tag color)
679 "Format the data type of TAG to a string usable for formatting.
680 COLOR indicates if it should be colorized."
681 (let ((str (semantic-format-tag-type tag color)))
683 (concat semantic-uml-colon-string str))))
685 (define-overloadable-function semantic-format-tag-uml-abbreviate (tag &optional parent color)
686 "Return a UML style abbreviation for TAG.
687 Optional argument PARENT is the parent type if TAG is a detail.
688 Optional argument COLOR means highlight the prototype with font-lock colors.")
690 (defun semantic-format-tag-uml-abbreviate-default (tag &optional parent color)
691 "Return a UML style abbreviation for TAG.
692 Optional argument PARENT is the parent type if TAG is a detail.
693 Optional argument COLOR means highlight the prototype with font-lock colors."
694 (let* ((name (semantic-format-tag-name tag parent color))
695 (type (semantic--format-tag-uml-type tag color))
696 (protstr (semantic-format-tag-uml-protection tag parent color))
701 (if type (concat name type)
704 (setq text (semantic--format-uml-post-colorize text tag parent)))
707 (define-overloadable-function semantic-format-tag-uml-prototype (tag &optional parent color)
708 "Return a UML style prototype for TAG.
709 Optional argument PARENT is the parent type if TAG is a detail.
710 Optional argument COLOR means highlight the prototype with font-lock colors.")
712 (defun semantic-format-tag-uml-prototype-default (tag &optional parent color)
713 "Return a UML style prototype for TAG.
714 Optional argument PARENT is the parent type if TAG is a detail.
715 Optional argument COLOR means highlight the prototype with font-lock colors."
716 (let* ((class (semantic-tag-class tag))
717 (cp (semantic-format-tag-name tag parent color))
718 (type (semantic--format-tag-uml-type tag color))
719 (prot (semantic-format-tag-uml-protection tag parent color))
721 (cond ((eq class 'function)
724 (semantic--format-tag-arguments
725 (semantic-tag-function-arguments tag)
726 #'semantic-format-tag-uml-prototype
732 (setq text (concat prot cp argtext type))
734 (setq text (semantic--format-uml-post-colorize text tag parent)))
738 (define-overloadable-function semantic-format-tag-uml-concise-prototype (tag &optional parent color)
739 "Return a UML style concise prototype for TAG.
740 Optional argument PARENT is the parent type if TAG is a detail.
741 Optional argument COLOR means highlight the prototype with font-lock colors.")
743 (defun semantic-format-tag-uml-concise-prototype-default (tag &optional parent color)
744 "Return a UML style concise prototype for TAG.
745 Optional argument PARENT is the parent type if TAG is a detail.
746 Optional argument COLOR means highlight the prototype with font-lock colors."
747 (let* ((cp (semantic-format-tag-concise-prototype tag parent color))
748 (type (semantic--format-tag-uml-type tag color))
749 (prot (semantic-format-tag-uml-protection tag parent color))
752 (setq text (concat prot cp type))
754 (setq text (semantic--format-uml-post-colorize text tag parent)))
759 ;;; Compatibility and aliases
761 (semantic-alias-obsolete 'semantic-prin1-nonterminal
762 'semantic-format-tag-prin1)
764 (semantic-alias-obsolete 'semantic-name-nonterminal
765 'semantic-format-tag-name)
767 (semantic-alias-obsolete 'semantic-abbreviate-nonterminal
768 'semantic-format-tag-abbreviate)
770 (semantic-alias-obsolete 'semantic-summarize-nonterminal
771 'semantic-format-tag-summarize)
773 (semantic-alias-obsolete 'semantic-prototype-nonterminal
774 'semantic-format-tag-prototype)
776 (semantic-alias-obsolete 'semantic-concise-prototype-nonterminal
777 'semantic-format-tag-concise-prototype)
779 (semantic-alias-obsolete 'semantic-uml-abbreviate-nonterminal
780 'semantic-format-tag-uml-abbreviate)
782 (semantic-alias-obsolete 'semantic-uml-prototype-nonterminal
783 'semantic-format-tag-uml-prototype)
785 (semantic-alias-obsolete 'semantic-uml-concise-prototype-nonterminal
786 'semantic-format-tag-uml-concise-prototype)
789 (provide 'semantic/format)
792 ;; generated-autoload-file: "loaddefs.el"
793 ;; generated-autoload-feature: semantic/loaddefs
794 ;; generated-autoload-load-name: "semantic/format"
797 ;;; semantic/format.el ends here