PDA

View Full Version : C Programming and Emacs



elgoog
July 13th, 2008, 08:26 AM
Hi, How can I use C Programming with Emacs. I just installed Emacs for the first time and one problem with using it is tabs and indentation.
Does someone have a link to any tutorial that help me regarding this.

LaRoza
July 13th, 2008, 08:35 AM
Hi, How can I use C Programming with Emacs. I just installed Emacs for the first time and one problem with using it is tabs and indentation.
Does someone have a link to any tutorial that help me regarding this.

Emacs is highly customizable (it is just a REPL).

Google "emacs with C" gets me: http://www.bloomington.in.us/~brutt/emacs-c-dev.html

(Note, Emacs is evil and Vim is the best editor)

Canis familiaris
July 13th, 2008, 08:37 AM
(Note, Emacs is evil and Vim is the best editor)
Why so?

LaRoza
July 13th, 2008, 08:39 AM
Why so?

I don't want to get into it on this thread, but I couldn't give advise for emacs (or say anything about it) without stating my views. Must represent my side of the flame.

Canis familiaris
July 13th, 2008, 08:41 AM
I don't want to get into it on this thread, but I couldn't give advise for emacs (or say anything about it) without stating my views. Must represent my side of the flame.
Yeah but the word EVIL is tad too strong.

LaRoza
July 13th, 2008, 08:44 AM
Yeah but the word EVIL is tad too strong.

No, it is too weak, but I have to keep in mind the CoC when responding. The Church of Emacs with its godless high priest are the bane of text editing. (If you think I am joking, try http://www.dina.kvl.dk/~abraham/religion/)

schauerlich
July 13th, 2008, 08:51 AM
No, it is too weak, but I have to keep in mind the CoC when responding. The Church of Emacs with its godless high priest are the bane of text editing. (If you think I am joking, try http://www.dina.kvl.dk/~abraham/religion/ (http://www.dina.kvl.dk/%7Eabraham/religion/))

LaRoza, this is why we keep you around. :D

-grubby
July 13th, 2008, 08:59 AM
LaRoza, this is why we keep you around. :D

How could we get rid of our favorite bot? They're integrated right into Vbulletin. Almost makes me wish I had $160 just so I could have a LaRoza of my own

Canis familiaris
July 13th, 2008, 09:13 AM
How could we get rid of our favorite bot? They're integrated right into Vbulletin. Almost makes me wish I had $160 just so I could have a LaRoza of my own
So LaRoza is a bot! :lolflag:
Yeah I was wondering how could a human make a post while being offline.

Ruhe
July 13th, 2008, 11:42 AM
Google "emacs with C" gets me: http://www.bloomington.in.us/~brutt/emacs-c-dev.html


I also use these two hoocks:



;; here you can apply any C style which you like, I choosed K&R
(add-hook 'c-mode-hook
'(lambda ( )
(c-set-style "k&r")))

;; auto new line
;; indents cursor when you press ENTER
(add-hook 'c-mode-hook
'(lambda ( )
(c-toggle-auto-state)))



Maybe anybody can tell me, how to make ecb outline all the functions in opened file. "Methods" window shows only includes.
"Rebuild methods buffer" doesn't help.

CptPicard
July 13th, 2008, 01:59 PM
I do believe that it is the other side around -- LaRoza has assimilated this instance of VBulletin and added its distinctiveness to her own. Now, the bulletin exists in a sort of Matrix-like state she is able to enter and exit at will...

But anyway OP has chosen well regarding his text-editing salvation. Thrice vi is the number of the beast, and even the Collective is just a REPL (apparently on a completely open port too -- after all Data was able to run (sleep) on it), so one day we may be able to port Emacs to run on it and use the whole thing for our own purposes ... try that with vi.

nvteighen
July 13th, 2008, 02:10 PM
Use MS Notepad! (Or better, QBASIC \editor, to launch MS-DOS Editor)

(If you're a beginner, gedit may be all you need)

LaRoza
July 13th, 2008, 05:56 PM
(If you're a beginner, gedit may be all you need)

Even for advanced programmers, gedit has enough useful features to be the editor used. Its plugins are really good.

johnl
July 13th, 2008, 07:53 PM
There are a lot of nifty emacs modules out there that you can use: xcscope.el for cscope integration, the cdet package for general development features, p4.el (if you're using perforce; there are other modules out there for svn, cvs, etc...), flymake.el for on-the-fly syntax checking.

Here are some of the things that I run in the c-mode-hook:


(c-set-style "k&r") ;; Kernihan & Richie's style
(setq tab-width 8) ;; tab is 8 spaces
(setq c-basic-offset 4) ;; indent is 4 spaces
(c-set-offset 'substatement-open 0) ;; No indent for open bracket
(show-paren-mode 1) ;; Highlight matching parens
(turn-on-font-lock) ;; Turn on font lock mode
(setq indent-tabs-mode nil) ;; only use spaces for indenting.