helpful

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

commit 408acb9872b80bc6f16dcca031f4ceb74a9acb5e
parent 2af13bea9e20df50b583684ac22f056e947e4829
Author: Nick Drozd <nicholasdrozd@gmail.com>
Date:   Thu, 16 Aug 2018 11:45:17 -0500

Add helpful--sort-symbols

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

diff --git a/helpful.el b/helpful.el @@ -179,6 +179,12 @@ press \\[keyboard-quit] to gracefully stop the printing." (propertize "(User quit during pretty-printing.)" 'face 'font-lock-comment-face)))) +(defun helpful--sort-symbols (sym-list) + "Sort symbols in SYM-LIST alphabetically." + (--sort + (string< (symbol-name it) (symbol-name other)) + sym-list)) + (defun helpful--button (text type &rest properties) ;; `make-text-button' mutates our string to add properties. Copy ;; TEXT to prevent mutating our arguments, and to support 'pure' @@ -218,9 +224,7 @@ Return SYM otherwise." ;; Don't include SYM. (not (eq sym s))) (push s aliases)))) - (--sort - (string< (symbol-name it) (symbol-name other)) - aliases))) + (helpful--sort-symbols aliases))) (defun helpful--format-alias (sym callable-p) (let ((obsolete-info (if callable-p @@ -599,11 +603,7 @@ overrides that to include previously opened buffers." (if (stringp raw-source) (read raw-source) raw-source)) - (syms (helpful--callees source))) - (setq syms - (--sort - (string< (symbol-name it) (symbol-name other)) - syms)) + (syms (helpful--sort-symbols (helpful--callees source)))) (pop-to-buffer buf) (let ((inhibit-read-only t))