Last active
March 4, 2020 12:42
-
-
Save Rovanion/a97fe3bbaf07f0fa2a5a1661e421c29d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun elisp-showdoc (f) | |
(interactive (list (thing-at-point 'symbol t))) | |
(message | |
"%s" | |
(let* ((doc-list (split-string (documentation (intern f)) "\n")) | |
(number-lines (min (- (floor (* max-mini-window-height (frame-height))) 2) | |
(- (length doc-list) 2))) | |
(subset (concatenate 'list | |
(last doc-list) | |
'("") | |
(subseq doc-list 0 number-lines))) | |
(pruned-subset (if (string-equal (car (last subset)) "") | |
(butlast subset) | |
subset))) | |
(mapconcat #'identity pruned-subset "\n")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment