Skip to content

Commit

Permalink
rename: Global variables to match their config item
Browse files Browse the repository at this point in the history
Rename lots of constants to match the user-facing config names.
e.g.
    "certificate_file" SslCertFile        -> CertificateFile
    "nm_open_timeout"  NotmuchOpenTimeout -> NmOpenTimeout
  • Loading branch information
flatcap committed Sep 6, 2017
1 parent 5723a28 commit f6208fe
Show file tree
Hide file tree
Showing 50 changed files with 436 additions and 436 deletions.
2 changes: 1 addition & 1 deletion addrbook.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static const char *alias_format_str(char *dest, size_t destlen, size_t col, int

static void alias_entry(char *s, size_t slen, struct Menu *m, int num)
{
mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(AliasFmt), alias_format_str,
mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(AliasFormat), alias_format_str,
(unsigned long) ((struct Alias **) m->data)[num],
MUTT_FORMAT_ARROWCURSOR);
}
Expand Down
10 changes: 5 additions & 5 deletions alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ struct Address *alias_reverse_lookup(struct Address *a)
if (!a || !a->mailbox)
return NULL;

return hash_find(ReverseAlias, a->mailbox);
return hash_find(ReverseAliases, a->mailbox);
}

void mutt_alias_add_reverse(struct Alias *t)
Expand All @@ -477,7 +477,7 @@ void mutt_alias_add_reverse(struct Alias *t)
for (ap = t->addr; ap; ap = ap->next)
{
if (!ap->group && ap->mailbox)
hash_insert(ReverseAlias, ap->mailbox, ap);
hash_insert(ReverseAliases, ap->mailbox, ap);
}
}

Expand All @@ -494,7 +494,7 @@ void mutt_alias_delete_reverse(struct Alias *t)
for (ap = t->addr; ap; ap = ap->next)
{
if (!ap->group && ap->mailbox)
hash_delete(ReverseAlias, ap->mailbox, ap, NULL);
hash_delete(ReverseAliases, ap->mailbox, ap, NULL);
}
}

Expand Down Expand Up @@ -645,9 +645,9 @@ bool mutt_addr_is_user(struct Address *addr)
mutt_debug(5, "mutt_addr_is_user: yes, %s = %s\n", addr->mailbox, Username);
return true;
}
if (string_is_address(addr->mailbox, Username, Hostname))
if (string_is_address(addr->mailbox, Username, ShortHostname))
{
mutt_debug(5, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, Hostname);
mutt_debug(5, "mutt_addr_is_user: yes, %s = %s @ %s \n", addr->mailbox, Username, ShortHostname);
return true;
}
fqdn = mutt_fqdn(0);
Expand Down
4 changes: 2 additions & 2 deletions attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
if ((mutt_strcasecmp("text/plain", type) == 0) ||
(mutt_strcasecmp("application/postscript", type) == 0))
{
return (mutt_pipe_attachment(fp, a, NONULL(PrintCmd), NULL));
return (mutt_pipe_attachment(fp, a, NONULL(PrintCommand), NULL));
}
else if (mutt_can_decode(a))
{
Expand All @@ -1074,7 +1074,7 @@ int mutt_print_attachment(FILE *fp, struct Body *a)
mutt_debug(2, "successfully opened %s read-only\n", newfile);

mutt_endwin(NULL);
if ((thepid = mutt_create_filter(NONULL(PrintCmd), &fpout, NULL, NULL)) < 0)
if ((thepid = mutt_create_filter(NONULL(PrintCommand), &fpout, NULL, NULL)) < 0)
{
mutt_perror(_("Can't create filter"));
goto bail0;
Expand Down
56 changes: 28 additions & 28 deletions browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ static int browser_compare_subject(const void *a, const void *b)
int r = mutt_inbox_cmp(pa->name, pb->name);
if (r == 0)
r = mutt_strcoll(pa->name, pb->name);
return ((BrowserSort & SORT_REVERSE) ? -r : r);
return ((SortBrowser & SORT_REVERSE) ? -r : r);
}

static int browser_compare_desc(const void *a, const void *b)
Expand All @@ -144,7 +144,7 @@ static int browser_compare_desc(const void *a, const void *b)

int r = mutt_strcoll(pa->desc, pb->desc);

return ((BrowserSort & SORT_REVERSE) ? -r : r);
return ((SortBrowser & SORT_REVERSE) ? -r : r);
}

static int browser_compare_date(const void *a, const void *b)
Expand All @@ -154,7 +154,7 @@ static int browser_compare_date(const void *a, const void *b)

int r = pa->mtime - pb->mtime;

return ((BrowserSort & SORT_REVERSE) ? -r : r);
return ((SortBrowser & SORT_REVERSE) ? -r : r);
}

static int browser_compare_size(const void *a, const void *b)
Expand All @@ -164,7 +164,7 @@ static int browser_compare_size(const void *a, const void *b)

int r = pa->size - pb->size;

return ((BrowserSort & SORT_REVERSE) ? -r : r);
return ((SortBrowser & SORT_REVERSE) ? -r : r);
}

static int browser_compare_count(const void *a, const void *b)
Expand All @@ -180,7 +180,7 @@ static int browser_compare_count(const void *a, const void *b)
else
r = 1;

return ((BrowserSort & SORT_REVERSE) ? -r : r);
return ((SortBrowser & SORT_REVERSE) ? -r : r);
}

static int browser_compare_count_new(const void *a, const void *b)
Expand All @@ -196,7 +196,7 @@ static int browser_compare_count_new(const void *a, const void *b)
else
r = 1;

return ((BrowserSort & SORT_REVERSE) ? -r : r);
return ((SortBrowser & SORT_REVERSE) ? -r : r);
}

/**
Expand All @@ -216,7 +216,7 @@ static int browser_compare(const void *a, const void *b)
if ((mutt_strcoll(pb->desc, "../") == 0) || (mutt_strcoll(pb->desc, "..") == 0))
return 1;

switch (BrowserSort & SORT_MASK)
switch (SortBrowser & SORT_MASK)
{
case SORT_DATE:
return browser_compare_date(a, b);
Expand All @@ -242,7 +242,7 @@ static int browser_compare(const void *a, const void *b)
*/
static void browser_sort(struct BrowserState *state)
{
switch (BrowserSort & SORT_MASK)
switch (SortBrowser & SORT_MASK)
{
/* Also called "I don't care"-sort-method. */
case SORT_ORDER:
Expand Down Expand Up @@ -301,7 +301,7 @@ static const char *folder_format_str(char *dest, size_t destlen, size_t col, int

if (op == 'D')
{
t_fmt = NONULL(DateFmt);
t_fmt = NONULL(DateFormat);
if (*t_fmt == '!')
{
t_fmt++;
Expand Down Expand Up @@ -902,7 +902,7 @@ static void folder_entry(char *s, size_t slen, struct Menu *menu, int num)

#ifdef USE_NNTP
if (option(OPT_NEWS))
mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(GroupFormat), newsgroup_format_str,
mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(GroupIndexFormat), newsgroup_format_str,
(unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
else
#endif
Expand All @@ -918,7 +918,7 @@ static void vfolder_entry(char *s, size_t slen, struct Menu *menu, int num)
folder.ff = &((struct FolderFile *) menu->data)[num];
folder.num = num;

mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(VirtFolderFormat),
mutt_expando_format(s, slen, 0, MuttIndexWindow->cols, NONULL(VfolderFormat),
folder_format_str, (unsigned long) &folder, MUTT_FORMAT_ARROWCURSOR);
}
#endif
Expand Down Expand Up @@ -1079,7 +1079,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf
int buffy = (flags & MUTT_SEL_BUFFY) ? 1 : 0;

/* Keeps in memory the directory we were in when hitting '='
* to go directly to $folder (Maildir)
* to go directly to $folder (Folder)
*/
char GotoSwapper[_POSIX_PATH_MAX] = "";

Expand Down Expand Up @@ -1179,7 +1179,7 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf
*/
short browser_track;

switch (BrowserSort & SORT_MASK)
switch (SortBrowser & SORT_MASK)
{
case SORT_DESC:
case SORT_SUBJECT:
Expand Down Expand Up @@ -1221,8 +1221,8 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf
case MUTT_MH:
case MUTT_MAILDIR:
case MUTT_IMAP:
if (Maildir)
strfcpy(LastDir, NONULL(Maildir), sizeof(LastDir));
if (Folder)
strfcpy(LastDir, NONULL(Folder), sizeof(LastDir));
else if (SpoolFile)
mutt_browser_select_dir(SpoolFile);
break;
Expand Down Expand Up @@ -1761,37 +1761,37 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf
break;

case 1: /* (d)ate */
BrowserSort = SORT_DATE;
SortBrowser = SORT_DATE;
break;

case 2: /* (a)lpha */
BrowserSort = SORT_SUBJECT;
SortBrowser = SORT_SUBJECT;
break;

case 3: /* si(z)e */
BrowserSort = SORT_SIZE;
SortBrowser = SORT_SIZE;
break;

case 4: /* d(e)scription */
BrowserSort = SORT_DESC;
SortBrowser = SORT_DESC;
break;

case 5: /* (c)ount */
BrowserSort = SORT_COUNT;
SortBrowser = SORT_COUNT;
break;

case 6: /* ne(w) count */
BrowserSort = SORT_UNREAD;
SortBrowser = SORT_UNREAD;
break;

case 7: /* do(n)'t sort */
BrowserSort = SORT_ORDER;
SortBrowser = SORT_ORDER;
resort = 0;
break;
}
if (resort)
{
BrowserSort |= reverse ? SORT_REVERSE : 0;
SortBrowser |= reverse ? SORT_REVERSE : 0;
browser_sort(&state);
browser_highlight_default(&state, menu);
menu->redraw = REDRAW_FULL;
Expand All @@ -1808,17 +1808,17 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf
if (i == OP_BROWSER_GOTO_FOLDER)
{
/* When in mailboxes mode, disables this feature */
if (Maildir)
if (Folder)
{
mutt_debug(5, "= hit! Maildir: %s, LastDir: %s\n", Maildir, LastDir);
mutt_debug(5, "= hit! Folder: %s, LastDir: %s\n", Folder, LastDir);
if (!GotoSwapper[0])
{
if (mutt_strcmp(LastDir, Maildir) != 0)
if (mutt_strcmp(LastDir, Folder) != 0)
{
/* Stores into GotoSwapper LastDir, and swaps to Maildir */
/* Stores into GotoSwapper LastDir, and swaps to Folder */
strfcpy(GotoSwapper, LastDir, sizeof(GotoSwapper));
strfcpy(OldLastDir, LastDir, sizeof(OldLastDir));
strfcpy(LastDir, Maildir, sizeof(LastDir));
strfcpy(LastDir, Folder, sizeof(LastDir));
}
}
else
Expand Down
6 changes: 3 additions & 3 deletions buffy.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ int mutt_parse_unmailboxes(struct Buffer *path, struct Buffer *s,
* mutt_buffy_check - Check all Incoming for new mail
*
* Check all Incoming for new mail and total/new/flagged messages
* force: if true, ignore BuffyTimeout and check for new mail anyway
* force: if true, ignore MailCheck and check for new mail anyway
*/
int mutt_buffy_check(bool force)
{
Expand All @@ -703,10 +703,10 @@ int mutt_buffy_check(bool force)
return 0;

t = time(NULL);
if (!force && (t - BuffyTime < BuffyTimeout))
if (!force && (t - BuffyTime < MailCheck))
return BuffyCount;

if (option(OPT_MAIL_CHECK_STATS) && (t - BuffyStatsTime >= BuffyCheckStatsInterval))
if (option(OPT_MAIL_CHECK_STATS) && (t - BuffyStatsTime >= MailCheckStatsInterval))
{
check_stats = true;
BuffyStatsTime = t;
Expand Down
4 changes: 2 additions & 2 deletions buffy.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ struct Buffy
};

WHERE struct Buffy *Incoming;
WHERE short BuffyTimeout;
WHERE short BuffyCheckStatsInterval;
WHERE short MailCheck;
WHERE short MailCheckStatsInterval;

#ifdef USE_NOTMUCH
void mutt_buffy_vfolder(char *s, size_t slen);
Expand Down
6 changes: 3 additions & 3 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int mutt_display_message(struct Header *cur)
hfi.pager_progress = ExtPagerProgress;
hfi.hdr = cur;
mutt_make_string_info(buf, sizeof(buf), MuttIndexWindow->cols,
NONULL(PagerFmt), &hfi, MUTT_FORMAT_MAKEPRINT);
NONULL(PagerFormat), &hfi, MUTT_FORMAT_MAKEPRINT);
fputs(buf, fpout);
fputs("\n\n", fpout);
}
Expand Down Expand Up @@ -508,7 +508,7 @@ void mutt_pipe_message(struct Header *h)

void mutt_print_message(struct Header *h)
{
if (quadoption(OPT_PRINT) && (!PrintCmd || !*PrintCmd))
if (quadoption(OPT_PRINT) && (!PrintCommand || !*PrintCommand))
{
mutt_message(_("No printing command has been defined."));
return;
Expand All @@ -518,7 +518,7 @@ void mutt_print_message(struct Header *h)
h ? _("Print message?") : _("Print tagged messages?")) != MUTT_YES)
return;

if (_mutt_pipe_message(h, PrintCmd, option(OPT_PRINT_DECODE), 1,
if (_mutt_pipe_message(h, PrintCommand, option(OPT_PRINT_DECODE), 1,
option(OPT_PRINT_SPLIT), "\f") == 0)
mutt_message(h ? _("Message printed") : _("Messages printed"));
else
Expand Down
4 changes: 2 additions & 2 deletions complete.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int mutt_complete(char *s, size_t slen)
if (*s == '!')
p = NONULL(SpoolFile);
else
p = NONULL(Maildir);
p = NONULL(Folder);

mutt_concat_path(imap_path, p, s + 1, sizeof(imap_path));
}
Expand All @@ -147,7 +147,7 @@ int mutt_complete(char *s, size_t slen)
if (*s == '!')
strfcpy(exp_dirpart, NONULL(SpoolFile), sizeof(exp_dirpart));
else
strfcpy(exp_dirpart, NONULL(Maildir), sizeof(exp_dirpart));
strfcpy(exp_dirpart, NONULL(Folder), sizeof(exp_dirpart));
if ((p = strrchr(s, '/')))
{
char buf[_POSIX_PATH_MAX];
Expand Down
8 changes: 4 additions & 4 deletions compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,13 @@ static void redraw_crypt_lines(struct Header *msg)
}

if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME) &&
(msg->security & ENCRYPT) && SmimeCryptAlg && *SmimeCryptAlg)
(msg->security & ENCRYPT) && SmimeEncryptWith && *SmimeEncryptWith)
{
SETCOLOR(MT_COLOR_COMPOSE_HEADER);
mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPTINFO, 40, "%s",
_("Encrypt with: "));
NORMAL_COLOR;
printw("%s", NONULL(SmimeCryptAlg));
printw("%s", NONULL(SmimeEncryptWith));
}
}

Expand Down Expand Up @@ -686,7 +686,7 @@ static unsigned long cum_attachs_size(struct Menu *menu)
* compose_format_str - Format strings like printf()
*
* * \%a Total number of attachments
* * \%h Hostname [option]
* * \%h ShortHostname [option]
* * \%l Approx. length of current message (in bytes)
* * \%v Mutt version
*
Expand All @@ -712,7 +712,7 @@ static const char *compose_format_str(char *buf, size_t buflen, size_t col, int

case 'h': /* hostname */
snprintf(fmt, sizeof(fmt), "%%%ss", prefix);
snprintf(buf, buflen, fmt, NONULL(Hostname));
snprintf(buf, buflen, fmt, NONULL(ShortHostname));
break;

case 'l': /* approx length of current message in bytes */
Expand Down
2 changes: 1 addition & 1 deletion compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ static int comp_open_append_mailbox(struct Context *ctx, int flags)
ctx->magic = mx_get_magic(ctx->path);
}
else
ctx->magic = DefaultMagic;
ctx->magic = MboxType;

/* We can only deal with mbox and mmdf mailboxes */
if ((ctx->magic != MUTT_MBOX) && (ctx->magic != MUTT_MMDF))
Expand Down
2 changes: 1 addition & 1 deletion copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ int _mutt_copy_message(FILE *fpout, FILE *fpin, struct Header *hdr,
if (option(OPT_TEXT_FLOWED))
strfcpy(prefix, ">", sizeof(prefix));
else
_mutt_make_string(prefix, sizeof(prefix), NONULL(Prefix), Context, hdr, 0);
_mutt_make_string(prefix, sizeof(prefix), NONULL(IndentString), Context, hdr, 0);
}

if (hdr->xlabel_changed)
Expand Down
Loading

0 comments on commit f6208fe

Please sign in to comment.