diff options
| author | Wilfred Hughes <me@wilfred.me.uk> | 2019-04-07 21:54:23 +0100 |
|---|---|---|
| committer | Wilfred Hughes <me@wilfred.me.uk> | 2019-04-07 21:54:23 +0100 |
| commit | 9d8e7f3c3a44ac0f2bc7b0438c31226481476aff (patch) | |
| tree | da990bf403ca5e2e68918aa5194a36393fb26685 | |
| parent | 67b7592f970776776d243cacf7363eb93bc28ebc (diff) | |
Don't show the Source Code heading if we don't have any source
| -rw-r--r-- | helpful.el | 51 |
1 files changed, 25 insertions, 26 deletions
@@ -2200,32 +2200,31 @@ state of the current symbol." (helpful--insert-section-break) - (insert - (helpful--heading - (if (eq helpful--sym canonical-sym) - "Source Code" - "Alias Source Code")) - (cond - (source-path - (concat - (propertize (format "%s Defined in " (if primitive-p "//" ";;")) - 'face 'font-lock-comment-face) - (helpful--navigate-button - (f-abbrev source-path) - source-path - pos) - "\n")) - (primitive-p - (concat - (propertize - "C code is not yet loaded." - 'face 'font-lock-comment-face) - "\n\n" - (helpful--button - "Set C source directory" - 'helpful-c-source-directory))) - (t - ""))) + (when (or source-path primitive-p) + (insert + (helpful--heading + (if (eq helpful--sym canonical-sym) + "Source Code" + "Alias Source Code")) + (cond + (source-path + (concat + (propertize (format "%s Defined in " (if primitive-p "//" ";;")) + 'face 'font-lock-comment-face) + (helpful--navigate-button + (f-abbrev source-path) + source-path + pos) + "\n")) + (primitive-p + (concat + (propertize + "C code is not yet loaded." + 'face 'font-lock-comment-face) + "\n\n" + (helpful--button + "Set C source directory" + 'helpful-c-source-directory)))))) (when source (insert (cond |
