Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions esh-help.el
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ It comes from Zsh."
str)))

(defun esh-help-eldoc-man-minibuffer-string (cmd)
"Return minibuffer help string for the shell command CMD."
"Return minibuffer help string for the shell command CMD.
Return nil if there is none."
(let ((cache-result (gethash cmd esh-help-man-cache)))
(if cache-result
(unless (eql 'none cache-result)
Expand All @@ -133,12 +134,12 @@ It comes from Zsh."
(puthash cmd 'none esh-help-man-cache)
nil)
(puthash cmd
(->> str
(--drop-while (not (string-match-p "^SYNOPSIS$" it)))
(nth 1)
(funcall (lambda (s)
(let ((idx (string-match "[^\s\t]" s)))
(substring s idx)))))
(-some->> str
(--drop-while (not (string-match-p "^SYNOPSIS$" it)))
(nth 1)
(funcall (lambda (s)
(let ((idx (string-match "[^\s\t]" s)))
(substring s idx)))))
esh-help-man-cache))))))

(defun esh-help-eldoc-command ()
Expand Down