mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-17 13:33:36 -05:00
feat(eshell): add help command & lookup handler
Fix: #6867 Co-authored-by: aikrahguzar <aikrahguzar@users.noreply.github.com>
This commit is contained in:
@@ -75,6 +75,21 @@
|
||||
(insert command)
|
||||
(eshell-send-input nil t))))
|
||||
|
||||
;; Adapted from `esh-help-run-help'
|
||||
;;;###autoload
|
||||
(defun +eshell-lookup-documentation (cmd)
|
||||
"Show help for CMD (a shell command or elisp function)."
|
||||
(cond ((eshell-find-alias-function cmd)
|
||||
(always (helpful-callable (eshell-find-alias-function cmd))))
|
||||
((and (or (and (string-match-p "^\\*." cmd)
|
||||
(cl-callf substring cmd 1))
|
||||
(eshell-search-path cmd))
|
||||
(zerop (car (doom-call-process manual-program cmd))))
|
||||
(always (display-buffer (man cmd))))
|
||||
((functionp (intern cmd))
|
||||
(helpful-callable (intern cmd)) t)
|
||||
((user-error "Couldn't find man pages or elisp documentation for %S" cmd))))
|
||||
|
||||
|
||||
;;
|
||||
;;; Commands
|
||||
|
Reference in New Issue
Block a user