helpful

a fork of Wilfred's helpful
git clone https://git.trogloxene.org/helpful.git
Log | Files | Refs | README

commit a22ca6d4287dc9387bf7d95fa85b0ee6adde9376
parent daa4a64652a924f9c1dafa3b5301d0a595660a8b
Author: Wilfred Hughes <me@wilfred.me.uk>
Date:   Sun, 21 Oct 2018 15:14:56 +0100

Tweak wording to make source code more obvious

For aliases, we're trying to show the alias definition, not the
underlying function/variable definition.

Closes #168

Diffstat:
Mhelpful.el | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/helpful.el b/helpful.el @@ -1842,6 +1842,7 @@ state of the current symbol." (start-line (line-number-at-pos)) (start-column (current-column)) (primitive-p (helpful--primitive-p helpful--sym helpful--callable-p)) + (canonical-sym (helpful--canonical-symbol helpful--sym helpful--callable-p)) (look-for-src (or (not primitive-p) find-function-C-source-directory)) ((buf pos opened) @@ -2045,7 +2046,10 @@ state of the current symbol." (helpful--insert-section-break) (insert - (helpful--heading "Source Code") + (helpful--heading + (if (eq helpful--sym canonical-sym) + "Source Code" + "Alias Source Code")) (cond (source-path (concat @@ -2080,7 +2084,9 @@ state of the current symbol." (t (helpful--syntax-highlight (concat - ";; Source file is unknown, showing raw function object.\n" + (if (eq helpful--sym canonical-sym) + ";; Could not find source code, showing raw function object.\n" + ";; Could not find alias source code, showing raw function object.\n") (helpful--pretty-print source))))))) (helpful--insert-section-break)