[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/mheerdegen-preview 35edf10 23/33: WIP: Improvise eldoc su
From: |
Michael Heerdegen |
Subject: |
[elpa] scratch/mheerdegen-preview 35edf10 23/33: WIP: Improvise eldoc support for search pattern prompt |
Date: |
Wed, 24 Oct 2018 18:30:52 -0400 (EDT) |
branch: scratch/mheerdegen-preview
commit 35edf10dbbf5c8634d3dd7dc41cf2db50bb7e147
Author: Michael Heerdegen <address@hidden>
Commit: Michael Heerdegen <address@hidden>
WIP: Improvise eldoc support for search pattern prompt
---
packages/el-search/el-search.el | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/packages/el-search/el-search.el b/packages/el-search/el-search.el
index cb9bcd4..db62e84 100644
--- a/packages/el-search/el-search.el
+++ b/packages/el-search/el-search.el
@@ -916,6 +916,28 @@ nil."
(timer-set-time el-search--mb-hints-timer (time-add (current-time)
el-search-mb-hints-delay))
(timer-activate el-search--mb-hints-timer)))
+(defun el-search-eldoc-documentation-function ()
+ (when (catch 'result
+ (save-excursion
+ (while (condition-case nil
+ (progn (backward-up-list)
+ (if (el-search-looking-at '`(,(or 'pred 'guard)
. ,_))
+ (throw 'result nil)
+ t))
+ (scan-error nil)))
+ t))
+ (pcase-let (((and current-fsym `(,fnsym ,index))
+ (elisp--fnsym-in-current-sexp)))
+ (defvar el-search--pcase-macros) ;defined later
+ (let (pattern-def help)
+ (and fnsym
+ (setq pattern-def (cdr (assoc fnsym el-search--pcase-macros)))
+ (setq help (help-split-fundoc (documentation pattern-def) fnsym))
+ (elisp--highlight-function-argument
+ current-fsym
+ (format "%s" (cdar (read-from-string (car help))))
+ index (concat (symbol-name fnsym) ": ")))))))
+
(defvar el-search--this-session-match-count-data nil)
(defun el-search-read-pattern-setup-mb-hints ()
@@ -923,7 +945,9 @@ nil."
(setq el-search--this-session-match-count-data nil)
(when (timerp el-search--mb-hints-timer) (cancel-timer
el-search--mb-hints-timer))
(setq el-search--mb-hints-timer nil)
- (add-hook 'post-command-hook #'el-search-read-pattern-trigger-mb-hints t
t)))
+ (add-hook 'post-command-hook #'el-search-read-pattern-trigger-mb-hints t
t))
+ (add-function :before-until (local 'eldoc-documentation-function)
+ #'el-search-eldoc-documentation-function))
(defvar el-search--search-pattern-1-do-fun nil)
(defvar el-search--busy-animation
- [elpa] scratch/mheerdegen-preview 9cfe823 32/33: WIP: [el-search] Enhance doc of el-search-occur-mode, (continued)
- [elpa] scratch/mheerdegen-preview 9cfe823 32/33: WIP: [el-search] Enhance doc of el-search-occur-mode, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview d774bfe 24/33: WIP: Test: Make mouse clicks not abort the search, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 1020ca9 16/33: WIP: Optimize caching, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview fadf6f9 05/33: WIP: New :key arg for "filename" and new pattern types "file" and "dir", Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 1fcb333 03/33: WIP: Add package "sscell", Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 35be4f8 12/33: WIP [el-search] Fix more "redundant _ pattern" cases, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview fa8dbb8 07/33: WIP: New file el-search/el-search-pp.el, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview ffd1bb1 13/33: WIP [el-search] Discourage using symbols as LPATS in `append' and `l', Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview aca1cea 10/33: WIP [el-search] Implement 'el-search-keyboard-quit', Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 9773b43 18/33: WIP [el-search] Fix search setup when occur flag bound, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 35edf10 23/33: WIP: Improvise eldoc support for search pattern prompt,
Michael Heerdegen <=
- [elpa] scratch/mheerdegen-preview 08e0d20 15/33: WIP: Additions to "Mb hints", Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 60fd31c 19/33: WIP [el-search] Adjust prev/next match commands for search and occur, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview fb5a73b 30/33: WIP: Small fix in 'el-search--reset-wrap-flag', Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 86f4f18 17/33: WIP [el-search] Fix C-j with numeric arg in error case, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 1d22a6c 14/33: WIP [el-search] Minibuffer hints when entering pattern, Fix case when search pattern fails for some sexps, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 0e37f94 28/33: WIP: Add alarm-clock.el, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 6a048a7 26/33: WIP: Don't initially fold occur buffer, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 6de70fb 20/33: WIP: Improvements for change and changed, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 0d07bb8 33/33: WIP: [el-search] Don't kill modified buffers, Michael Heerdegen, 2018/10/24
- [elpa] scratch/mheerdegen-preview 8391d56 31/33: WIP: Small fix in el-search--changed-files-in-repo, Michael Heerdegen, 2018/10/24