|
From: Andreas A. <ar...@li...> - 2018-11-21 16:47:26
|
Hi, After receiving feedback from Bart Van Assche and Mark Wielaard (thanks for that), here's an update to the proposed patch for adding Emacs configuration files to the Valgrind source tree. Does this now sufficiently cover all coding styles used in Valgrind? -- Andreas -- >8 -- Subject: [PATCH] Add Emacs configuration files This adds a configuration file ".dir-locals.el" for Emacs to the topmost directory of the Valgrind source tree, and another such file to the directory drd/tests. These files contain per-directory local Emacs variables. The following settings are performed: * The base C style is set to "Linux", indentation is set to 3 columns per level, the use of tabs for indentation is disabled, and the fill column is set to 80. * The directory coregrind/m_demangle is handled specially. The files in it are imported from libiberty and thus marked read-only, except for "demangle.c" and "vg_libciface.h", which are specific to Valgrind. * The source files in drd/tests use 2 instead of 3 columns per indentation level. --- .dir-locals.el | 24 ++++++++++++++++++++++++ coregrind/m_demangle/demangle.c | 1 + coregrind/m_demangle/vg_libciface.h | 1 + drd/tests/.dir-locals.el | 16 ++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 .dir-locals.el create mode 100644 drd/tests/.dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 000000000..a10d51304 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,24 @@ +;; Emacs settings for Valgrind. + +( + ;; Format used to turn a bug number into a URL (when displaying it). + (nil . ((bug-reference-url-format . "http://bugs.kde.org/show_bug.cgi?id=%s"))) + + ;; Standard settings for editing C source files. + (c-mode . ( + ;; Apply the Linux style as a base. + (c-file-style . "linux") + ;; Use spaces instead of tabs for indentation. + (indent-tabs-mode . nil) + ;; Indent 3 columns per level. + (c-basic-offset . 3) + ;; Lines should be limited to 80 columns. + (fill-column . 80) + )) + + ("coregrind/m_demangle" + ;; Most files in this directory should not be edited; they are imported + ;; from libiberty through the auxprogs/update-demangler script. + . ((nil . ((buffer-read-only . t)))) + ) +) diff --git a/coregrind/m_demangle/demangle.c b/coregrind/m_demangle/demangle.c index 00fa20389..dd933da8b 100644 --- a/coregrind/m_demangle/demangle.c +++ b/coregrind/m_demangle/demangle.c @@ -1,3 +1,4 @@ +/* -*- mode: C; buffer-read-only: nil -*- */ /*--------------------------------------------------------------------*/ /*--- Demangling of C++ mangled names. demangle.c ---*/ diff --git a/coregrind/m_demangle/vg_libciface.h b/coregrind/m_demangle/vg_libciface.h index 762e63a02..1aefd5db3 100644 --- a/coregrind/m_demangle/vg_libciface.h +++ b/coregrind/m_demangle/vg_libciface.h @@ -1,3 +1,4 @@ +/* -*- mode: C; buffer-read-only: nil -*- */ /*--------------------------------------------------------------------*/ /*--- Demangling of C++ mangled names. vg_libciface.h ---*/ diff --git a/drd/tests/.dir-locals.el b/drd/tests/.dir-locals.el new file mode 100644 index 000000000..0d94ded88 --- /dev/null +++ b/drd/tests/.dir-locals.el @@ -0,0 +1,16 @@ +;; Emacs settings for drd tests. + +( + ;; Standard settings for editing C source files. + (c-mode . ( + ;; Apply the Linux style as a base. + (c-file-style . "linux") + ;; Use spaces instead of tabs for indentation. + (indent-tabs-mode . nil) + ;; Indent 2 columns per level. Note that this differs from + ;; the usual Valgrind style. + (c-basic-offset . 2) + ;; Lines should be limited to 80 columns. + (fill-column . 80) + )) +) -- 2.17.0 |