New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

counsel-set-variable: There is no ElDoc support in this buffer #549

Closed
kaushalmodi opened this Issue Jun 10, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@kaushalmodi
Contributor

kaushalmodi commented Jun 10, 2016

For the variables that have a list of available options (defcustoms), counsel-set-variable works fine. But for other variables, while it still works, I always get a nag: "There is no ElDoc support in this buffer".

Actually I got this nag even for a defcustom variable ivy-extra-directories.

I have set it to nil in my config as below:

(setq ivy-extra-directories nil) ; default value: ("../" "./")

With point on ivy-extra-directories and after evaluating (setq debug-on-message "ElDoc support"), when I call counsel-set-variable, I get the below backtrace.

I have added eldoc-mode to the eval-expression-minibuffer-setup-hook.

That "no ElDoc support" message is always displayed when (run-hooks 'eval-expression-minibuffer-setup-hook) is evaluated in counsel-read-setq-expression.

That works fine when I do M-:. But not sure why it complains of no ElDoc support when run through counsel-read-setq-expression. Apparently somehow eldoc-documentation-function gets set to nil or 'ignore when called via counsel-read-setq-expression vs when called directly from eval-expression.

Backtrace

Debugger entered--Lisp error: "There is no ElDoc support in this buffer"
#("There is no ElDoc support in this buffer")
apply(# "There is no ElDoc support in this buffer")
message("There is no ElDoc support in this buffer")
eldoc-mode()
run-hooks(eval-expression-minibuffer-setup-hook)
#0 "\301\302\303\304\305$\210\306\307!\210\310 b\210\311u\210\312\313\300"c\207" [ivy-extra-directories add-hook completion-at-point-functions elisp-completion-at-point nil t run-hooks eval-expression-minibuffer-setup-hook minibuffer-prompt-end 6 format "%S "] 5
#[0 "\302\303\301\242"\210\300 \207" [#0 "\301\302\303\304\305$\210\306\307!\210\310 b\210\311u\210\312\313\300"c\207" [ivy-extra-directories add-hook completion-at-point-functions elisp-completion-at-point nil t run-hooks eval-expression-minibuffer-setup-hook minibuffer-prompt-end 6 format "%S "] 5 remove-hook minibuffer-setup-hook] 3]()
read-from-minibuffer("Eval: " "(setq nil)" (keymap (18 . counsel-expression-history) (9 . completion-at-point) (27 keymap (9 . completion-at-point)) keymap (menu-bar keymap (minibuf "Minibuf" keymap (previous menu-item "Previous History Item" previous-history-element :help "Put previous minibuffer history element in the minibuffer") (next menu-item "Next History Item" next-history-element :help "Put next minibuffer history element in the minibuffer") (isearch-backward menu-item "Isearch History Backward" isearch-backward :help "Incrementally search minibuffer history backward") (isearch-forward menu-item "Isearch History Forward" isearch-forward :help "Incrementally search minibuffer history forward") (return menu-item "Enter" exit-minibuffer :key-sequence "
" :help "Terminate input and exit minibuffer") (quit menu-item "Quit" abort-recursive-edit :help "Abort input and exit minibuffer") "Minibuf")) (10 . exit-minibuffer) (13 . exit-minibuffer) (7 . minibuffer-keyboard-quit) (C-tab . file-cache-minibuffer-complete) (9 . self-insert-command) (XF86Back . previous-history-element) (up . previous-line-or-history-element) (prior . previous-history-element) (XF86Forward . next-history-element) (down . next-line-or-history-element) (next . next-history-element) (27 keymap (114 . previous-matching-history-element) (115 . next-matching-history-element) (112 . previous-history-element) (110 . next-history-element))) t read-expression-history)
counsel-read-setq-expression(ivy-extra-directories)
counsel-set-variable()
funcall-interactively(counsel-set-variable)
call-interactively(counsel-set-variable nil nil)
command-execute(counsel-set-variable)

@kaushalmodi

This comment has been minimized.

Contributor

kaushalmodi commented Jun 10, 2016

Below seems to fix this

diff --git a/counsel.el b/counsel.el
index 171cd54..053850b 100644
--- a/counsel.el
+++ b/counsel.el
@@ -485,6 +485,7 @@ Update the minibuffer with the amount of lines collected every
          (sym-value (symbol-value sym))
          (expr (minibuffer-with-setup-hook
                    (lambda ()
+                     (setq-local eldoc-documentation-function #'elisp-eldoc-documentation-function)
                      (add-hook 'completion-at-point-functions #'elisp-completion-at-point nil t)
                      (run-hooks 'eval-expression-minibuffer-setup-hook)
                      (goto-char (minibuffer-prompt-end))

But I do not understand why I need this hack.

@abo-abo abo-abo closed this in e987cef Jun 10, 2016

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Jun 10, 2016

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment