branch: externals/embark
commit 28695fd17829b31320f9762c2ede603fa0c1901f
Merge: 8e7c53a8ec 7a44a20bd7
Author: Omar Antolín Camarena <[email protected]>
Commit: GitHub <[email protected]>

    Merge pull request #606 from minad/eldoc3
    
    Disable Embark Eldoc in minibuffer
---
 README.org  | 5 +++++
 embark.el   | 6 ++++--
 embark.texi | 5 +++++
 3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/README.org b/README.org
index 5866d3799c..cfc51ee2f4 100644
--- a/README.org
+++ b/README.org
@@ -306,6 +306,11 @@ starting configuration:
     ;; Optionally replace the key help with a completing-read interface
     (setq prefix-help-command #'embark-prefix-help-command)
 
+    ;; Show the Embark target at point via Eldoc.  You may adjust the Eldoc
+    ;; strategy, if you want to see the documentation from multiple providers.
+    (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
+    ;; (setq eldoc-documentation-strategy 
#'eldoc-documentation-compose-eagerly)
+
     :config
 
     ;; Hide the mode line of the Embark live/completions buffers
diff --git a/embark.el b/embark.el
index 0cd7db48b0..7544fa3e70 100644
--- a/embark.el
+++ b/embark.el
@@ -1000,7 +1000,8 @@ If CYCLE is non-nil bind `embark-cycle'."
   "Eldoc function reporting the first Embark target at point.
 This function uses the eldoc REPORT callback and is meant to be
 added to `eldoc-documentation-functions'."
-  (when-let ((target (car (embark--targets))))
+  (when-let (((not (minibufferp)))
+             (target (car (embark--targets))))
     (funcall report
              (format "Embark on %s ‘%s’"
                      (plist-get target :type)
@@ -1011,7 +1012,8 @@ added to `eldoc-documentation-functions'."
   "Eldoc function reporting the types of all Embark targets at point.
 This function uses the eldoc REPORT callback and is meant to be
 added to `eldoc-documentation-functions'."
-  (when-let ((targets (embark--targets)))
+  (when-let (((not (minibufferp)))
+             (targets (embark--targets)))
     (funcall report
              (format "Embark target types: %s"
                      (mapconcat
diff --git a/embark.texi b/embark.texi
index 7b90eda7b6..f8e50431ab 100644
--- a/embark.texi
+++ b/embark.texi
@@ -417,6 +417,11 @@ starting configuration:
   ;; Optionally replace the key help with a completing-read interface
   (setq prefix-help-command #'embark-prefix-help-command)
 
+  ;; Show the Embark target at point via Eldoc.  You may adjust the Eldoc
+  ;; strategy, if you want to see the documentation from multiple providers.
+  (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
+  ;; (setq eldoc-documentation-strategy #'eldoc-documentation-compose-eagerly)
+
   :config
 
   ;; Hide the mode line of the Embark live/completions buffers

Reply via email to