Emacs and PHP: There’s more than one way to do it, of course
| emacsThe PhpMode page on EmacsWiki lists five options for developing PHP in Emacs. I’m currently using the php-mode maintained by Aaron Hawley, and I’m quite happy with it. I’m curious about the php-mode maintained by Ahmet Usal, though, as it has extensive templating support and electric behavior. It seems to have abbreviations and argument lists for every PHP function, and I might borrow the code and convert it to a yasnippet file if I don’t end up using this. I’ll switch to Ahmet Usal’s php-mode today, see what it feels like, and post my notes. Has anyone else tried both?
6 comments
Paul Gaskin
2008-08-04T13:23:52ZI just upgraded to nXhtml v1.35 and it is rid of the one bug I found most troublesome. I developed a habit long ago of doing something manually which Textmate (prorietary Apple code editor) and Yasnippet seem to enable automatically. I always write the closing syntax at the same time I write the opening syntax of whatever I'm doing from parenthesis, curly braces, angle brackets, quote marks, etc.
There was this bug which would hang emacs when I'd type "" and then in between the angle brackets I'd add "??" with the intention of putting php inside of those question marks and then filling out my php chunk. It would hang with the first question mark I added, but now that's fixed.
The way I was going about it probably wasn't the optimal way, but I'm not a very experienced programmer or Emacs user, so I'm just trying to figure out how to use Emacs to become a more versatile and productive programmer.
The nXhtml package is much appreciated since I really like syntax highlighting and the automatic switching of modes as the mark moves through chunks of code of various languages.
I'm excited about yasnippet and I like the idea of nXhtml and yasnippet functionality merged into one mode. I'm not sure if they're already inherently compatible because I'm an Emacs newb, but I like the idea of automatic closure of opened syntax and automatic population of functions with appropriate argument place-holders.
I develop PHP in Drupal, so making bits of Drupal code easily accessible would be nice as well. My friend who uses Textmate is pretty happy with the way he's added snippets of Drupal-specific PHP code he often uses, and I'd like that kind of simple code snippet utility.
I bet that's very easy to do for those who know how, but I'm not much of an Emacs hacker and more of a user, so all I can do for now is to appreciate that which more capable programmers make available for everyone else. Thanks!
Ahmet Usal
2008-10-08T01:26:30ZI have big update for mewde php-mode; check this here : http://mewde.blogspot.com/2...
and some big updates for mewde; I'm working on it.
I noticed lately this post; last two months I used my updating php-mode.
I'm using mostly with drupal too...:) I loved your module update functions; and I'm big fan this blog and your Emacs tips&tricks nice thing to writing here.
This mode needs to handling elisp hackers; I'm not that one; I hope you can take a look and doing some good things for that matter.
haheng?
2009-12-26T07:37:10ZDon't like Emacs32 don't like nXhtml it's not the Emacs way!
LeoB
2009-12-26T07:42:17Z@haheng:
Hm, interesting. So what is it that u don't like?
Na Sadia
2009-12-26T11:28:24Z@haheng:
If you do not like Emacs, why do not give a try on Xemacs?
http://www.xemacs.org/