arnested / drupal-mode

Advanced Emacs minor mode for Drupal development
https://melpa.org/#/drupal-mode
GNU General Public License v3.0
32 stars 14 forks source link

Eshell pccomplete support for drush #32

Closed dhaley closed 11 years ago

dhaley commented 11 years ago

Hi, I just read this great post on getting Eshell's pccomplete working with git:

http://tsdh.wordpress.com/2013/05/31/eshell-completion-for-git-bzr-and-hg/

It seem like it would be great to add this same support for drush in Eshell. Drush already works great for me in Eshell with the exception that I haven't been able to display ansi colors.

It seems that it would be easy at drupal-mode init to run 'drush help' and then store the various options in pcmpl-git-commands.

I might try to take a stab at this with my rudimentary elisp, but it seems like this autocompletion of drush should be available to all emacs Drupal folks.

dhaley commented 11 years ago

I got this working. Here is the code:

https://gist.github.com/dhaley/5687871

It would be cool to see this somehow put in drupal-mode.

dhaley commented 11 years ago

Got it working much better here:

https://gist.github.com/dhaley/5688333

I'm using drush 5.9.

It even pulls in site aliases. But for some reason I can't get the site aliases that begin with @ to expand like the commands do. It's using running the same drush command that drush bash completion script uses:

https://gist.github.com/dhaley/5688448

arnested commented 11 years ago

Good idea!

I changed it slightly to better fit in with the general naming of functions and variables in drupal-mode.

Committed in ae4dd40f05514b1a8a4206339704db69fd6097f2.

I can't get it to complete on site aliases either. I guess some other pcomplete stuff is messing around. But this is still way better than without it.

dhaley commented 11 years ago

The site alias completion does work in shell (shell-mode).

@arnested, When do you anticipate a new release of drupal-mode that will have the new stuff in the 'develop' branch?

arnested commented 11 years ago

Oh, it does work in shell but not in eshell. Weird. But better :-)

I have been wanting to do a new release for quite some time. But I really would like to fix #12 first. It annoys me a lot but requires quite some rewriting of the detect version/rootdir functionality. I'll better try to prioritize it then...

arnested commented 11 years ago

The version in MELPA is fresh from the develop branch and includes the pcomplete support.