aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilfred Hughes <me@wilfred.me.uk>2018-10-21 15:14:56 +0100
committerWilfred Hughes <me@wilfred.me.uk>2018-10-21 15:14:56 +0100
commita22ca6d4287dc9387bf7d95fa85b0ee6adde9376 (patch)
tree5776f2711604394cfaed109e0c126b562ea2d6e2
parentdaa4a64652a924f9c1dafa3b5301d0a595660a8b (diff)
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
-rw-r--r--helpful.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/helpful.el b/helpful.el
index 4ac6236..e7a5c14 100644
--- 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)