diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2017-07-22 13:22:02 +0100 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2017-07-22 13:22:02 +0100 |
| commit | d167ee6fd4fbaadc46aa50a96529dc234a4c37c2 (patch) | |
| tree | d8f96f886e8fb63ec5b57dccc11dc3f40a8cf57b | |
| parent | 6ecf75d67e6099b6128b00cae7ff06b5190a82a5 (diff) | |
Only show docs or props if we have something to show
| -rw-r--r-- | helpful.el | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -452,18 +452,18 @@ state of the current symbol." (kill-buffer buf))) (erase-buffer) (insert - (helpful--heading (if (macrop helpful--sym) "Macro Signature\n" "Function Signature\n")) - (helpful--signature helpful--sym) - (helpful--heading "\n\nDocumentation\n") - ;; TODO: a link to find this symbol in the manual, much like - ;; helpfns+ or counsel-info-lookup-symbol. - (-if-let (docstring (helpful--docstring helpful--sym)) - (helpful--format-docstring docstring) - "No docstring.")) + (helpful--signature helpful--sym)) + + (-when-let (docstring (helpful--docstring helpful--sym)) + (insert + (helpful--heading "\n\nDocumentation\n") + ;; TODO: a link to find this symbol in the manual, much like + ;; helpfns+ or counsel-info-lookup-symbol. + (helpful--format-docstring docstring))) ;; Show keybindings. ;; TODO: allow users to conveniently add and remove keybindings. @@ -487,11 +487,12 @@ state of the current symbol." (t "Could not find source file.")) "\n\n" - (helpful--all-references-button helpful--sym) + (helpful--all-references-button helpful--sym)) - (helpful--heading "\n\nSymbol Properties\n") - (or (helpful--format-properties helpful--sym) - "No properties.")) + (-when-let (formatted-props (helpful--format-properties helpful--sym)) + (insert + (helpful--heading "\n\nSymbol Properties\n") + formatted-props)) (when (helpful--advised-p helpful--sym) (insert |
