unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] cli/count: remove unused argument handling for output=modifications
@ 2015-09-07 13:33 David Bremner
  2015-09-07 13:33 ` [PATCH 2/2] cli/count: apply uncrustify changes David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2015-09-07 13:33 UTC (permalink / raw)
  To: notmuch

In the end this UI was rejected, but bits of it stayed in the code to
confuse future generations.
---
 notmuch-count.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/notmuch-count.c b/notmuch-count.c
index f26e726..66f5e53 100644
--- a/notmuch-count.c
+++ b/notmuch-count.c
@@ -25,7 +25,6 @@ enum {
     OUTPUT_THREADS,
     OUTPUT_MESSAGES,
     OUTPUT_FILES,
-    OUTPUT_LASTMOD,
 };
 
 /* The following is to allow future options to be added more easily */
@@ -151,7 +150,6 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])
 	  (notmuch_keyword_t []){ { "threads", OUTPUT_THREADS },
 				  { "messages", OUTPUT_MESSAGES },
 				  { "files", OUTPUT_FILES },
-				  { "modifications", OUTPUT_LASTMOD },
 				  { 0, 0 } } },
 	{ NOTMUCH_OPT_KEYWORD, &exclude, "exclude", 'x',
 	  (notmuch_keyword_t []){ { "true", EXCLUDE_TRUE },
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] cli/count: apply uncrustify changes
  2015-09-07 13:33 [PATCH 1/2] cli/count: remove unused argument handling for output=modifications David Bremner
@ 2015-09-07 13:33 ` David Bremner
  2015-09-07 13:55   ` Tomi Ollila
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2015-09-07 13:33 UTC (permalink / raw)
  To: notmuch

---
 notmuch-count.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/notmuch-count.c b/notmuch-count.c
index 66f5e53..a844384 100644
--- a/notmuch-count.c
+++ b/notmuch-count.c
@@ -117,7 +117,7 @@ count_file (notmuch_database_t *notmuch, FILE *input, const char **exclude_tags,
     size_t line_size;
     int ret = 0;
 
-    while (!ret && (line_len = getline (&line, &line_size, input)) != -1) {
+    while (! ret && (line_len = getline (&line, &line_size, input)) != -1) {
 	chomp_newline (line);
 	ret = print_count (notmuch, line, exclude_tags, exclude_tags_length,
 			   output, print_lastmod);
@@ -189,7 +189,7 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])
 
     notmuch_exit_if_unmatched_db_uuid (notmuch);
 
-    query_str = query_string_from_args (config, argc-opt_index, argv+opt_index);
+    query_str = query_string_from_args (config, argc - opt_index, argv + opt_index);
     if (query_str == NULL) {
 	fprintf (stderr, "Out of memory.\n");
 	return EXIT_FAILURE;
@@ -197,7 +197,7 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])
 
     if (exclude == EXCLUDE_TRUE) {
 	search_exclude_tags = notmuch_config_get_search_exclude_tags
-	    (config, &search_exclude_tags_length);
+				  (config, &search_exclude_tags_length);
     }
 
     if (batch)
-- 
2.5.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] cli/count: apply uncrustify changes
  2015-09-07 13:33 ` [PATCH 2/2] cli/count: apply uncrustify changes David Bremner
@ 2015-09-07 13:55   ` Tomi Ollila
  2015-09-09 17:36     ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Tomi Ollila @ 2015-09-07 13:55 UTC (permalink / raw)
  To: David Bremner, notmuch

On Mon, Sep 07 2015, David Bremner <david@tethera.net> wrote:

> ---
>  notmuch-count.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/notmuch-count.c b/notmuch-count.c
> index 66f5e53..a844384 100644
> --- a/notmuch-count.c
> +++ b/notmuch-count.c
> @@ -117,7 +117,7 @@ count_file (notmuch_database_t *notmuch, FILE *input, const char **exclude_tags,
>      size_t line_size;
>      int ret = 0;
>  
> -    while (!ret && (line_len = getline (&line, &line_size, input)) != -1) {
> +    while (! ret && (line_len = getline (&line, &line_size, input)) != -1) {
>  	chomp_newline (line);
>  	ret = print_count (notmuch, line, exclude_tags, exclude_tags_length,
>  			   output, print_lastmod);
> @@ -189,7 +189,7 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])
>  
>      notmuch_exit_if_unmatched_db_uuid (notmuch);
>  
> -    query_str = query_string_from_args (config, argc-opt_index, argv+opt_index);
> +    query_str = query_string_from_args (config, argc - opt_index, argv + opt_index);
>      if (query_str == NULL) {
>  	fprintf (stderr, "Out of memory.\n");
>  	return EXIT_FAILURE;
> @@ -197,7 +197,7 @@ notmuch_count_command (notmuch_config_t *config, int argc, char *argv[])
>  
>      if (exclude == EXCLUDE_TRUE) {
>  	search_exclude_tags = notmuch_config_get_search_exclude_tags
> -	    (config, &search_exclude_tags_length);
> +				  (config, &search_exclude_tags_length);

With the first 2 uncrustify does a good job, but this last one it disagrees
how emacs(1) indents (and how it is currently indented in other notmuch
source files) -- I'd leave the last (3rd) change out.

Note that in this file uncrustify had a chance to do pretty good job -- in
some other files there are many more changes that need to be post-edited...

Tomi

>      }
>  
>      if (batch)
> -- 
> 2.5.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] cli/count: apply uncrustify changes
  2015-09-07 13:55   ` Tomi Ollila
@ 2015-09-09 17:36     ` David Bremner
  2015-09-09 23:18       ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2015-09-09 17:36 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

Tomi Ollila <tomi.ollila@iki.fi> writes:

>>  
>>      if (exclude == EXCLUDE_TRUE) {
>>  	search_exclude_tags = notmuch_config_get_search_exclude_tags
>> -	    (config, &search_exclude_tags_length);
>> +				  (config, &search_exclude_tags_length);
>
> With the first 2 uncrustify does a good job, but this last one it disagrees
> how emacs(1) indents (and how it is currently indented in other notmuch
> source files) -- I'd leave the last (3rd) change out.

I actually think the uncrustify version is better, but I agree there is
not much point having a standard that isn't easily achievable with
emacs.  After a short struggle trying to understand CC-mode indentation,
I give up.

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] cli/count: apply uncrustify changes
  2015-09-09 17:36     ` David Bremner
@ 2015-09-09 23:18       ` David Bremner
  0 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2015-09-09 23:18 UTC (permalink / raw)
  To: Tomi Ollila, notmuch

David Bremner <david@tethera.net> writes:

> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>>>  
>>>      if (exclude == EXCLUDE_TRUE) {
>>>  	search_exclude_tags = notmuch_config_get_search_exclude_tags
>>> -	    (config, &search_exclude_tags_length);
>>> +				  (config, &search_exclude_tags_length);
>>
>> With the first 2 uncrustify does a good job, but this last one it disagrees
>> how emacs(1) indents (and how it is currently indented in other notmuch
>> source files) -- I'd leave the last (3rd) change out.
>
> I actually think the uncrustify version is better, but I agree there is
> not much point having a standard that isn't easily achievable with
> emacs.  After a short struggle trying to understand CC-mode indentation,
> I give up.

Pushed these two, amended as Tomi suggested.

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-09 23:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-07 13:33 [PATCH 1/2] cli/count: remove unused argument handling for output=modifications David Bremner
2015-09-07 13:33 ` [PATCH 2/2] cli/count: apply uncrustify changes David Bremner
2015-09-07 13:55   ` Tomi Ollila
2015-09-09 17:36     ` David Bremner
2015-09-09 23:18       ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).