]> code.delx.au - gnu-emacs-elpa/commitdiff
check function doc before variable doc
authorNoam Postavsky <npostavs@users.sourceforge.net>
Thu, 28 Nov 2013 02:44:18 +0000 (21:44 -0500)
committerNoam Postavsky <npostavs@users.sourceforge.net>
Thu, 28 Nov 2013 02:44:18 +0000 (21:44 -0500)
This means functions shadow variables with the same name, but at least
that's better than listing functions with the documentation from the
variable! (That happened because the call to yas--document-symbols in
snippet-reference.org was prefering function values to variables, while
the yas--document-symbol was prefering variable doc to function doc).

doc/yas-doc-helper.el

index f9e0f694ab606c69b8d088bc31239cc6f5d35f62..c940b2084c1bc7dae0899882cb821a79bcca3bf3 100755 (executable)
             (concat-lines ":PROPERTIES:"
                           (format ":CUSTOM_ID: %s" symbol)
                           ":END:"))
-           (body (or (cond ((boundp symbol)
-                            (documentation-property symbol 'variable-documentation t))
-                           ((fboundp symbol)
+           (body (or (cond ((fboundp symbol)
                             (let ((doc-synth (car-safe (get symbol 'function-documentation))))
                               (if (functionp doc-synth)
                                   (funcall doc-synth nil)
                                 (documentation symbol t))))
+                           ((boundp symbol)
+                            (documentation-property symbol 'variable-documentation t))
                            (t
                             (format "*WARNING*: no symbol named =%s=" symbol)))
                      (format "*WARNING*: no doc for symbol =%s=" symbol)))