From fd1eea6dba6822d821f16ecd3bb1cbfd6ab48ae3 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Wed, 28 Mar 2018 23:21:56 +0100 Subject: [PATCH] tidy comments / docs --- README.md | 3 ++- buffy.c | 7 +++---- color.c | 8 ++++---- commands.c | 2 +- compose.c | 11 +++++++---- conn/ssl.c | 4 ++-- envelope.c | 2 +- handler.c | 8 ++++---- hdrline.c | 37 +++++++++++++++++++------------------ imap/imap.c | 4 ---- init.c | 14 +++++++------- init.h | 32 ++++++++++++++++---------------- ncrypt/pgp.c | 4 ++-- postpone.c | 8 ++++---- smtp.c | 6 +++--- tags.c | 16 ---------------- 16 files changed, 75 insertions(+), 91 deletions(-) diff --git a/README.md b/README.md index cf0e14e3c..b148976d9 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,9 @@ [![Contributors](https://img.shields.io/badge/Contributors-115-orange.svg)](#contributors) [![Release](https://img.shields.io/github/release/neomutt/neomutt.svg)](https://github.com/neomutt/neomutt/releases/latest "Latest Release Notes") [![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://github.com/neomutt/neomutt/blob/master/COPYRIGHT) -[![Travis branch](https://api.travis-ci.org/neomutt/neomutt.svg?branch=neomutt)](https://travis-ci.org/neomutt/neomutt) +[![Code build](https://img.shields.io/travis/neomutt/neomutt.svg?label=code)](https://travis-ci.org/neomutt/neomutt) [![Coverity Scan](https://img.shields.io/coverity/scan/8495.svg)](https://scan.coverity.com/projects/neomutt-neomutt) +[![Website build](https://img.shields.io/travis/neomutt/neomutt.github.io.svg?label=website)](https://travis-ci.org/neomutt/neomutt.github.io) ## What is NeoMutt? diff --git a/buffy.c b/buffy.c index f24cc0139..eed86a405 100644 --- a/buffy.c +++ b/buffy.c @@ -383,8 +383,8 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st if (stat(tmp->path, &sb) != 0 || (S_ISREG(sb.st_mode) && sb.st_size == 0) || (!tmp->magic && (tmp->magic = mx_get_magic(tmp->path)) <= 0)) { - /* if the mailbox still doesn't exist, set the newly created flag to - * be ready for when it does. */ + /* if the mailbox still doesn't exist, set the newly created flag to be + * ready for when it does. */ tmp->newly_created = true; tmp->magic = 0; tmp->size = 0; @@ -392,8 +392,7 @@ static void buffy_check(struct Buffy *tmp, struct stat *contex_sb, bool check_st } } - /* check to see if the folder is the currently selected folder - * before polling */ + /* check to see if the folder is the currently selected folder before polling */ if (!Context || !Context->path || ((tmp->magic == MUTT_IMAP || #ifdef USE_NNTP diff --git a/color.c b/color.c index c4fdca841..e665cd798 100644 --- a/color.c +++ b/color.c @@ -891,10 +891,10 @@ static int parse_color(struct Buffer *buf, struct Buffer *s, struct Buffer *err, && (fg == COLOR_DEFAULT || bg == COLOR_DEFAULT || object == MT_COLOR_TREE) && use_default_colors() != OK) /* the case of the tree object is special, because a non-default - * fg color of the tree element may be combined dynamically with - * the default bg color of an index line, not necessarily defined in - * a rc file. - */ + * fg color of the tree element may be combined dynamically with + * the default bg color of an index line, not necessarily defined in + * a rc file. + */ { mutt_str_strfcpy(err->data, _("default colors not supported"), err->dsize); return -1; diff --git a/commands.c b/commands.c index 9a5d83917..52e8ee2e5 100644 --- a/commands.c +++ b/commands.c @@ -260,7 +260,7 @@ void ci_bounce_message(struct Header *h) int rc; /* RFC5322 mandates a From: header, so warn before bouncing - * messages without one */ + * messages without one */ if (h) { if (!h->env->from) diff --git a/compose.c b/compose.c index 8a4176225..81cfe3c71 100644 --- a/compose.c +++ b/compose.c @@ -760,14 +760,17 @@ static void compose_status_line(char *buf, size_t buflen, size_t col, int cols, /** * mutt_compose_menu - Allow the user to edit the message envelope + * @param msg Message to fill + * @param fcc Buffer to save FCC + * @param fcclen Length of FCC buffer + * @param cur Current message + * @param flags Flags, e.g. #MUTT_COMPOSE_NOFREEHEADER * @retval 1 Message should be postponed * @retval 0 Normal exit * @retval -1 Abort message */ -int mutt_compose_menu(struct Header *msg, /* structure for new message */ - char *fcc, /* where to save a copy of the message */ - size_t fcclen, struct Header *cur, /* current message */ - int flags) +int mutt_compose_menu(struct Header *msg, char *fcc, size_t fcclen, + struct Header *cur, int flags) { char helpstr[LONG_STRING]; char buf[LONG_STRING]; diff --git a/conn/ssl.c b/conn/ssl.c index f6d8abcaf..5b44e6d07 100644 --- a/conn/ssl.c +++ b/conn/ssl.c @@ -479,8 +479,8 @@ static bool compare_certificates(X509 *cert, X509 *peercert, unsigned int mdlen; /* Avoid CPU-intensive digest calculation if the certificates are - * not even remotely equal. - */ + * not even remotely equal. + */ if (X509_subject_name_cmp(cert, peercert) != 0 || X509_issuer_name_cmp(cert, peercert) != 0) return false; diff --git a/envelope.c b/envelope.c index eb490403f..0218fae45 100644 --- a/envelope.c +++ b/envelope.c @@ -146,7 +146,7 @@ void mutt_env_merge(struct Envelope *base, struct Envelope **extra) (*extra)->disp_subj = NULL; } /* spam and user headers should never be hashed, and the new envelope may - * have better values. Use new versions regardless. */ + * have better values. Use new versions regardless. */ mutt_buffer_free(&base->spam); mutt_list_free(&base->userhdrs); MOVE_ELEM(spam); diff --git a/handler.c b/handler.c index aab324528..b7bf84f43 100644 --- a/handler.c +++ b/handler.c @@ -1685,14 +1685,14 @@ static int run_decode_and_handler(struct Body *b, struct State *s, } #endif /* decoding the attachment changes the size and offset, so save a copy - * of the "real" values now, and restore them after processing - */ + * of the "real" values now, and restore them after processing + */ tmplength = b->length; tmpoffset = b->offset; /* if we are decoding binary bodies, we don't want to prefix each - * line with the prefix or else the data will get corrupted. - */ + * line with the prefix or else the data will get corrupted. + */ save_prefix = s->prefix; s->prefix = NULL; diff --git a/hdrline.c b/hdrline.c index 4e77975d7..11c5f4b87 100644 --- a/hdrline.c +++ b/hdrline.c @@ -422,47 +422,48 @@ static bool thread_is_old(struct Context *ctx, struct Header *hdr) * * | Expando | Description * |:--------|:----------------------------------------------------------------- - * | \%a | Address of author - * | \%A | Reply-to address (if present; otherwise: address of author - * | \%b | Filename of the originating folder + * | \%a | Address of the author + * | \%A | Reply-to address (if present; otherwise: address of author) + * | \%b | Filename of the original message folder (think mailbox) * | \%B | The list to which the letter was sent, or else the folder name (%b). * | \%C | Current message number - * | \%c | Size of message in bytes + * | \%c | Number of characters (bytes) in the message * | \%D | Date and time of message using $date_format and local timezone * | \%d | Date and time of message using $date_format and sender's timezone * | \%e | Current message number in thread * | \%E | Number of messages in current thread - * | \%f | Entire from line - * | \%F | Like %n, unless from self + * | \%F | Author name, or recipient name if the message is from you + * | \%f | Sender (address + real name), either From: or Return-Path: + * | \%g | Newsgroup name (if compiled with NNTP support) * | \%g | Message tags (e.g. notmuch tags/imap flags) * | \%Gx | Individual message tag (e.g. notmuch tags/imap flags) * | \%H | Spam attribute(s) of this message * | \%I | Initials of author - * | \%i | Message-id + * | \%i | Message-id of the current message * | \%J | Message tags (if present, tree unfolded, and != parent's tags) * | \%K | The list to which the letter was sent (if any; otherwise: empty) * | \%L | Like %F, except 'lists' are displayed first * | \%l | Number of lines in the message * | \%M | Number of hidden messages if the thread is collapsed - * | \%m | Number of messages in the mailbox - * | \%n | Name of author - * | \%N | Score + * | \%m | Total number of message in the mailbox + * | \%N | Message score + * | \%n | Author's real name (or address if missing) * | \%O | Like %L, except using address instead of name - * | \%P | Progress indicator for builtin pager + * | \%P | Progress indicator for the built-in pager (how much of the file has been displayed) * | \%q | Newsgroup name (if compiled with NNTP support) * | \%R | Comma separated list of Cc: recipients * | \%r | Comma separated list of To: recipients - * | \%S | Short message status (e.g., N/O/D/!/r/-) - * | \%s | Subject - * | \%T | $to_chars + * | \%S | Single character status of the message (N/O/D/d/!/r/-) + * | \%s | Subject of the message + * | \%T | The appropriate character from the $$to_chars string * | \%t | 'To:' field (recipients) - * | \%u | User (login) name of author - * | \%v | First name of author, unless from self - * | \%W | Where user is (organization) + * | \%u | User (login) name of the author + * | \%v | First name of the author, or the recipient if the message is from you + * | \%W | Name of organization of author ('Organization:' field) * | \%x | 'X-Comment-To:' field (if present and compiled with NNTP support) * | \%X | Number of MIME attachments - * | \%y | 'X-Label:' field (if present) * | \%Y | 'X-Label:' field (if present, tree unfolded, and != parent's x-label) + * | \%y | 'X-Label:' field (if present) * | \%Z | Combined message flags * | \%zc | Message crypto flags * | \%zs | Message status flags diff --git a/imap/imap.c b/imap/imap.c index 12b458a50..ca7d19682 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -26,10 +26,6 @@ * @page imap_imap IMAP network mailbox * * Support for IMAP4rev1, with the occasional nod to IMAP 4. - * - * | Data | Description - * | :----------- | :------------------------- - * | #mx_imap_ops | Mailbox callback functions */ #include "config.h" diff --git a/init.c b/init.c index d6c3bb2e1..a3d12925d 100644 --- a/init.c +++ b/init.c @@ -447,7 +447,7 @@ int mutt_option_set(const struct Option *val, struct Buffer *err) mutt_str_strfcpy(scratch, NONULL((const char *) val->var), sizeof(scratch)); mutt_expand_path(scratch, sizeof(scratch)); /* MuttVars[idx].var is already 'char**' (or some 'void**') or... - * so cast to 'void*' is okay */ + * so cast to 'void*' is okay */ FREE((void *) MuttVars[idx].var); *((char **) MuttVars[idx].var) = mutt_str_strdup(scratch); break; @@ -455,7 +455,7 @@ int mutt_option_set(const struct Option *val, struct Buffer *err) case DT_STRING: { /* MuttVars[idx].var is already 'char**' (or some 'void**') or... - * so cast to 'void*' is okay */ + * so cast to 'void*' is okay */ FREE((void *) MuttVars[idx].var); *((char **) MuttVars[idx].var) = mutt_str_strdup((char *) val->var); } @@ -3073,7 +3073,7 @@ int mutt_command_complete(char *buffer, size_t len, int pos, int numtabs) return 0; /* NumMatched will _always_ be at least 1 since the initial - * user-typed string is always stored */ + * user-typed string is always stored */ if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) @@ -3378,8 +3378,8 @@ bool mutt_nm_tag_complete(char *buffer, size_t len, int numtabs) complete_all_nm_tags(pt); /* All matches are stored. Longest non-ambiguous string is "" - * i.e. don't change 'buffer'. Fake successful return this time. - */ + * i.e. don't change 'buffer'. Fake successful return this time. + */ if (UserTyped[0] == 0) return true; } @@ -3388,7 +3388,7 @@ bool mutt_nm_tag_complete(char *buffer, size_t len, int numtabs) return false; /* NumMatched will _always_ be at least 1 since the initial - * user-typed string is always stored */ + * user-typed string is always stored */ if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) @@ -4242,7 +4242,7 @@ int mutt_label_complete(char *buffer, size_t len, int numtabs) return 0; /* NumMatched will _always_ be at least 1 since the initial - * user-typed string is always stored */ + * user-typed string is always stored */ if (numtabs == 1 && NumMatched == 2) snprintf(Completed, sizeof(Completed), "%s", Matches[0]); else if (numtabs > 1 && NumMatched > 2) diff --git a/init.h b/init.h index 07bfee1cf..3c13f4501 100644 --- a/init.h +++ b/init.h @@ -1536,29 +1536,29 @@ struct Option MuttVars[] = { ** .dt %A .dd Reply-to address (if present; otherwise: address of author) ** .dt %b .dd Filename of the original message folder (think mailbox) ** .dt %B .dd The list to which the letter was sent, or else the folder name (%b). - ** .dt %c .dd Number of characters (bytes) in the message ** .dt %C .dd Current message number - ** .dt %d .dd Date and time of the message in the format specified by - ** $$date_format converted to sender's time zone - ** .dt %D .dd Date and time of the message in the format specified by - ** $$date_format converted to the local time zone + ** .dt %c .dd Number of characters (bytes) in the message + ** .dt %D .dd Date and time of message using $date_format and local timezone + ** .dt %d .dd Date and time of message using $date_format and sender's timezone ** .dt %e .dd Current message number in thread ** .dt %E .dd Number of messages in current thread - ** .dt %f .dd Sender (address + real name), either From: or Return-Path: ** .dt %F .dd Author name, or recipient name if the message is from you + ** .dt %f .dd Sender (address + real name), either From: or Return-Path: ** .dt %g .dd Newsgroup name (if compiled with NNTP support) - ** .dt %g .dd Message labels (e.g. notmuch tags) + ** .dt %g .dd Message tags (e.g. notmuch tags/imap flags) + ** .dt %Gx .dd Individual message tag (e.g. notmuch tags/imap flags) ** .dt %H .dd Spam attribute(s) of this message ** .dt %I .dd Initials of author ** .dt %i .dd Message-id of the current message + ** .dt %J .dd Message tags (if present, tree unfolded, and != parent's tags) ** .dt %K .dd The list to which the letter was sent (if any; otherwise: empty) - ** .dt %l .dd Number of lines in the message (does not work with maildir, - ** Mh, and possibly IMAP folders) ** .dt %L .dd If an address in the ``To:'' or ``Cc:'' header field matches an address ** Defined by the users ``$subscribe'' command, this displays ** "To ", otherwise the same as %F - ** .dt %m .dd Total number of message in the mailbox + ** .dt %l .dd Number of lines in the message (does not work with maildir, + ** Mh, and possibly IMAP folders) ** .dt %M .dd Number of hidden messages if the thread is collapsed + ** .dt %m .dd Total number of message in the mailbox ** .dt %N .dd Message score ** .dt %n .dd Author's real name (or address if missing) ** .dt %O .dd Original save folder where NeoMutt would formerly have @@ -1566,29 +1566,29 @@ struct Option MuttVars[] = { ** If not sent to a list ** .dt %P .dd Progress indicator for the built-in pager (how much of the file has been displayed) ** .dt %q .dd Newsgroup name (if compiled with NNTP support) - ** .dt %r .dd Comma separated list of ``To:'' recipients ** .dt %R .dd Comma separated list of ``Cc:'' recipients - ** .dt %s .dd Subject of the message + ** .dt %r .dd Comma separated list of ``To:'' recipients ** .dt %S .dd Single character status of the message (``N''/``O''/``D''/``d''/``!''/``r''/``\(as'') - ** .dt %t .dd ``To:'' field (recipients) + ** .dt %s .dd Subject of the message ** .dt %T .dd The appropriate character from the $$to_chars string + ** .dt %t .dd ``To:'' field (recipients) ** .dt %u .dd User (login) name of the author ** .dt %v .dd First name of the author, or the recipient if the message is from you ** .dt %W .dd Name of organization of author (``Organization:'' field) ** .dt %x .dd ``X-Comment-To:'' field (if present and compiled with NNTP support) - ** .dt %X .dd Number of attachments + ** .dt %X .dd Number of MIME attachments ** (please see the ``$attachments'' section for possible speed effects) - ** .dt %y .dd ``X-Label:'' field, if present ** .dt %Y .dd ``X-Label:'' field, if present, and \fI(1)\fP not at part of a thread tree, ** \fI(2)\fP at the top of a thread, or \fI(3)\fP ``X-Label:'' is different from ** Preceding message's ``X-Label:'' + ** .dt %y .dd ``X-Label:'' field, if present ** .dt %Z .dd A three character set of message status flags. ** The first character is new/read/replied flags (``n''/``o''/``r''/``O''/``N''). ** The second is deleted or encryption flags (``D''/``d''/``S''/``P''/``s''/``K''). ** The third is either tagged/flagged (``\(as''/``!''), or one of the characters ** Listed in $$to_chars. - ** .dt %zs .dd Message status flags ** .dt %zc .dd Message crypto flags + ** .dt %zs .dd Message status flags ** .dt %zt .dd Message tag flags ** .dt %{fmt} .dd the date and time of the message is converted to sender's ** time zone, and ``fmt'' is expanded by the library function diff --git a/ncrypt/pgp.c b/ncrypt/pgp.c index c1e0e5c4c..72e63ff35 100644 --- a/ncrypt/pgp.c +++ b/ncrypt/pgp.c @@ -1720,8 +1720,8 @@ int pgp_send_menu(struct Header *msg) else if (CryptOpportunisticEncrypt) { /* When the message is not selected for signing or encryption, the toggle - * between PGP/MIME and Traditional doesn't make sense. - */ + * between PGP/MIME and Traditional doesn't make sense. + */ if (msg->security & (ENCRYPT | SIGN)) { snprintf(promptbuf, sizeof(promptbuf), diff --git a/postpone.c b/postpone.c index 01e658f68..132196c09 100644 --- a/postpone.c +++ b/postpone.c @@ -348,10 +348,10 @@ int mutt_get_postponed(struct Context *ctx, struct Header *hdr, mutt_pretty_mailbox(fcc, fcclen); /* note that x-mutt-fcc was present. we do this because we want to add a - * default fcc if the header was missing, but preserve the request of the - * user to not make a copy if the header field is present, but empty. - * see http://dev.mutt.org/trac/ticket/3653 - */ + * default fcc if the header was missing, but preserve the request of the + * user to not make a copy if the header field is present, but empty. + * see http://dev.mutt.org/trac/ticket/3653 + */ code |= SENDPOSTPONEDFCC; } else if (((WithCrypto & APPLICATION_PGP) != 0) && diff --git a/smtp.c b/smtp.c index 7f8b05a59..09279170d 100644 --- a/smtp.c +++ b/smtp.c @@ -346,9 +346,9 @@ static int smtp_helo(struct Connection *conn) snprintf(buf, sizeof(buf), "%s %s\r\n", Esmtp ? "EHLO" : "HELO", fqdn); /* XXX there should probably be a wrapper in mutt_socket.c that - * repeatedly calls conn->write until all data is sent. This - * currently doesn't check for a short write. - */ + * repeatedly calls conn->write until all data is sent. This + * currently doesn't check for a short write. + */ if (mutt_socket_write(conn, buf) == -1) return SMTP_ERR_WRITE; return smtp_get_resp(conn); diff --git a/tags.c b/tags.c index 8c71b2173..1c401ea9e 100644 --- a/tags.c +++ b/tags.c @@ -24,22 +24,6 @@ * @page tags Driver based email tags * * Driver based email tags - * - * | Data | Description - * | :------------- | :-------------------------------------------------- - * | #HiddenTags | Private tags which should not be displayed - * | #TagTransforms | Lookup table of alternative tag names - * - * | Function | Description - * | :-------------------------------- | :----------------------------------------------- - * | driver_tags_free() | Free tags from a header - * | driver_tags_getter() | Get transformed tags - * | driver_tags_get_transformed() | Get transformed tags - * | driver_tags_get() | Get tags - * | driver_tags_get_with_hidden() | Get tags with hiddens - * | driver_tags_get_transformed_for() | Get transformed tag for a tag name from a header - * | driver_tags_add() | Add a tag to header - * | driver_tags_replace() | Replace all tags */ #include "config.h" -- 2.40.0