From 88be5e8e06615fa2067e35070bc78998ada05dd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Nordstro=CC=88m?= Date: Thu, 13 Apr 2017 10:16:51 +0200 Subject: [PATCH] Add PostgreSQL's .dir-locals.el style file This adds the .dir-locals.el Emacs style settings file from the PostgreSQL source. This will make it easier for Emacs users to conform to the official PostgreSQL coding style. --- .dir-locals.el | 20 ++++++++++++++++++++ src/compat-endian.h | 1 - src/murmur3.c | 1 - src/pgmurmur3.c | 1 - src/pgmurmur3.h | 1 - src/utils.c | 1 - 6 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 000000000..4dc305551 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,20 @@ +;; see also src/tools/editors/emacs.samples in the PostgreSQL source +;; tree for more complete settings + +((c-mode . ((c-basic-offset . 4) + (c-file-style . "bsd") + (fill-column . 78) + (indent-tabs-mode . t) + (tab-width . 4))) + (dsssl-mode . ((indent-tabs-mode . nil))) + (nxml-mode . ((indent-tabs-mode . nil))) + (perl-mode . ((perl-indent-level . 4) + (perl-continued-statement-offset . 4) + (perl-continued-brace-offset . 4) + (perl-brace-offset . 0) + (perl-brace-imaginary-offset . 0) + (perl-label-offset . -2) + (indent-tabs-mode . t) + (tab-width . 4))) + (sgml-mode . ((fill-column . 78) + (indent-tabs-mode . nil)))) diff --git a/src/compat-endian.h b/src/compat-endian.h index de96baf45..bb1e5cda4 100644 --- a/src/compat-endian.h +++ b/src/compat-endian.h @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ #ifndef _COMPAT_ENDIAN_H_ #define _COMPAT_ENDIAN_H_ diff --git a/src/murmur3.c b/src/murmur3.c index 3693d51e1..7b6f02007 100644 --- a/src/murmur3.c +++ b/src/murmur3.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* ----------------------------------------------------------------------------- */ /* MurmurHash3 was written by Austin Appleby, and is placed in the public */ /* domain. The author hereby disclaims copyright to this source code. */ diff --git a/src/pgmurmur3.c b/src/pgmurmur3.c index e313f6619..7bfa3274e 100644 --- a/src/pgmurmur3.c +++ b/src/pgmurmur3.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ #include "pgmurmur3.h" #include diff --git a/src/pgmurmur3.h b/src/pgmurmur3.h index e70c90bb9..28ac2bf82 100644 --- a/src/pgmurmur3.h +++ b/src/pgmurmur3.h @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ #ifndef _PGHASHLIB_H_ #define _PGHASHLIB_H_ diff --git a/src/utils.c b/src/utils.c index b753df7b5..3f786e5fe 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,4 +1,3 @@ -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */ #include #include