Re: [HACKERS] Crisp text editor [definitely OT]

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Crisp text editor [definitely OT]
Date: 1999-08-11 15:04:11
Message-ID: 7772.934383851@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)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

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 1999-08-11 15:54:51 Re: [HACKERS] Query length string
Previous Message Tom Lane 1999-08-11 14:56:03 Re: [HACKERS] Query length string