I am new to emacs and have a C file which is presently in gnu style in cc-mode. I have changed the style to linux by making the necessary changes in the .emacs file.
I want to change the style of whole file (the prewritten code) to the style linux. I am unable to do so.
I have tried reindenting the entire file, but it is not working. (although, the code I add after setting the style does come in linux style)
Here is the code which I added in .emacs file to change the style to linux.
(setq c-default-style "linux"
c-basic-offset 4)
Perform these steps:
(beginning-of-buffer), typically bound toM-<.(end-of-buffer), typically bound toM->. This sets a mark at the top of the buffer, then moves to the bottom.indent-regionfunction, typically bound toC-M-\.The final step will indent the region, which will be the entire buffer.