php-mode icon indicating copy to clipboard operation
php-mode copied to clipboard

Company mode with dabbrev not working

Open LukeMauldin opened this issue 11 years ago • 25 comments

I have my Emacs (24.3.1) setup with company mode and dabbrev (installed via package manager). If I am editing a normal text file company+dabbrev work together to provide buffer-based auto complete. However, when I open a PHP file (using php-mode), I don't get any auto completion

LukeMauldin avatar Jun 10 '14 16:06 LukeMauldin

Thanks for the bug report. I don't use Company Mode myself but sometime in the next week I will install it and try to replicate the bug on my end, and then fix it. Sorry about the issue and the delay in the mean time.

ejmr avatar Jun 13 '14 00:06 ejmr

BTW, company mode and dbabbrev work in other buffers in other modes (ie js-mode, lisp-mode, git commit messages, etc...) but still doesn't work in php-mode

LukeMauldin avatar Jun 16 '14 21:06 LukeMauldin

Any update on this? Company completion is still broken with PHP

LukeMauldin avatar Jun 23 '14 16:06 LukeMauldin

My apologies, but no, there are currently no updates for this.

ejmr avatar Jun 26 '14 12:06 ejmr

Thanks for the update. I have actually switched back to VIM for the moment until this bug can be resolved since I primarily do PHP development.

On Thu, Jun 26, 2014 at 7:54 AM, Eric James Michael Ritz < [email protected]> wrote:

My apologies, but no, there are currently no updates for this.

— Reply to this email directly or view it on GitHub https://github.com/ejmr/php-mode/issues/148#issuecomment-47221534.

LukeMauldin avatar Jun 26 '14 13:06 LukeMauldin

As an Emacs fan I'm sorry to hear that, heh. But using the best tool for the job is far more important than any brand loyalty. You deserve to know that PHP Mode is a very low priority for me (I know longer write PHP as part of my work). In fact, I have been searching for a new maintainer for the better part of a year now. This issue is still on my 'todo' list, but I simply cannot say when I will be able to make time for it. I'll try to contact you ASAP whenever it is fixed.

ejmr avatar Jun 26 '14 13:06 ejmr

Yes, I completely understand. Thank you for your help, and definitely let me know when it is fixed. I am very well give Emacs another try...I tend to switch between editors every few months...I am just always searching for the best tools to make me as productive as possible.

Luke

On Thu, Jun 26, 2014 at 8:25 AM, Eric James Michael Ritz < [email protected]> wrote:

As an Emacs fan I'm sorry to hear that, heh. But using the best tool for the job is far more important than any brand loyalty. You deserve to know that PHP Mode is a very low priority for me (I know longer write PHP as part of my work). In fact, I have been searching for a new maintainer for the better part of a year now. This issue is still on my 'todo' list, but I simply cannot say when I will be able to make time for it. I'll try to contact you ASAP whenever it is fixed.

— Reply to this email directly or view it on GitHub https://github.com/ejmr/php-mode/issues/148#issuecomment-47224705.

LukeMauldin avatar Jun 26 '14 14:06 LukeMauldin

So far I can't get Company Mode to work on the following system:

GNU Emacs 24.4.50.7 (i686-pc-linux-gnu, GTK+ Version 2.24.23)

ejmr avatar Jun 26 '14 16:06 ejmr

Company mode worked for me in other modes (JS, text, lisp). I am experiencing the same problem on my Mac too: GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.2.0, NS appkit-1265.20 Version 10.9.3 (Build 13D65))

On Thu, Jun 26, 2014 at 11:29 AM, Eric James Michael Ritz < [email protected]> wrote:

So far I can't get Company Mode to work on the following system:

GNU Emacs 24.4.50.7 (i686-pc-linux-gnu, GTK+ Version 2.24.23)

— Reply to this email directly or view it on GitHub https://github.com/ejmr/php-mode/issues/148#issuecomment-47247916.

LukeMauldin avatar Jun 26 '14 16:06 LukeMauldin

FYI, this is my Emacs config:

https://bitbucket.org/LukeMauldin/dotemacs/branches The 'lam' branch is the current one.

On Thu, Jun 26, 2014 at 11:33 AM, Luke Mauldin [email protected] wrote:

Company mode worked for me in other modes (JS, text, lisp). I am experiencing the same problem on my Mac too: GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.2.0, NS appkit-1265.20 Version 10.9.3 (Build 13D65))

On Thu, Jun 26, 2014 at 11:29 AM, Eric James Michael Ritz < [email protected]> wrote:

So far I can't get Company Mode to work on the following system:

GNU Emacs 24.4.50.7 (i686-pc-linux-gnu, GTK+ Version 2.24.23)

— Reply to this email directly or view it on GitHub https://github.com/ejmr/php-mode/issues/148#issuecomment-47247916.

LukeMauldin avatar Jun 26 '14 17:06 LukeMauldin

FYI, I changed my config to use autocomplete instead of company mode and completion in PHP-mode does work. I think I may try that for now because I am having to edit some large PHP files in Vim (2000+ lines) and Emacs is much faster than VIM for those files.

Luke

On Thu, Jun 26, 2014 at 12:16 PM, Luke Mauldin [email protected] wrote:

FYI, this is my Emacs config:

https://bitbucket.org/LukeMauldin/dotemacs/branches The 'lam' branch is the current one.

On Thu, Jun 26, 2014 at 11:33 AM, Luke Mauldin [email protected] wrote:

Company mode worked for me in other modes (JS, text, lisp). I am experiencing the same problem on my Mac too: GNU Emacs 24.4.50.1 (x86_64-apple-darwin13.2.0, NS appkit-1265.20 Version 10.9.3 (Build 13D65))

On Thu, Jun 26, 2014 at 11:29 AM, Eric James Michael Ritz < [email protected]> wrote:

So far I can't get Company Mode to work on the following system:

GNU Emacs 24.4.50.7 (i686-pc-linux-gnu, GTK+ Version 2.24.23)

— Reply to this email directly or view it on GitHub https://github.com/ejmr/php-mode/issues/148#issuecomment-47247916.

LukeMauldin avatar Jun 26 '14 20:06 LukeMauldin

Honestly auto-complete was my preference between the two (although I use dabbrev now). I am glad to hear it works faster for large PHP files. I am going to leave this bug open, however, since the Company Mode incompatibility still needs addressing.

ejmr avatar Jun 26 '14 21:06 ejmr

I installed Company Mode and it didn't work for me either. So I've downloaded some other Company packages to study them and see if I'm missing anything.

ejmr avatar Jun 27 '14 23:06 ejmr

FWIW, I'm not using dabbrev, and can't get Company mode working with PHP mode. @ejmr did you see this doc from Company Mode on what a major mode needs to provide for completion to work with Company? https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion-in-Buffers.html

kostajh avatar Jul 02 '14 13:07 kostajh

@kostajh Thank you for letting me know you're having a problem even though you're not using dabbrev, and thanks for the link, as I have not carefully read that part of the Elisp manual yet.

ejmr avatar Jul 04 '14 00:07 ejmr

The "Completion in Buffers" link above is irrelevant to the question of using company-dabbrev or company-dabbrev-code. Although, if a major mode provides a completion function, Company will use it.

As far as I can see, company-dabbrev-code works just fine in php-mode buffers, and company-dabbrev works in HTML-PHP mmm-mode-based ones. If someone were to describe exactly what they tried, and what didn't work, maybe I could help.

@ejmr

So I've downloaded some other Company packages to study them

Why? Are you writing a new Company backend?

dgutov avatar Aug 25 '14 02:08 dgutov

Why? Are you writing a new Company backend?

No, not anymore. Please see http://ericjmritz.name/2014/08/22/emacs-no-more-of-my-own-code-for-php-mode/

ejmr avatar Aug 25 '14 02:08 ejmr

I don't see why you were going to, in the first place.

dgutov avatar Aug 25 '14 02:08 dgutov

Sorry, you mean why was I originally going to support Company Mode + dabbrev?

ejmr avatar Aug 25 '14 02:08 ejmr

I mean why you thought you had to put in some extra effort for it to work.

dgutov avatar Aug 25 '14 02:08 dgutov

Oh. I guess it wasn't so much that, more of a dwindling of interest. I have not written professional PHP code for years, hence my lack of desire to personally implement things which may even require not tha much effort. As a game developer, that is kinda eating up all my time, heh.

ejmr avatar Aug 25 '14 02:08 ejmr

Ok, let me rephrase that: it should work already! :) If it doesn't, feel free to file an issue.

Happy for your game development career, by the way.

dgutov avatar Aug 25 '14 03:08 dgutov

Ah, any idea why doesn't work? I am still going to fix bugs in PHP Mode and accept contributions.

Happy for your game development career, by the way.

Thank you :)

ejmr avatar Aug 25 '14 03:08 ejmr

No idea. It works for me, AFAICS.

dgutov avatar Aug 25 '14 03:08 dgutov

Hmm. I will poke some other PHP Mode users then and see if they have problems.

ejmr avatar Aug 25 '14 03:08 ejmr