]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/format.el
Update copyright year to 2016
[gnu-emacs] / lisp / cedet / semantic / format.el
index 86059de86feb403ef12534359ad492d72939212f..1fe703fd09a1c3253a7b5b51828a50eae2d5ec40 100644 (file)
@@ -1,7 +1,6 @@
 ;;; semantic/format.el --- Routines for formatting tags
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008,
-;;   2009, 2010, 2011  Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2007-2016 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
@@ -292,12 +291,12 @@ local definitions."
   ;; Try and find a trail of parents from PARENT
   (let ((rlist (list parent))
        )
-    ;; IMPLELEMENT ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    ;; IMPLEMENT ME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     (reverse rlist)))
 
 (define-overloadable-function semantic-format-tag-canonical-name (tag &optional parent color)
   "Return a canonical name for TAG.
-A canonical name includes the names of any parents or namespaces preceeding
+A canonical name includes the names of any parents or namespaces preceding
 the tag.
 Optional argument PARENT is the parent type if TAG is a detail.
 Optional argument COLOR means highlight the prototype with font-lock colors.")
@@ -432,7 +431,7 @@ Optional argument COLOR means highlight the prototype with font-lock colors."
         (doc (semantic-tag-docstring tag buf)))
     (when (and (not doc) (not buf) fname)
       ;; If there is no doc, and no buffer, but we have a filename,
-      ;; lets try again.
+      ;; let's try again.
       (save-match-data
        (setq buf (find-file-noselect fname)))
       (setq doc (semantic-tag-docstring tag buf)))
@@ -500,7 +499,12 @@ Optional argument COLOR means highlight the prototype with font-lock colors."
                        (setq r (concat r "[]")
                              deref (1- deref)))
                      r)))
-        )
+        (default (when (eq class 'variable)
+                   (let ((defval
+                           (semantic-tag-get-attribute tag :default-value)))
+                     (when (and defval (stringp defval))
+                       (concat "[=" defval "]")))))
+        )
     (if args
        (setq args
              (concat " "
@@ -513,7 +517,8 @@ Optional argument COLOR means highlight the prototype with font-lock colors."
            (if type (concat type " "))
            name
            (or args "")
-           (or array ""))))
+           (or array "")
+           (or default ""))))
 
 ;;;###autoload
 (define-overloadable-function semantic-format-tag-concise-prototype (tag &optional parent color)
@@ -604,7 +609,7 @@ This associates a symbol, such as 'public with the st ring \"+\".")
   "Convert PROTECTION-SYMBOL to a string for UML.
 By default, uses `semantic-format-tag-protection-symbol-to-string-assoc-list'
 to convert.
-By defaul character returns are:
+By default character returns are:
   public    -- +
   private   -- -
   protected -- #.
@@ -720,5 +725,4 @@ Optional argument COLOR means highlight the prototype with font-lock colors."
 ;; generated-autoload-load-name: "semantic/format"
 ;; End:
 
-;; arch-tag: deae500e-20b6-437e-8856-884f6c46bc3e
 ;;; semantic/format.el ends here