branch: master commit 9b3c00a7d2b8028a7e396b5367a7e25aa41afd2f Author: Michael Heerdegen <michael_heerde...@web.de> Commit: Michael Heerdegen <michael_heerde...@web.de>
[el-search] Fix eldoc support for uncompiled patterns * packages/el-search/el-search.el (el-search-eldoc-documentation-function): Make it work for uncompiled pattern definitions. --- packages/el-search/el-search.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el index 46c3260..4e9cd98 100644 --- a/packages/el-search/el-search.el +++ b/packages/el-search/el-search.el @@ -987,15 +987,16 @@ nil." (pcase-let (((and current-fsym `(,fnsym ,index)) (elisp--fnsym-in-current-sexp))) (defvar el-search--pcase-macros) ;defined later - (let (pattern-def docstring help) + (let (pattern-def help) (and fnsym (setq pattern-def (cdr (assoc fnsym el-search--pcase-macros))) ;; This is what `elisp-get-fnsym-args-string' (which we can't use) does - (setq docstring (documentation pattern-def)) - (setq help (help-split-fundoc docstring fnsym)) + (setq help (if-let* ((docstring (documentation pattern-def)) + (from-docstring (help-split-fundoc docstring fnsym))) + (elisp-function-argstring (car from-docstring)) + (prin1-to-string (help-function-arglist pattern-def)))) (elisp--highlight-function-argument - current-fsym (elisp-function-argstring (car help)) - index (concat (symbol-name fnsym) ": "))))))) + current-fsym help index (concat (symbol-name fnsym) ": "))))))) (defvar el-search--this-session-match-count-data nil)