|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
Adjusting Emacs, please helpHello! I have just installed Gnu Emacs for windows, and there are just a couple of things I would like to get adjusted for the moment.
I am writing applications in C/C++, and the first have to do with indentation. When I press tab, the row is indented. The current indent width is two spaces; I would like to get it to four spaces. I have searched in almost all settings topics, under Editing->Indent, and under Programming->Languages->C. What is "Standard Indent"? Isn't that how many spaces the indent width is? Anyway, that setting is 4 now, but it is certainly not the indent width. Then there is something called "C Basic Offset", which I have tried to change to 4, but it doesn't seem to have any effect. Can anyone help me change 'this thing? Of course I save all settings and set them for the current session as well. Another thing is the M-x compile. When I type that, the standard command will be "make -k". Since I'm running windows and using MinGW, I would like to change the standard to "mingw32-make -k". Can anyone help me do that? Thanks in advance! /Kristofer |
|
|
Re: Adjusting Emacs, please help> Date: Sun, 15 Jun 2008 08:50:45 -0700 (PDT)
> From: TriKri <kristoferkrus@...> > > I am writing applications in C/C++, and the first have to do with > indentation. When I press tab, the row is indented. The current indent width > is two spaces; I would like to get it to four spaces. I have searched in > almost all settings topics, under Editing->Indent, and under > Programming->Languages->C. What is "Standard Indent"? Isn't that how many > spaces the indent width is? Anyway, that setting is 4 now, but it is > certainly not the indent width. Then there is something called "C Basic > Offset", which I have tried to change to 4, but it doesn't seem to have any > effect. Can anyone help me change 'this thing? Try this: M-x set-variable RET tab-width RET 4 RET > Another thing is the M-x compile. When I type that, the standard command > will be "make -k". Since I'm running windows and using MinGW, I would like > to change the standard to "mingw32-make -k". Can anyone help me do that? It's easier to rename mingw32-make.exe to make.exe. But if you want to keep the original name for some reason that evades me, the variable you want to customize is `compile-command'. Btw, is there any reason you couldn't find all this in the manuals that come with Emacs? |
|
|
Re: Adjusting Emacs, please helpM-x set-variable, that could be a useful command, thanks! Unfortunately that doesn't help me now, cause I don't insert tabs to indent, but let emacs insert a number of spaces. That number is independent of the tab width. There is also a variable called standard-indent, but it don't seem to have any effect. Thanks! I didn't think about changing the name of the exe-file, but I find it better and faster to change the setting in emacs. What manuals, do you mean those in the info catalog? They aren't especially user friendly by my opinion. What file should I start reading? I have browsed with google, even went into gnu emacs home page and looked in their manual, but didn't find anything that could help me, at least not with changing the indent width. |
|
|
Re: Adjusting Emacs, please help> Date: Sun, 15 Jun 2008 11:53:03 -0700 (PDT)
> From: TriKri <kristoferkrus@...> > > > > M-x set-variable RET tab-width RET 4 RET > > > > M-x set-variable, that could be a useful command, thanks! Unfortunately that > doesn't help me now, cause I don't insert tabs to indent, but let emacs > insert a number of spaces. That number is independent of the tab width. In that case, you should read the node "Customizing Indentation" in the CC Mode manual (it comes with Emacs). c-basic-offset is probably the first thing to try, but the above node has much more in store, including a complete interactive customization of indentation in all C constructs. > > Btw, is there any reason you couldn't find all this in the manuals > > that come with Emacs? > > > > What manuals, do you mean those in the info catalog? They aren't especially > user friendly by my opinion. I advise you to get used to the Info manuals, they have a lot of useful information, easily accessible through the `i' index-searching command. > What file should I start reading? The basics of the Info system (in info.info), then the Emacs manual and (in your case) the CC Mode manual. |
|
|
Re: Adjusting Emacs, please helpLook at CC mode in the emacs info. (Editing Programs has a *note CC
Mode, follow that). I'm ashamed to admit that I haven't been entering much C code lately but I used to do quite a bit. Here are some very old settings from my .emacs file (just an example, and I haven't tested them lately -- they match a style at a company I worked for a long time ago): (setq c-indent-level 4) (setq c-continued-statement-offset 4) (setq c-brace-offset 0) (setq c-continued-brace-offset -4) (setq c-brace-imaginary-offset 0) (setq c-argdecl-indent 4) (setq c-label-offset -2) (setq c-auto-newline nil) |
|
|
Re: Adjusting Emacs, please helpI got it to work. The funny thing is that I have no idea what I did to make it work, I just did some random changes in Programming->Languages->C, and I thought I changed them all back to default, but apparently not! Now Bassic Offset does what it should do (as it didn't before), and my comments of this type
/* comment * more comment */ doesn't become /* comment * more comment */ when I indent the rows. So that work out well now to. :P |
| Free Forum Powered by Nabble | Forum Help |