A very simple Makefile:
all:
gcc -o hello hello.c
And I already set:
(add-hook 'before-save-hook
'(lambda ()
(delete-trailing-whitespace)
;; indent the whole buffer before-save
(when (derived-mode-p 'prog-mode)
(indent-region (point-min) (point-max)))))
in my init.el
, so if I C-x C-s
in this Makefile file, it will become:
all:
gcc -o hello hello.c
Is there a way I can make Emacs recognize that the lines under :
symbol should be indented with one TAB?
BTW: Typing TAB in the gcc...
line will keep inserting tabs, is there a way that typing TAB indents this line like doing it in C code and TAB again won't do anything like inserting another tab)?