Bruce Momjian <maillist@candle.pha.pa.us> writes:
> It just seemed obvious things you would want to
> configure in an editor were not there, like tab size.
M-x set-variable tab-width.
Actually, I use the following command to customize Emacs for working
with the Postgres sources:
; Cmd to set tab stops &etc for working with PostgreSQL code
(defun pgsql-mode () "Set PostgreSQL C indenting conventions in current buffer." (interactive) (c-mode)
;necessary to make c-set-offset local! (setq tab-width 4) ; already buffer-local ; (setq comment-column 48)
; already buffer-local (c-set-style "bsd") (c-set-offset 'case-label '+)
)
This produces a pretty close approximation to the project's standard
indentation rules. The only thing I've noticed it doesn't get right
is that it doesn't know to put the left '{' after a foreach(...) at
the same indent as the foreach line --- you have to manually
unindent the '{' one stop before you continue entering code.
I haven't got round to figuring out how to tell the syntaxer that
foreach is a loop keyword, although I'm sure it can be done.
I have two or three other such macros for customizing to the indent
habits of other projects ... buffer-local settings are nice ...
regards, tom lane