commit e8db0f37db655565e4325d8fbb5b4524413f3877
parent 1b4497ffe1e0f3d17b6370c6b1f29a77746e8497
Author: Wilfred Hughes <me@wilfred.me.uk>
Date: Wed, 25 Jul 2018 23:23:40 +0100
Simplify headings
Just say 'Documentation' rather than 'Function Documentation' and so
on. Now that we have a summary sentence that says 'foo is a function'
we don't need the verbose headings.
Fixes #142
Diffstat:
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/helpful.el b/helpful.el
@@ -1746,10 +1746,6 @@ 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))
- (sym-type (cond
- ((not helpful--callable-p) "Variable")
- ((macrop helpful--sym) "Macro")
- (t "Function")))
(look-for-src (or (not primitive-p)
find-function-C-source-directory))
((buf pos opened)
@@ -1771,7 +1767,7 @@ state of the current symbol."
(when helpful--callable-p
(helpful--insert-section-break)
(insert
- (helpful--heading (format "%s Signature" sym-type))
+ (helpful--heading "Signature")
(helpful--syntax-highlight (helpful--signature helpful--sym))))
(when (not helpful--callable-p)
@@ -1846,7 +1842,7 @@ state of the current symbol."
(-when-let (docstring (helpful--docstring helpful--sym helpful--callable-p))
(helpful--insert-section-break)
(insert
- (helpful--heading (format "%s Documentation" sym-type))
+ (helpful--heading "Documentation")
(helpful--format-docstring docstring))
(when (helpful--in-manual-p helpful--sym)
(insert "\n\n")
@@ -1900,7 +1896,8 @@ state of the current symbol."
(helpful--insert-section-break)
(insert
(helpful--heading "Advice")
- (format "This %s is advised." (downcase sym-type))))
+ (format "This %s is advised."
+ (if (macrop helpful--sym) "macro" "function"))))
(let ((can-edebug
(helpful--can-edebug-p helpful--sym helpful--callable-p buf pos))