From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 030D2429E25 for ; Thu, 12 Jan 2012 05:08:25 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fWIA1bxNgt-7 for ; Thu, 12 Jan 2012 05:08:24 -0800 (PST) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 24C7F431FB6 for ; Thu, 12 Jan 2012 05:08:23 -0800 (PST) Received: from zancas.localnet (fctnnbsc36w-156034076032.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.76.32]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id q0CD8JVL009667 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 12 Jan 2012 09:08:20 -0400 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1RlKOA-00042r-Tz; Thu, 12 Jan 2012 09:08:18 -0400 From: David Bremner To: Austin Clements Subject: Re: [PATCH 2/2] notmuch-reply.c: uncrustify In-Reply-To: <20120112035739.GW20796@mit.edu> References: <1324135695-15487-1-git-send-email-david@tethera.net> <1326197228-10356-1-git-send-email-david@tethera.net> <1326197228-10356-3-git-send-email-david@tethera.net> <20120112035739.GW20796@mit.edu> User-Agent: Notmuch/0.11~rc3 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 12 Jan 2012 09:08:18 -0400 Message-ID: <87r4z56pbx.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: notmuch@notmuchmail.org X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 13:08:25 -0000 On Wed, 11 Jan 2012 22:57:39 -0500, Austin Clements wrote: > > From: David Bremner > > > > This patch shows the raw result of running uncrustify on notmuch-reply.c. > > The re-indenting of "format_reply" would probably not be desirable. > > The good news is that that structure is on its way out. > > > @@ -625,6 +612,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) > > notmuch_query_t *query; > > char *query_string; > > int opt_index, ret = 0; > > + > > This one's a little weird. Did it get confused by the function > prototype? Yes, I think it is thinking the block of variable declarations ends there. > All of the other format fixes look very reasonable to me. I think you > managed to find one of the least canonical source files in the tree. > Was that intentional? Yes, I expect there would be less changes elsewhere. Although the changes might be more controversial, I guess. The corresponding diff for notmuch-search.c follows diff --git a/notmuch-search.c b/notmuch-search.c index 4baab56..8928e62 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -31,16 +31,16 @@ typedef enum { typedef struct search_format { const char *results_start; const char *item_start; - void (*item_id) (const void *ctx, - const char *item_type, - const char *item_id); - void (*thread_summary) (const void *ctx, - const char *thread_id, - const time_t date, - const int matched, - const int total, - const char *authors, - const char *subject); + void (*item_id)(const void *ctx, + const char *item_type, + const char *item_id); + void (*thread_summary)(const void *ctx, + const char *thread_id, + const time_t date, + const int matched, + const int total, + const char *authors, + const char *subject); const char *tag_start; const char *tag; const char *tag_sep; @@ -66,13 +66,13 @@ format_thread_text (const void *ctx, const char *subject); static const search_format_t format_text = { "", - "", - format_item_id_text, - format_thread_text, - " (", - "%s", " ", - ")", "\n", - "", + "", + format_item_id_text, + format_thread_text, + " (", + "%s", " ", + ")", "\n", + "", "\n", "", }; @@ -92,13 +92,13 @@ format_thread_json (const void *ctx, const char *subject); static const search_format_t format_json = { "[", - "{", - format_item_id_json, - format_thread_json, - "\"tags\": [", - "\"%s\"", ", ", - "]", ",\n", - "}", + "{", + format_item_id_json, + format_thread_json, + "\"tags\": [", + "\"%s\"", ", ", + "]", ",\n", + "}", "]\n", "]\n", }; @@ -122,7 +122,7 @@ sanitize_string (const void *ctx, const char *str) loop = out = talloc_strdup (ctx, str); for (; *loop; loop++) { - if ((unsigned char)(*loop) < 32) + if ((unsigned char) (*loop) < 32) *loop = '?'; } return out; @@ -160,7 +160,7 @@ format_item_id_json (const void *ctx, printf ("%s", json_quote_str (ctx_quote, item_id)); talloc_free (ctx_quote); - + } static void @@ -221,8 +221,7 @@ do_search_threads (const search_format_t *format, for (i = 0; notmuch_threads_valid (threads) && (limit < 0 || i < offset + limit); - notmuch_threads_move_to_next (threads), i++) - { + notmuch_threads_move_to_next (threads), i++) { int first_tag = 1; thread = notmuch_threads_get (threads); @@ -232,7 +231,7 @@ do_search_threads (const search_format_t *format, continue; } - if (! first_thread) + if (!first_thread) fputs (format->item_sep, stdout); if (output == OUTPUT_THREADS) { @@ -258,9 +257,8 @@ do_search_threads (const search_format_t *format, for (tags = notmuch_thread_get_tags (thread); notmuch_tags_valid (tags); - notmuch_tags_move_to_next (tags)) - { - if (! first_tag) + notmuch_tags_move_to_next (tags)) { + if (!first_tag) fputs (format->tag_sep, stdout); printf (format->tag, notmuch_tags_get (tags)); first_tag = 0; @@ -311,8 +309,7 @@ do_search_messages (const search_format_t *format, for (i = 0; notmuch_messages_valid (messages) && (limit < 0 || i < offset + limit); - notmuch_messages_move_to_next (messages), i++) - { + notmuch_messages_move_to_next (messages), i++) { if (i < offset) continue; @@ -323,9 +320,8 @@ do_search_messages (const search_format_t *format, for (; notmuch_filenames_valid (filenames); - notmuch_filenames_move_to_next (filenames)) - { - if (! first_message) + notmuch_filenames_move_to_next (filenames)) { + if (!first_message) fputs (format->item_sep, stdout); format->item_id (message, "", @@ -333,11 +329,11 @@ do_search_messages (const search_format_t *format, first_message = 0; } - - notmuch_filenames_destroy( filenames ); + + notmuch_filenames_destroy ( filenames ); } else { /* output == OUTPUT_MESSAGES */ - if (! first_message) + if (!first_message) fputs (format->item_sep, stdout); format->item_id (message, "id:", @@ -385,11 +381,10 @@ do_search_tags (notmuch_database_t *notmuch, for (; notmuch_tags_valid (tags); - notmuch_tags_move_to_next (tags)) - { + notmuch_tags_move_to_next (tags)) { tag = notmuch_tags_get (tags); - if (! first_tag) + if (!first_tag) fputs (format->item_sep, stdout); format->item_id (tags, "", tag); @@ -425,7 +420,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) int limit = -1; /* unlimited */ enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT } - format_sel = NOTMUCH_FORMAT_TEXT; + format_sel = NOTMUCH_FORMAT_TEXT; notmuch_opt_desc_t options[] = { { NOTMUCH_OPT_KEYWORD, &sort, "sort", 's', @@ -472,7 +467,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) if (notmuch == NULL) return 1; - query_str = query_string_from_args (notmuch, argc-opt_index, argv+opt_index); + query_str = query_string_from_args (notmuch, argc - opt_index, argv + opt_index); if (query_str == NULL) { fprintf (stderr, "Out of memory.\n"); return 1;