]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
doc: HACKING: mention the new space-only indentation policy
authorJim Meyering <meyering@redhat.com>
Fri, 27 Feb 2009 16:10:19 +0000 (17:10 +0100)
committerJim Meyering <meyering@redhat.com>
Tue, 25 Aug 2009 07:21:00 +0000 (09:21 +0200)
HACKING

diff --git a/HACKING b/HACKING
index 928f0c50447c8b7ac1c6e7f5969d195dd9698242..b14b6047dcdd82b3d43f25786916c3082fa8c25c 100644 (file)
--- a/HACKING
+++ b/HACKING
@@ -233,20 +233,25 @@ Try to make the summary line fit one of the following forms:
   maint: change-description
 
 
-Use SPACE-only indentation in new files.
-========================================
-In any new file, eliminate all leading TABs (e.g., via running GNU indent
-with --no-tabs) and put these lines at the end of the file:
-[FIXME: suggest vim syntax to do same thing, if it can be done safely.
- Most distros now "set nomodeline" by default for a good reason. ]
+Use SPACE-only indentation in all[*] files
+==========================================
+We use space-only indentation in nearly all files.
+If you use Emacs and your coreutils working directory name matches,
+this code enables the right mode:
 
-/*
- * Local variables:
- * indent-tabs-mode: nil
- * End:
- */
+  ;; In coreutils, indent with spaces everywhere (not TABs).
+  ;; Exceptions: Makefile and ChangeLog modes.
+  (add-hook 'find-file-hook '(lambda ()
+    (if (and buffer-file-name
+             (string-match "/coreutils\\>" (buffer-file-name))
+             (not (string-equal mode-name "Change Log"))
+             (not (string-equal mode-name "Makefile")))
+        (setq indent-tabs-mode nil))))
 
-Do not change TABs to spaces or vice versa in any existing file.
+[*] Makefile and ChangeLog files are exempt, of course.
+
+[FIXME: suggest vim syntax to do same thing, if it can be done safely.
+ Most distros now "set nomodeline" by default for a good reason. ]
 
 
 Send patches to the address listed in --help output