Re: Getting into Emacs?
by Joost (Canon) on Apr 11, 2008 at 15:27 UTC
|
Just dumping a few links:
http://www.emacswiki.org/cgi-bin/wiki/ contains great pointers to all kinds of docs, extensions, customizations and other stuff that emacs users found useful. Really the first place to look. For a start, take a look at the emacsnewbie and programming categories.
Lispcast recently did a nice article on improving your emacs skills
the reference card is helpful too (links to a generated pdf. your emacs bundle should contain the at least the tex source if you want to generate one yourself).
Also, comp.emacs is a useful usenet group.
Also, will Emacs answer my needs for HTML, CSS, JavaScript, PHP, MySQL, Perl, and Python coding? Especially when, for example, HTML and CSS, or PHP and HTML are mixed in a file?
Yes it will, but you will need to install at least a few of those language modes yourself, since current emacs doesn't come with, for example, a javascript mode (I've been informed that this is probably going to change). Again, see the emacswiki. As for combining them, mmm-mode is probably the most used mode for this problem, and it works fine.
| [reply] |
Re: Getting into Emacs?
by FunkyMonk (Bishop) on Apr 11, 2008 at 15:30 UTC
|
O'Reilly's Learning GNU Emacs, Third Edition is probably your best bet, it taught me an awful lot about emacs, and I'd been using emacs for years before I read it.
Emacs has an excellent help system (C-h ?) that can teach you a lot about Emacs. Apropos (C-h a) is very useful for searching for the keystrokes to do something. If you've got a few weeks to spare, C-h b will show you all ~700 keyboard commands:) The Emacs Manual is also available in the help system (C-h i s emacs RET)
The emacs wiki is a very good resource, Learning About Emacs may help you.
Finally, for use with Perl, cperl-mode is a must, but get a more recent version than the one that ships with Emacs
| [reply] [d/l] [select] |
Re: Getting into Emacs?
by Old_Gray_Bear (Bishop) on Apr 11, 2008 at 14:53 UTC
|
I ran across this in Hunt and Thomas's The Pragmatic Programmer:
EMACS
The ultimate in big editors, containing every feature that any editor has ever had, Emacs has a near-vertical learning curve, but repays handsomely once you’ve mastered it. It also makes a great mail and news reader, address book, calendar and diary, adventure game, ...
I thought they were joking.
----
I Go Back to Sleep, Now.
OGB
| [reply] |
|
|
I got very drunk last night, and definitely enjoyed myself. Now it's morning, I'm pushing through a little hangover, and I found a ~600 page Vim guide (PDF) on my desktop. I don't know how it got there, who it was written by, or anything along those lines, but I do know that it wasn't there last night. The filename is "vimbook-OPL.pdf".
Anyway, I think this is an eery sign that I should go with Vim.
| [reply] |
Re: Getting into Emacs?
by swampyankee (Parson) on Apr 11, 2008 at 15:43 UTC
|
O'Reilly has at least one volume about emacs and I found several here.
I happen to love emacs, but not obsessively so, and find it to be an incredibly useful editor. And I've used others, including crisp and multiedit, and kept wishing for emacs. Or vim.
Information about American English usage here and here. Floating point issues? Please read this before posting. — emc
| [reply] |
Re: Getting into Emacs?
by Erez (Priest) on Apr 11, 2008 at 15:53 UTC
|
will Emacs answer my needs for HTML, CSS, JavaScript, PHP, MySQL, Perl, and Python coding?
Just what exactly are your needs? No editor, be as good or as complicated as it can be can code for you. It won't suggest the right algorithm, nor will it correct your data-structures. If you can specify what do you look for in an editor, perhaps a better suggestion will be available.
This been said, try this EMACS page it seems to know what it's doing.
UPDATE: But then again, it might not, see following remarks. This is what happens when you recommend things without checking them up first.
Also, two side notes, EMACS is fully programmable, meaning you can create an elisp file that will alter its behavior in a way that will support whatever you want to do (and most chances are that someone already did it). So the answer to any EMACS q is usually "yes", but it may need to be added, or created.
Two, a steep learning curve means that you can get on top of things (the y grid) very fast (the x grid). What you mean is a very gradual, or flat, learning curve (takes lots of time to learn how to do something)
| [reply] |
|
|
| [reply] |
|
|
Emacs can do all of this, though real thorough code completion is really dependent on the support of and mode for the language you're using. There are a whole bunch of generic completion minor modes too, so you'll never be completely without it if you don't want to.
For perl, I don't really use the debugger much at all. You may also be interested in Sepia, which runs an "inferor perl" more or less like Slime for Lisp, which means it can catch/debug exceptions when they occor, do completions based on whatever is currently defined in your running perl process etc. This is a pretty different way of developing than the usual save/compile/run methods, and suits some kinds of programs better than others.
| [reply] |
|
|
"This been said, try this EMACS page it seems to know what it's doing."
Ah, yes
"Xah's Emacs Tutorial"
Xah certainly knows his way around emacs, but he's a bit of a windows weenie... he gets a bit snarky that a lot of us have trouble caring about things like this:
"Turn on CUA Mode" ... "The CUA mode will make emacs behave more like modern applications"
Of course, if you're also coming from a windows background, it could be his advice is just what you need.
| [reply] |
|
|
| [reply] [d/l] [select] |
|
|
|
|
|
|
|
First off, the emacs community widely agrees that xah is insane. I recommend not linking newbies to his site.
Secondly, I disagree about Emacs' learning curve. You can immediately open a file, start typing (with syntax highlighting, etc.), save it, etc. all without ever needing to know anything about emacs. Just use the menubar or toolbar like in any GUI application.
Once you decide Emacs is decent, then you can invest in learning the key bindings and the advanced features. Emacs comes with very good documentation, and it's self-documenting. So if you accidentally press a key and like what it does, you can can C-h k <that key command again> and get detailed information on that command.
And of course, elisp makes it very easy to extend emacs. Emacs makes programming in elisp quite enjoyable, even though elisp is definitely Not Perl.
YMMV, but vi will never have the level of documentation and extension ability that emacs does.
| [reply] |
Re: Getting into Emacs?
by mhearse (Chaplain) on Apr 11, 2008 at 16:40 UTC
|
There is a really nice 7 part tutorial at IBM Developerworks:
1 2 3 4 5 6 7 | [reply] |
Re: Getting into Emacs?
by perrin (Chancellor) on Apr 11, 2008 at 16:13 UTC
|
Also, will Emacs answer my needs for HTML, CSS, JavaScript, PHP, MySQL, Perl, and Python coding? Especially when, for example, HTML and CSS, or PHP and HTML are mixed in a file?
Emacs has a "mixed mode" which allows it to handle this sort of thing. I use it for editing Mason pages with in-line perl code.
| [reply] |
|
|
Emacs has a "mixed mode" which allows it to handle this sort of thing. I use it for editing Mason pages with in-line perl code.
Yes, you probably mean "mmm-mode"... it was originally written to
deal with Mason (perl and html intermixed) so that case should
certainly work out-of-the-box. In theory, with a little setup
you can use this on any number of combinations (myself, I still need
to look into how to deal with SQL embedded in perl heredocs...):
- On the emacswiki:
- MultipleModes
- HtmlModeDeluxe
I could not tell you if something like this has ever been written
for vim, but I have my doubts it would be that easy to do... certainly I've never heard of anything
like it.
Obviously, I also like the emacswiki, and I tell people to check
there first because for some reason the site doesn't rank very
high in google searches. There's a page with pointers to
different perl-related emacs projects:
-
PerlLanguage
(One of my fantasies is to someday set-up some kind of emacs
bundle for people who want to use it to hack on perl...)
| [reply] |
|
|
Two seconds of googling would have confirmed that Vim has its own Mason mode with separate perl and HTML highlighting. It may not be implemented in the same way as the Emacs one, but it sounds pretty good.
| [reply] |
|
|
|
|
And here's the other big question: Can Vim do these things as well?
| [reply] |
|
|
Of course. I don't use vim, but no editor could survive this long without capabilities like that.
| [reply] |
Re: Getting into Emacs?
by Your Mother (Archbishop) on Apr 11, 2008 at 17:01 UTC
|
I'm an Emacs user and fan and I've been starting to use TextMate a bit more. I see it as a sort of candy coated Emacs; in a good way. Emacs has more corners to explore than probably any other editor in the world but sometimes a simple popup menu that goes with the mode you'll only use now and then is better than having the complete range of possibilities tied to short-cuts, customizations, and key-completions. TextMate bundles, I think they're called, are also getting more and more specific. A couple of the JavaScript libraries have them, for example. Not to dissuade, because Emacs (and vim) is pretty much always going to be there wherever you get stuck having to work on something, but I could see myself moving entirely to TextMate for home hacking over the next year or so.
Update: deleted typo’d letter.
| [reply] |
|
|
Exactly. I'm at a new job (in a ColdFusion environment, of all things) and they've stuck me on a Windows box like all of my other web design jobs. My muscle memory and best productivity is in TextMate, but obviously that won't happen here, and I'm not going to get the company to pony up the money for Windows TextMate knockoff "E".
I'll be damned if I use the Dreamweaver editor much longer, so I've been considering having IT install either Vim or Emacs (or both) since nobody will whine, the software being free and relatively resource-conservative. And obviously I'm going to become pretty good with whichever one I choose, so I'd like that one to be an editor that best fits my future needs, and that maybe I can use on all platforms since using a Mac-only text editor is not the best idea when I'm regularly going between Mac, Linux, BSD, and Windows.
| [reply] |
|
|
There is something called E Text Editor which is an attempt to replicate TextMate on windows. As far as I saw, it's good.
| [reply] |
|
|
Re: Getting into Emacs?
by BKB (Novice) on Apr 13, 2008 at 00:44 UTC
|
About learning Emacs
I recommend first of all using Ctrl-h t to do the Emacs tutorial. If you are still happy to carry on using Emacs after this initial experience, then I recommend you to buy a printed copy of the GNU Emacs Manual by Richard Stallman
Reading the whole of this book at the start of your Emacs learning process will save you much pain later on.
It's also much better than the O'Reilly book mentioned above.
What Emacs does for you
Emacs (I use cperl mode) can make writing source code much easier by doing things like indenting the lines of code automatically, or colouring in the key words and variable types. For example, see this blog post, which was created using Emacs's colourings for cperl mode with htmlize.el.
Emacs for other languages
Emacs has patchy coverage for languages. Coverage for Emacs Lisp and C
is excellent, but it doesn't come with a JavaScript mode, although
there are ones that can be installed. The default CSS mode in
Emacs is pretty strange, but
it
is possible to set it up better.
Emacs' HTML mode seems OK to me, but I don't know anything about MySQL
(it has an SQL mode but I don't know anything about it), Python, or PHP.
As for mixed languages in the same file, as far as I know Emacs
doesn't do that at all well. You have to switch between modes in
different parts of the file.
| [reply] |
|
|
cperl mode has a few other nice features besides just indenting and coloring. There is a "Perl" menu available whenever editing perl files with nice perl-specific entries. Another feature I enjoy is the "cperl-get-help" function, which will provide context-sensitive format help for perl constructs. You can bind it to a key, or turn on "autohelp", providing context-sensitive help after a period of inactivity. This can be very convenient for perl constructions that you don't use often (e.g., secsockopt()) where you know what you want but don't remember the order of parameters, etc..
| [reply] |
Re: Getting into Emacs?
by mr_mischief (Monsignor) on Apr 11, 2008 at 16:59 UTC
|
| [reply] |
Re: Getting into Emacs?
by dhosek (Beadle) on Apr 11, 2008 at 17:24 UTC
|
| [reply] |
|
|
| [reply] |
|
|
The Aquamacs changes are very annoying if you try to use Emacs on another platform as well; an Emacs configuration that sets up M-x to be "cut" is almost trying to make people's life difficult down the road. Better to swallow the bitter pill right up front and learn to C-w and C-y like everyone else. (Or A-x and A-v if you really can't do without something vaguely familiar.) That said, once all the silly defaults are disabled and the standard Emacs behaviour is restored, it's arguably a better Emacs port than Carbon Emacs, and thus is what I use when I'm working on a Mac.
| [reply] |
|
|
| [reply] |
|
|
IMHO Aquamacs is a terrible idea. If you want to learn Emacs, either find someone who uses it and steal their configuration, or learn from the Emacs Wiki. Aquamacs makes a lot of dumb interface choices, e.g. mode-specific color themes and one buffer per frame. Plus, it dials home regularly to report your usage statistics. Use the carbon emacs package from apple.com, which does the bundling without breakage or spying.
| [reply] |
Re: Getting into Emacs?
by rudder (Scribe) on Apr 11, 2008 at 19:41 UTC
|
| [reply] |
Re: Getting into Emacs?
by Gavin (Archbishop) on Apr 12, 2008 at 15:11 UTC
|
"Also, will Emacs answer my needs for HTML, CSS, JavaScript, PHP, MySQL, Perl, and Python coding? Especially when, for example, HTML and CSS, or PHP and HTML are mixed in a file?"
My personal choice for Perl and MySQL has always been a free small editor called PFE and for CSS, PHP, HTML, XHTML, Javascript, ASP etc I find I never use anything other than Dreamweaver and now with AJAX extensions its a one stop shop.
| [reply] |
Re: Getting into Emacs?
by Your Mother (Archbishop) on Apr 16, 2008 at 21:57 UTC
|
Sorry to come back to this late but it just occurred to me. Emacs and many OS X apps share lots of keyboard shortcuts for things like skipping/deleting words or jumping around text. Fringe benefit of knowing Emacs is you can go mouseless a bit more in OS X.
| [reply] |