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
Completion in the minibuffer #42
Comments
Part one: done. Second part: the approach is good, but do you actually like how the company tooltip looks is the minibuffer? I have a widescreen monitor, so I kind of dislike packages that make minibuffer taller (like So I think we should first learn to render the popup in the window above the minibuffer. But if you're using this configuration already, I'll gladly commit your modification of N.B.: |
Good.
Not quite.
Can't agree. I do use ido-vertical-mode and like it. Yes it makes minibuffer taller, but only for while you interact with it.
Maybe
Yes, I do. I made it mainly for eval-expression cause there is no completion in it and it similar to ielm(or just editing elisp file). While for execute-extended-command there is smex, ido, icomplete and many other completion engines.
I think it will be good. (Yes, I agree that using tooltips in minibuffer is quite controversial concept.)
ok. I'll look at that. |
Good, let's keep this issue open until then.
Actually, I'm just going to remove that |
Hello. And now again the problem is that the tooltip overlay appears at the cursor position, cursor jumps somewhere and everything becomes messy. What I want to suggest is to put more responsibility for such situations on users(or mainteiners of major/minor modes that breaks company) ;p, by something like: (defvar-local company-col-offset 0 "Horisontal tooltip offset.")
(defvar-local company-row-offset 0 "Vertical tooltip offset.")
(defun company--posn-col-row (posn)
(let ((col (car (posn-col-row posn)))
;; `posn-col-row' doesn't work well with lines of different height.
;; `posn-actual-col-row' doesn't handle multiple-width characters.
(row (cdr (posn-actual-col-row posn))))
(when (and header-line-format (version< emacs-version "24.3.93.3"))
;; http://debbugs.gnu.org/18384
(cl-decf row))
(cons (+ col (window-hscroll) company-col-offset) (+ row company-row-offset)))) It works for my case(I just set col-offset and row-offset to 1) and may be useful in solving other issues with wrongly placed tooltip, as it seems that general solution is not possible. |
Have you tried making an around-advice for this function? It should work just as well.
Does that only happen in minibuffer? I've seen this problem once, but it should've been fixed by a3cd0d6.
Sorry, but that isn't something I'm paying attention to, yet. If you'd like to help prototyping popup display using different approach, which should work in minibuffer, as well in other advanced situation, see http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00295.html. |
Some up-to-date recommendations for when someone wants to use Company in the minibuffer: (add-hook 'minibuffer-setup-hook 'my/company-mode-maybe)
(defun my/company-mode-maybe ()
(when (local-variable-p 'completion-at-point-functions)
(company-mode 1)))
;; And entirely optional:
(define-key company-mode-map (kbd "<tab>") 'company-complete-common-or-cycle) Plus it's preferable to install The pos-col-row advice above doesn't seem necessary, OTOH. Anyway, most commands (e.g. |
I think it will be helpful if company-elisp backend will be enabled also for
inferior-emacs-lisp-mode
.Also, here is a quick scratch of how company-mode could work for minibuffer completions(handy for eval-expression(M-:)): https://gist.github.com/Bad-ptr/7787596 .
Maybe it will give you some thoughts of how it could be done and maybe added to company-mode.
The text was updated successfully, but these errors were encountered: