(add-hook 'c++-mode-hook '(lambda() (font-lock-mode 1) (c-toggle-auto-state)))It's some Lisp gibberish (emacs has a built-in Lisp interpreter).
My setup is this: I use emacs to make changes to a source program, save the changes with a hotkey, switch to the shell (command line) with a hotkey, recall the previous compile command with history hotkey, see the syntax errors, switch back to emacs with a hotkey. Hands don't have to leave the keyboard.
You can compile your myprogram.cpp in Emacs. Do this:
M-x (meaning hit the Esc then x) then type compile in the minibuffer. A prompt in the minibuffer says "Compile command: make -k", with the cursor positioned after the k. Erase the "make -k" and type in your compile command which at a minimum can be g++ myprogram.cpp and Return.
(The next time you execute M-x compile, emacs will remember the previous compile command and prompt you with it. All you have to do is Enter, and the old compile command will be executed.)
(In the Tools menu, choosing Compile... gets you the same thing.)
Syntax errors will be shown in the lower half of the emacs window. Do C-x` (which in emacs-speak means hold down Control key, hit x, release control, hit ` [backquote, not apostrophe]) to jump to the first syntax error.
Putting this into your .emacs file allows C-xg to invoke the compile command (bypassing typing M-x compile):
(define-key global-map "\C-xg" 'compile)There's some way to get emacs to guess at what you want the compile command to be (so you don't get the default make -k but I haven't been able to get it to work yet...
KDE's kdevelop should be on your system if you installed KDE.
Dev-C++ beta for Linux