I've always been curious about Emacs, but I haven't made time to really dig into it. A resource like this will be very helpful. Looking forward to reading it!
I installed an earlier version of it 3+ years ago and then worked through the standard tutorial a couple of times, invoked with "C-h t" (control-key + h-key, then t-key).
After that, I was off and running with Emacs!
Once some familiarity with Emacs Lisp (elisp) has been acquired, a careful study of the prelude sources and the sources of various packages installed by prelude is a great way to acquire a deeper understanding of how to wire things together inside Emacs.
A decent way to get started learning elisp is to read the introductory text hosted on gnu.org:
Pro tip: if you haven't done so previously, you may want to remap your caps lock key (via OS settings) to act as an additional control-key – some users find caps lock easier to reach for with their left pinky finger than the left-control-key on many keyboards.
While it doesn't expose you to default key bindings (by default), I've been really digging this project https://github.com/syl20bnr/spacemacs as a gentle and more intuitive introduction into the world of Emacs.
Potentially interesting source, to be sure. But just a bit discombobulating to depict a nice looking hard-bound paper book at the top of the web-page only to read on the bottom: "The book is ebook only for now. I will supply the book in PDF and ePub formats"
I'd recommend checking into CreateSpace - I've done an enormous amount of research into print-on-demand services this year, and CreateSpace has the best total package (cost / ease-of-use / broad distribution) at the moment.
Lightning Source is also worth looking into for direct distribution, but if you intend to sell on Amazon, CreateSpace is the service to beat.
One feature where Emacs seems to be lacking is 'out of the box' text completion and IntelliSense. I know that there are modes like IDO, auto-complete, and probably others, but editors like Sublime and IntelliJ just work with zero effort. A detailed explanation on how to best configure Emacs would go a long way in making it easier to get started.
Check out Spacemacs. It tries to be just this: Emacs with a lot of plugins out of the box, sane keyboard shortcuts and Evil integration if you want it.
Sublime has completion of tokens but doesn't come with any IntelliSense to speak of. How well its symbol-indexing works is also heavily dependant on the robustness of the regex-y grammar in the particular language package that's active.
Still, as far as non-IDEs go, it is pretty capable and I do enjoy using it.
Does intelluJ support J or SMLNJ? Of course not because it's an IDE, not a text editor. Emacs selling point is its great power. The price of that power a learning curve.
Someone wrote those modes for Emacs, which is great.
Anyway, that's not the point, and your classic attitude dissuade new users. My comment was made because someone is writing a book about mastering Emacs. It's a great topic, and in a competitive world with limited time, developers want to get started quickly.
True, it's possible to write modes for other languages in IDEs, but I get the sense it's much more work than it is with Emacs, so Emacs has modes for more languages than the heavy IDEs like IntelliJ.
Emacs is not optimized for new users. That is not uncommon when it comes to tools in general -- e.g. a Gibson Les Paul, an Osprey tilt-rotar, or the C Programming Language. Each anticipates a humanware investment. That's not my attitude, just my observation.
Emacs isn't the right tool for everyone or every job. Neither is anything else, but Emacs facilitates building the tools to make it work for diverse tasks.
People wrote those extensions because Emacs was designed to be reconfigurable and extensible 30 odd years ago. Unlike IntelliJ, it was a core function not a feature.
Yeah, like I mentioned on this page, I've been using Emacs for almost 30 years. In that time, I've heard the "right tool for the right job" expression so much that it almost makes me ill. It offers little value. The silly metaphors add no value either.
Now, back to my point, if you're writing a book about mastering Emacs, like we are discussing, one of its main weaknesses is out of the box code-completion. Many new users would be well served by covering this topic. I've shown Emacs to many people over the years that's one of the biggest complaints. Hippie expansion wasn't going to cut it.
Btw, it seems many other people share my attitude and there are "Batteries Includes" versions of Emacs.
You can be up and running within 30 minutes with Emacs. You're fine with the basics (use cursor keys, etc). Some people are happy with regular Notepad, after all. If you ever get the urge, you can learn more and become a power user. The problem is that out of the box, Textmate, Sublime, Notepad++, offer a quicker ramp up, so people take the quicker route. And once they've invested a few months, most don't want to learn a new editor.
I use M-/ for this purpose, which I think is bound by default. It expands based on whatever buffers are already open. Not syntax aware or anything, but useful nonetheless.
Yeah, I've actually used Emacs off and on for almost 30 years. For the past 10, I've used IntelliJ a lot more.
C-M-x / is cool too. It will show all possible results in another window.
My point is that modern tools work better out of the box. Emacs packages have evolved but that don't ship standard and that creates resistance for new users. There are actually a few solutions so that requires research and experimentation (i.e. more time). ido, auto-complete, cedet ? Helm looks like it might be the new power user tool?
For code completion, I had decent success with company-mode and its clang backend. This was a good return on time invested as it took all of about 5 minutes to set up and worked immediately on both Linux and Mac OS X (only requirement is clang-3.something, I think - apparently works on Windows too, albeit unsupported). Initially I found it a bit slow, but after switching off the while-you-type completions I became much happier.
More recently I've started using rtags (https://github.com/Andersbakken/rtags) for code browsing. This was a bit tricker to set up, as I had to build my own copy of clang and llvm (rtags needs a more recent copy than company-mode so the one from the Linux package manager wasn't good enough). Luckily this wasn't too hard - the official instructions are perfectly clear - and it was relatively plain sailing from then on.
Compared to Visual Studio or Xcode the results overall are inferior. The browsing or completion fails more often than VS/Xcode, even with system symbols, for reasons I have yet to investigate, and of course it's far from plug-and-play, particularly in terms of automatically getting the right header paths for the current project. But it's proving workable, and is a huge improvement over ctags, particularly for C++.
At least for C, with GNU Global I can jump around Linux Kernel effortlessly, while I put it into VS and VS just hanged.
For C++, well hopefully we have some new language to replace it in the future. But at least for jumping to symbol definitions/references, it shouldn't be a problem with GNU Global. For code completion, you can still use `company-gtags` to get completion symbols in your project. It's really simple. I know it's not really intelligent (i.e. only show completion candidates in current namespace), but instead throw you everything, but it's practical enough.
Context sensitivity is really important for C++, I've found, both for navigation and completion. C++ code uses struct/class members a lot, both functions and variables, and it's common for member functions to share names. That's how the virtual mechanism works, of course, and it's also commonly used to make classes useful as template parameters.
(For a long time, this kept me using Visual Studio+Visual Assist - which is OK - and Xcode - which is... mostly bearable - in preference to emacs. Everybody's different, but personally I get more value from good quality code completion and navigation than I do from emacs-quality text editing. Particularly true when I can load files into emacs if I need to do anything particularly advanced (mainly keyboard macro stuff or fancy elisp search/replace). Fortunately rtags + company mode have shuffled the tradeoffs around a bit, so I'm pretty comfortable with using emacs all the time now.)
Probably easier to get away without this stuff in C code, though personally I'd probably still get annoyed by the lack of intelligence in completing names of struct members.
Semantic is the equivalent to Intellisense in Visual Studio, though it's less smart on C++ code since C++ moves fast wiht its standard.
> Probably easier to get away without this stuff in C code, though personally I'd probably still get annoyed by the lack of intelligence in completing names of struct members.
Semantic or company-clang can give you code completion of struct members, and even nested struct.
28 comments
[ 3.3 ms ] story [ 75.8 ms ] threadhttps://github.com/bbatsov/prelude
I installed an earlier version of it 3+ years ago and then worked through the standard tutorial a couple of times, invoked with "C-h t" (control-key + h-key, then t-key).
After that, I was off and running with Emacs!
Once some familiarity with Emacs Lisp (elisp) has been acquired, a careful study of the prelude sources and the sources of various packages installed by prelude is a great way to acquire a deeper understanding of how to wire things together inside Emacs.
A decent way to get started learning elisp is to read the introductory text hosted on gnu.org:
An Introduction to Programming in Emacs Lisp
https://www.gnu.org/software/emacs/manual/eintr.html
Pro tip: if you haven't done so previously, you may want to remap your caps lock key (via OS settings) to act as an additional control-key – some users find caps lock easier to reach for with their left pinky finger than the left-control-key on many keyboards.
finally I am faster on emacs (with vim keybindings) that I am on atom or sublime. that, for me, is the tipping point.
(But suggestions welcome.)
Lightning Source is also worth looking into for direct distribution, but if you intend to sell on Amazon, CreateSpace is the service to beat.
(I work at Amazon, but not part of the MoD teams)
https://github.com/syl20bnr/spacemacs
Still, as far as non-IDEs go, it is pretty capable and I do enjoy using it.
http://plugins.jetbrains.com/?dbe
Someone wrote those modes for Emacs, which is great.
Anyway, that's not the point, and your classic attitude dissuade new users. My comment was made because someone is writing a book about mastering Emacs. It's a great topic, and in a competitive world with limited time, developers want to get started quickly.
Emacs isn't the right tool for everyone or every job. Neither is anything else, but Emacs facilitates building the tools to make it work for diverse tasks.
People wrote those extensions because Emacs was designed to be reconfigurable and extensible 30 odd years ago. Unlike IntelliJ, it was a core function not a feature.
Now, back to my point, if you're writing a book about mastering Emacs, like we are discussing, one of its main weaknesses is out of the box code-completion. Many new users would be well served by covering this topic. I've shown Emacs to many people over the years that's one of the biggest complaints. Hippie expansion wasn't going to cut it.
Btw, it seems many other people share my attitude and there are "Batteries Includes" versions of Emacs.
https://github.com/syl20bnr/spacemacs/blob/master/doc/DOCUME...
Optimizing for new User onboarding reduces the time to learn Emacs from 523 weeks to 520. It's still 10 years..
http://www.reddit.com/r/emacs/comments/1mt8a5/nearly_everyon...
C-M-x / is cool too. It will show all possible results in another window.
My point is that modern tools work better out of the box. Emacs packages have evolved but that don't ship standard and that creates resistance for new users. There are actually a few solutions so that requires research and experimentation (i.e. more time). ido, auto-complete, cedet ? Helm looks like it might be the new power user tool?
http://www.emacswiki.org/emacs/Helm
For code completion, I had decent success with company-mode and its clang backend. This was a good return on time invested as it took all of about 5 minutes to set up and worked immediately on both Linux and Mac OS X (only requirement is clang-3.something, I think - apparently works on Windows too, albeit unsupported). Initially I found it a bit slow, but after switching off the while-you-type completions I became much happier.
More recently I've started using rtags (https://github.com/Andersbakken/rtags) for code browsing. This was a bit tricker to set up, as I had to build my own copy of clang and llvm (rtags needs a more recent copy than company-mode so the one from the Linux package manager wasn't good enough). Luckily this wasn't too hard - the official instructions are perfectly clear - and it was relatively plain sailing from then on.
Compared to Visual Studio or Xcode the results overall are inferior. The browsing or completion fails more often than VS/Xcode, even with system symbols, for reasons I have yet to investigate, and of course it's far from plug-and-play, particularly in terms of automatically getting the right header paths for the current project. But it's proving workable, and is a huge improvement over ctags, particularly for C++.
For C++, well hopefully we have some new language to replace it in the future. But at least for jumping to symbol definitions/references, it shouldn't be a problem with GNU Global. For code completion, you can still use `company-gtags` to get completion symbols in your project. It's really simple. I know it's not really intelligent (i.e. only show completion candidates in current namespace), but instead throw you everything, but it's practical enough.
(For a long time, this kept me using Visual Studio+Visual Assist - which is OK - and Xcode - which is... mostly bearable - in preference to emacs. Everybody's different, but personally I get more value from good quality code completion and navigation than I do from emacs-quality text editing. Particularly true when I can load files into emacs if I need to do anything particularly advanced (mainly keyboard macro stuff or fancy elisp search/replace). Fortunately rtags + company mode have shuffled the tradeoffs around a bit, so I'm pretty comfortable with using emacs all the time now.)
Probably easier to get away without this stuff in C code, though personally I'd probably still get annoyed by the lack of intelligence in completing names of struct members.
Semantic is the equivalent to Intellisense in Visual Studio, though it's less smart on C++ code since C++ moves fast wiht its standard.
> Probably easier to get away without this stuff in C code, though personally I'd probably still get annoyed by the lack of intelligence in completing names of struct members.
Semantic or company-clang can give you code completion of struct members, and even nested struct.