helpful

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

commit f3c20d831a80ac00b411358fffab4789ba9f67f6
parent 3068b0229383bf18a88cd0b59694d611077cd58d
Author: Wilfred Hughes <me@wilfred.me.uk>
Date:   Mon, 16 Oct 2017 22:37:18 +0100

Strip extra newline when we can't load a docstring

Diffstat:
Mhelpful.el | 25+++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/helpful.el b/helpful.el @@ -271,18 +271,19 @@ blank line afterwards." ;; in the docstring for `--map'. (defun helpful--format-docstring (docstring) "Replace cross-references with links in DOCSTRING." - (replace-regexp-in-string - (rx "`" symbol-start (+? anything) symbol-end "'") - (lambda (it) - (let* ((sym-name - (s-chop-prefix "`" (s-chop-suffix "'" it))) - (sym (intern sym-name))) - (if (or (boundp sym) (fboundp sym)) - (helpful--describe-button (read sym-name)) - (propertize sym-name - 'face 'font-lock-constant-face)))) - (helpful--split-first-line docstring) - t t)) + (s-trim + (replace-regexp-in-string + (rx "`" symbol-start (+? anything) symbol-end "'") + (lambda (it) + (let* ((sym-name + (s-chop-prefix "`" (s-chop-suffix "'" it))) + (sym (intern sym-name))) + (if (or (boundp sym) (fboundp sym)) + (helpful--describe-button (read sym-name)) + (propertize sym-name + 'face 'font-lock-constant-face)))) + (helpful--split-first-line docstring) + t t))) (defconst helpful--highlighting-funcs '(ert--activate-font-lock-keywords