[systemd-devel] [PATCH] Keep emacs configuration in one configuration file.

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Mar 7 10:23:04 PST 2011


On 07.03.2011 19:04, Lennart Poettering wrote:
>
> Oh, I had assumed that .vimrc trick would allow project-wide vim
> modelines without having to edit each and every single file.
>
> Currently, every file does contain an emacs modeline at the top. It
> would be fair I guess to add a vim modeline to all those files too, even
> though it's not necessarily pretty.
Hi,
maybe it makes sense to go in the opposite direction: add .dir-locals.el
in the top directory. The settings are actually identical in all .[ch] 
files.

---
  .dir-locals.el |    7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)
  create mode 100644 .dir-locals.el

diff --git a/.dir-locals.el b/.dir-locals.el
new file mode 100644
index 0000000..9d9f8cd
--- /dev/null
+++ b/.dir-locals.el
@@ -0,0 +1,7 @@
+; Sets emacs variables based on mode.
+; A list of (major-mode . ((var1 . value1) (var2 . value2)))
+; Mode can be nil, which gives default values.
+
+((nil . ((indent-tabs-mode . nil)
+         (tab-width . 8)))
+)
-- 

This patch should be complemented with something like:
       git grep -l 'Mode: C'|xargs perl -pi -e 'undef $/;' -e 's|/\*-\*- 
Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -\*-\*/\n*||'
:)

-
Zbyszek

> Hmm, or maybe we should just ask people to use something like this:
>
> http://www.vim.org/scripts/script.php?script_id=3381
>
> Would be fantastic if this was enabled by VIM by default...
>
> Lennart
>



More information about the systemd-devel mailing list