check function doc before variable doc

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).
This commit is contained in:
Noam Postavsky 2013-11-27 21:44:18 -05:00
parent eaa3141402
commit 2c237cc311

View File

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