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
Company deletes asterisks in Eshell Mode #218
Comments
Do you see the same behavior if you type I see a different thing happen: no asterisks disappear, but both company-mode and completion-at-point raise an error after asterisks. Like this:
I guess it gets interpreted as file path, and file paths disallow unescaped asterisks (..?). |
Thanks for your quick reply. No errors here. Yes, |
But -- also -- |
Okay, I can reproduce that now, in a bare Emacs session. Will have to see what customization of mine makes that behavior different.
Still, I see no possible benefit in replacing
Can you describe the exact sequence of commands (and the context) that makes it do that (in a comment, in the other issue)? That's the one thing I haven't been able to reproduce (specifically, with |
It means that the entire pattern with wildcards will eventually be replaced with the full completion. Without Company,
I have noticed that Eshell Mode binds
Thanks for your assistance. |
Anyway, both Maybe Company could provide an option to exclude some major modes when calling |
But that doesn't happen with any other prefix, even though they would also be "eventually replaced". So, http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18951. Let's wait for the response. And BTW, my original problem was http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18950. |
I experience the same thing, asterisks gets deleted in eshell when company-mode is enabled. It has been some time since anything happened in this issue, any fixes or workarounds? |
I'm using spacemacs, and I have the same problem. Any solution or workaround? |
@quigonjeff None that I'm aware of. You might be better off commenting on the Emacs bug report directly. |
I commented on the Emacs bug report and got a potential fix. If someone wants to test it, just eval: (defun pcomplete-parse-arguments (&optional expand-p)
"Parse the command line arguments. Most completions need this info."
(let ((results (funcall pcomplete-parse-arguments-function)))
(when results
(setq pcomplete-args (or (car results) (list ""))
pcomplete-begins (or (cdr results) (list (point)))
pcomplete-last (1- (length pcomplete-args))
pcomplete-index 0
pcomplete-stub (pcomplete-arg 'last))
(let ((begin (pcomplete-begin 'last)))
(if (and (listp pcomplete-stub) ;??
(not pcomplete-expand-only-p))
(let* ((completions pcomplete-stub) ;??
(common-stub (car completions))
(c completions)
(len (length common-stub)))
(while (and c (> len 0))
(while (and (> len 0)
(not (string=
(substring common-stub 0 len)
(substring (car c) 0
(min (length (car c))
len)))))
(setq len (1- len)))
(setq c (cdr c)))
(setq pcomplete-stub (substring common-stub 0 len)
pcomplete-autolist t)
(when (and begin (> len 0) (not pcomplete-show-list))
(delete-region begin (point))
(pcomplete-insert-entry "" pcomplete-stub))
(throw 'pcomplete-completions completions))
(when expand-p
(if (stringp pcomplete-stub)
(when begin
(delete-region begin (point))
(insert-and-inherit pcomplete-stub))
(if (and (listp pcomplete-stub)
pcomplete-expand-only-p)
;; this is for the benefit of `pcomplete-expand'
(setq pcomplete-last-completion-length (- (point) begin)
pcomplete-current-completions pcomplete-stub)
(error "Cannot expand argument"))))
(if pcomplete-expand-only-p
(throw 'pcompleted t)
pcomplete-args)))))) and see if it fixes the problem and/or breaks something else. |
@dakra tested snippet out. Can confirm it works \o/ |
@gopar nice. |
Hello,
Company deletes asterisks entered in Eshell Mode. This problem does not happen with Shell Mode.
To reproduce:
Software:
Thanks for your assistance.
The text was updated successfully, but these errors were encountered: