Le 10 janv. 09 à 22:25, Ralf Wildenhues a écrit :

BTW, your editor seems to both reformat existing code, and use
different indenting strategy for new code.  Hmm.

Yeah, I know. But fixing the indentation issues progressively does not
seem bad to me.  I certainly don't want these useless differences to
creep into my new code.

This implies that there is a single, well-defined ideal state.  Your
editor does not collapse 8 spaces to a TAB, mine (and some others) does.
This causes whitespace-only changes.  Very very minor, I agree, but
still a small irritation when reviewing.

I agree.

Maybe we should update HACKING
about the style we decide about?
(note this is really just bike shedding, and babbling)

I definitely think this would be a good idea.

I have worked for years with the same set up as you, using an much TAB as is possible. But I read someday something that Jim wrote about this topic, in which he was advocating the no-tab approach, and I was convinced. What changed my viewpoint was that (i) Jim is in favor of it, so it's good :) and (ii) because he did point out that it makes it really easier to discuss about code in emails. It is true that I have been disturbed and even annoyed by tab vs. space in some patches that gave the impression of improper indentation.

Therefore, for a year or so, I am now using spaces only.

Just to give my 0.02€ about this.

The following patch addresses space issues in libtoolize. Some are benign, some are really dangerous because they invite some editors to break the code. I speak from experience: I once broke Autoconf because of <sp><tab> -> <tab> cleanup from my editor :( I really recommend that this patch (or a variation thereof, maybe based on $lt_sp and $lt_tab) be applied, independently from whether the Libtool republic votes for tab or space for presidency, as tracking these issues is uneasy.

From 425171194b41e6627aae75f18dfa5620e8a8c34d Mon Sep 17 00:00:00 2001
From: Akim Demaille <demai...@gostai.com>
Date: Mon, 19 Jan 2009 09:05:31 +0100
Subject: [PATCH] Clean space uses.

        * libtoolize.m4sh: Remove trailing spaces.
        Use <tab><sp>, as some editors remove "useless" spaces in
        <sp><tab>.
---
 libtoolize.m4sh |   32 ++++++++++++++++----------------
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index 0eefa98..a3aa74d 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -182,7 +182,7 @@ all_pkgltdl_files="COPYING.LIB Makefile Makefile.in 
Makefile.inc Makefile.am REA
       --install|-i)    opt_install=: ;;
 
       --ltdl)          opt_ltdl=:
-                       if test "$#" -gt 0; then
+                       if test "$#" -gt 0; then
                          case $1 in
                            -*) ;;
                            *)  ltdldir=`$ECHO "$1" | $SED 's,/*$,,'`
@@ -195,7 +195,7 @@ all_pkgltdl_files="COPYING.LIB Makefile Makefile.in 
Makefile.inc Makefile.am REA
       --no-warn)       opt_warning=false ;;
 
       --nonrecursive|--non-recursive)
-                       ltdl_mode=nonrecursive
+                       ltdl_mode=nonrecursive
                        ;;
 
       --quiet|--automake|-q) # --automake is for 1.5 compatibility
@@ -311,7 +311,7 @@ func_copy_cb ()
     copy_return_status=1
 
     # Libtool is probably misinstalled if this happens:
-    test -f "$my_srcdir/$my_file" || 
+    test -f "$my_srcdir/$my_file" ||
         func_fatal_error "\`$my_file' not found in \`$my_srcdir'"
 
     case $opt_verbose in
@@ -375,7 +375,7 @@ func_copy_some_files ()
         if test "X$my_copy_cb" = Xfunc_copy_cb; then
          $opt_force || if test -f "$my_destdir/$my_filename"; then
            $opt_quiet || func_echo_once "$my_msg_var"
-           $opt_quiet \
+           $opt_quiet \
              || func_error "\`$my_destdir/$my_filename' exists: use \`--force' 
to overwrite"
            continue
          fi
@@ -483,12 +483,12 @@ func_scan_files ()
         s,^.*AC_REQUIRE(.*$,,; s,^.*m4@&t...@_require(.*$,,;
        s,^.*m4@&t...@_define(.*$,,
        s,^.*A[CU]_DEFUN(.*$,,; s,^.*m4@&t...@_defun(.*$,,
-       /AC_CONFIG_AUX_DIR(/ {
-           s,^.*AC_CONFIG_AUX_DIR([[   ]*\([^])]*\).*$,ac_auxdir=\1,
+       /AC_CONFIG_AUX_DIR(/ {
+           s,^.*AC_CONFIG_AUX_DIR([[    ]*\([^])]*\).*$,ac_auxdir=\1,
            p
         }
-       /AC_CONFIG_MACRO_DIR(/ {
-           s,^.*AC_CONFIG_MACRO_DIR([[         ]*\([^])]*\).*$,ac_macrodir=\1,
+       /AC_CONFIG_MACRO_DIR(/ {
+           s,^.*AC_CONFIG_MACRO_DIR([[  ]*\([^])]*\).*$,ac_macrodir=\1,
            p
         }
        /_LT_CONFIG_LTDL_DIR(/d
@@ -503,14 +503,14 @@ func_scan_files ()
        }
        /the.*option into.*LT_INIT.*parameter/d
        /\@<:@LT_INIT/d
-       /LT_INIT/                {
+       /LT_INIT/                {
            s,^.*$,seen_libtool=:,
            p
        }
        /\@<:@LTDL_INIT/d
        /LTDL_INIT/          {
-           s,^.*LTDL_INIT([[   ]*\([^])]*\).*$,ltdl_options="\1",
-           s,^.*LTDL_INIT[     ]*$,seen_ltdl=:,
+           s,^.*LTDL_INIT([[    ]*\([^])]*\).*$,ltdl_options="\1",
+           s,^.*LTDL_INIT[      ]*$,seen_ltdl=:,
            p
        }
        /LT_WITH_LTDL/       {
@@ -634,8 +634,8 @@ func_scan_files ()
     # Hunt for ACLOCAL_AMFLAGS in `Makefile.am' for a `-I' argument.
 
     my_sed_aclocal_flags='
-        /^[    ]*ACLOCAL_[A-Z_]*FLAGS[         ]*=/ {
-           s,^[^=]*=[  ]*\(.*\), \1,
+        /^[     ]*ACLOCAL_[A-Z_]*FLAGS[         ]*=/ {
+           s,^[^=]*=[   ]*\(.*\), \1,
            q
        }
        d'
@@ -700,7 +700,7 @@ func_serial ()
     my_filename="$1"
     my_macro_regex="$2"
     my_sed_serial='
-       /^# serial [1-9][0-9.]*[        ]*'"$my_macro_regex"'[  ]*$/ {
+       /^# serial [1-9][0-9.]*[         ]*'"$my_macro_regex"'[  ]*$/ {
            s,^# serial \([1-9][0-9.]*\).*$,\1,
            q
        }
@@ -981,7 +981,7 @@ func_ltmain_update ()
     $opt_debug
     my_sed_ltmain='
        /^package_revision='\''*[0-9][1-9.]*'\''*/ {
-           s,^package_revision='\''*\([0-9.]*\)'\''*[  ]*$,\1,
+           s,^package_revision='\''*\([0-9.]*\)'\''*[   ]*$,\1,
            p
        }
        d'
@@ -1500,7 +1500,7 @@ func_check_macros ()
       else
         func_echo "Consider adding \`-I $macrodir' to ACLOCAL_AMFLAGS in 
Makefile.am."
       fi
-    fi 
+    fi
 
     # Don't trace for this, we're just checking the user didn't invoke it
     # directly from configure.ac.
-- 
1.6.0.4.790.gaa14a


Reply via email to