- (if (fboundp symbol)
- (if (setq doc (documentation symbol t))
- (substring doc 0 (string-match "\n" doc))
- "(not documented)"))
- (if (boundp symbol)
- (if (setq doc (documentation-property
- symbol 'variable-documentation t))
- (substring doc 0
- (string-match "\n" doc))
- "(not documented)"))
- (if (setq doc (symbol-plist symbol))
- (if (eq (/ (length doc) 2) 1)
- (format "1 property (%s)" (car doc))
- (concat (/ (length doc) 2) " properties")))))
+ (when (fboundp symbol)
+ (if (setq doc (documentation symbol t))
+ (substring doc 0 (string-match "\n" doc))
+ "(not documented)"))
+ (when (boundp symbol)
+ (if (setq doc (documentation-property
+ symbol 'variable-documentation t))
+ (substring doc 0 (string-match "\n" doc))
+ "(not documented)"))
+ (when (setq properties (symbol-plist symbol))
+ (setq doc (list (car properties)))
+ (while (setq properties (cdr (cdr properties)))
+ (setq doc (cons (car properties) doc)))
+ (mapconcat #'symbol-name (nreverse doc) " "))
+ (when (get symbol 'widget-type)
+ (if (setq doc (documentation-property
+ symbol 'widget-documentation t))
+ (substring doc 0
+ (string-match "\n" doc))
+ "(not documented)"))
+ (when (facep symbol)
+ (if (setq doc (documentation-property
+ symbol 'face-documentation t))
+ (substring doc 0
+ (string-match "\n" doc))
+ "(not documented)"))
+ (when (get symbol 'custom-group)
+ (if (setq doc (documentation-property
+ symbol 'group-documentation t))
+ (substring doc 0
+ (string-match "\n" doc))
+ "(not documented)"))))