2 $Header: /cvsroot/pgsql/doc/src/sgml/sources.sgml,v 2.2 2000/03/31 03:27:41 thomas Exp $
6 <title>Postgres Source Code</title>
9 <title>Formatting</title>
12 Source code formatting uses a 4 column tab spacing, currently with
13 tabs preserved (i.e. tabs are not expanded to spaces).
17 For emacs, add the following (or something similar)
18 to your <filename>~/.emacs</filename>
22 ;; check for files with a path containing "postgres" or "pgsql"
23 (setq auto-mode-alist (cons '("\\(postgres\\|pgsql\\).*\\.[ch]\\'" . pgsql-c-mode) auto-mode-alist))
24 (setq auto-mode-alist (cons '("\\(postgres\\|pgsql\\).*\\.cc\\'" . pgsql-c-mode) auto-mode-alist))
26 (defun pgsql-c-mode ()
27 ;; sets up formatting for Postgres C code
30 (setq-default tab-width 4)
31 (c-set-style "bsd") ; set c-basic-offset to 4, plus other stuff
32 (c-set-offset 'case-label '+) ; tweak case indent to match PG custom
33 (setq indent-tabs-mode t)) ; make sure we keep tabs when indenting
38 For <application>vi</application>, your
39 <filename>~/.vimrc</filename> or equivalent file should contain
46 or equivalently from within vi, try
54 The text browsing tools <application>more</application> and
55 <application>less</application> can be invoked as
65 <!-- Keep this comment at the end of the file
70 sgml-minimize-attributes:nil
71 sgml-always-quote-attributes:t
74 sgml-parent-document:nil
75 sgml-default-dtd-file:"./reference.ced"
77 sgml-local-catalogs:("/usr/lib/sgml/catalog")
78 sgml-local-ecat-files:nil