~/.emacs.d/init.elThis contains "elisp" commands which are executed upon emacs start-up. Elisp is the Emacs variant of LISP. Honestly, even though I am good with basic MIT Scheme, and also the Elk Scheme I use at work, I find Elisp fairly challenging. But Google is my friend, so I inserted the following:
;Basic unit of spaces for each indentation level. ; c-basic-offset: sets offset for "C-class" languages ; I specifically set it smaller in Java, which tends to have extra indents ; with its class structure. (setq c-basic-offset 4) (add-hook 'java-mode-hook '(lambda () (setq c-basic-offset 2) ) ) ; force emacs to use spaces (setq-default indent-tabs-mode nil)Now "C-class" languages default to an offset of columns, but because Java tends to have so many tab stops, I set the Java indent to 2 columns. Two works pretty well for me: enough indent for structure, but obviously not so much that things get pushed off to the right. The last two lines of the above suppress use of the tab character in files. Tab characters are a general disaster, as different environments assume different tab spacing. A few extra bytes to fill these in with spaces is well invested in any case where anything but an arbitrary value for tab spacing is unacceptable.