helpful

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

commit 9a245465ceeaa3006cf1b9e8688e2148b80fb016
parent 07fd87cffbcc243b77c1598477167ce702250c48
Author: Wilfred Hughes <me@wilfred.me.uk>
Date:   Sun, 22 Jul 2018 22:03:13 +0100

Show the variable value before the docstring

For variables with long docstrings (e.g. company-backends) it's a pain
to scroll down to see the current value. Whilst I think this makes the
buffer ordering seem less logical, it feels more useful. We might want
to consider tweaking heading text in future.

Fixes #138

Diffstat:
MCHANGELOG.md | 2+-
Mhelpful.el | 18+++++++++---------
2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -1,6 +1,6 @@ # v0.13 -No changes yet. +Variable values are now shown before docstrings. # v0.12 diff --git a/helpful.el b/helpful.el @@ -1707,15 +1707,6 @@ state of the current symbol." (helpful--heading (format "%s Signature" sym-type)) (helpful--syntax-highlight (helpful--signature helpful--sym)))) - (-when-let (docstring (helpful--docstring helpful--sym helpful--callable-p)) - (helpful--insert-section-break) - (insert - (helpful--heading (format "%s Documentation" sym-type)) - (helpful--format-docstring docstring)) - (when (helpful--in-manual-p helpful--sym) - (insert "\n\n") - (insert (helpful--make-manual-button helpful--sym)))) - (when (not helpful--callable-p) (helpful--insert-section-break) (let* ((sym helpful--sym) @@ -1754,6 +1745,15 @@ state of the current symbol." (when (custom-variable-p helpful--sym) (insert " " (helpful--make-customize-button helpful--sym))))) + (-when-let (docstring (helpful--docstring helpful--sym helpful--callable-p)) + (helpful--insert-section-break) + (insert + (helpful--heading (format "%s Documentation" sym-type)) + (helpful--format-docstring docstring)) + (when (helpful--in-manual-p helpful--sym) + (insert "\n\n") + (insert (helpful--make-manual-button helpful--sym)))) + ;; Show keybindings. ;; TODO: allow users to conveniently add and remove keybindings. (when (commandp helpful--sym)