emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#17012: closed ([3 PATCHES] Whitespace cleanup : Re


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#17012: closed ([3 PATCHES] Whitespace cleanup : Replace code-alignment tabs with spaces.)
Date: Sun, 06 Apr 2014 05:35:02 +0000

Your message dated Sat, 05 Apr 2014 22:34:16 -0700
with message-id <address@hidden>
and subject line Re: [3 PATCHES] Whitespace cleanup : Replace code-alignment 
tabs with spaces.
has caused the debbugs.gnu.org bug report #17012,
regarding [3 PATCHES] Whitespace cleanup : Replace code-alignment tabs with 
spaces.
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
17012: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17012
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [3 PATCHES] Whitespace cleanup : Replace code-alignment tabs with spaces. Date: Fri, 14 Mar 2014 20:33:28 +1030 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
G'day,

I've been looking at the grep sources with various tools, and have found on a
couple of occasions that tab characters (ASCII code 09, ^I) confused me where
they occurred in the code.  For example, in commit ...c73ca06859c0820d9d,
Paul Eggert had to pacify "make dist", which calls "make syntax-check", as a
line had leading tabs:

         * src/dfa.c (parse_bracket_exp): Reindent with spaces.

I've worked on other projects where consistent and concise code formatting is
stringently applied (usually as code commit hooks that run Perl scripts), and
have found this environment useful, as there is a "canonical" representation
of the source to refer to.  GNU grep has made several steps in this direction
(e.g. no leading tabs, no trailing whitespace), but the translation isn't
complete:  Tabs still appear in a few selected places in the code.

One easy way to spot tab characters in C sources (merely .c and .h files here)
is to use "cat -T", which replaces the horizontal tab character with "^I":

        for f in *.[ch] ; do
                TMPFILE =`mktemp`
                echo "$f" ; cat -T "$f" >"$TMPFILE" ;        \
                       diff "$f" "$TMPFILE" ; rm -f "$TMPFILE"
        done

Another way (ASCII) is to look for hex code "09" in an octal dump of a source:

        for f in *.[ch] ; do
                echo "$f" ; od -txC "$f" | grep " 09"
        done

Attached are three small, concise patches, each changing one file in the
grep/src directory (I'm not daring to tackle gnulib at present).  These are
small, self-contained and should be fairly easy to review.  The files
modified are grep.h, kwset.h and dosbuf.c.

Please let me know if these changes are considered to be worthwhile, and,
if so, I'll submit larger patches for kwset.c, main.c and dfa.c.

cheers,

behoffski (Brenton Hoff)
Programmer, Grouse Software

Attachment: maint-dosbuf.c-tabs-spaces.patch
Description: Text Data

Attachment: maint-grep.h-tabs-spaces.patch
Description: Text Data

Attachment: maint-kwset.h-tabs-spaces.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: [3 PATCHES] Whitespace cleanup : Replace code-alignment tabs with spaces. Date: Sat, 05 Apr 2014 22:34:16 -0700 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 As the original issue here seems to have been resolved with a "that's not a bug", I'm closing the report.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]