]> code.delx.au - gnu-emacs/blobdiff - lisp/cedet/semantic/format.el
Update copyright year to 2016
[gnu-emacs] / lisp / cedet / semantic / format.el
index 8a099a9bfb0ab64f4d92fed069e86b5efef0d6f1..1fe703fd09a1c3253a7b5b51828a50eae2d5ec40 100644 (file)
@@ -1,6 +1,6 @@
 ;;; semantic/format.el --- Routines for formatting tags
 
-;; Copyright (C) 1999-2005, 2007-201 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2005, 2007-2016 Free Software Foundation, Inc.
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Keywords: syntax
@@ -499,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 " "
@@ -512,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)
@@ -603,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 -- #.