Skip to content

Commit

Permalink
rename: OPT_* 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.
    "forward_decode"   OPT_FORW_DECODE       -> OPT_FORWARD_DECODE
    "imap_servernoise" OPT_IMAP_SERVER_NOISE -> OPT_IMAP_SERVERNOISE
  • Loading branch information
flatcap committed Sep 6, 2017
1 parent 0e8dcce commit 5723a28
Show file tree
Hide file tree
Showing 45 changed files with 343 additions and 343 deletions.
6 changes: 3 additions & 3 deletions browser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1505,10 +1505,10 @@ void _mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numf

#ifdef USE_IMAP
case OP_BROWSER_TOGGLE_LSUB:
if (option(OPT_IMAP_LSUB))
unset_option(OPT_IMAP_LSUB);
if (option(OPT_IMAP_LIST_SUBSCRIBED))
unset_option(OPT_IMAP_LIST_SUBSCRIBED);
else
set_option(OPT_IMAP_LSUB);
set_option(OPT_IMAP_LIST_SUBSCRIBED);

mutt_unget_event(0, OP_CHECK_NEW);
break;
Expand Down
2 changes: 1 addition & 1 deletion commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ int mutt_display_message(struct Header *cur)
else if (cur->security & SIGN)
{
/* find out whether or not the verify signature */
if (query_quadoption(OPT_VERIFY_SIG, _("Verify PGP signature?")) == MUTT_YES)
if (query_quadoption(OPT_CRYPT_VERIFY_SIG, _("Verify PGP signature?")) == MUTT_YES)
{
cmflags |= MUTT_CM_VERIFY;
}
Expand Down
8 changes: 4 additions & 4 deletions compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static void draw_envelope(struct Header *msg, char *fcc)
mutt_window_mvprintw(MuttIndexWindow, HDR_CC, 0, "%*s",
HeaderPadding[HDR_FOLLOWUPTO], Prompts[HDR_FOLLOWUPTO]);
mutt_paddstr(W, NONULL(msg->env->followup_to));
if (option(OPT_XCOMMENT_TO))
if (option(OPT_X_COMMENT_TO))
{
mutt_window_mvprintw(MuttIndexWindow, HDR_BCC, 0, "%*s",
HeaderPadding[HDR_XCOMMENTTO], Prompts[HDR_XCOMMENTTO]);
Expand Down Expand Up @@ -894,7 +894,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
}
break;
case OP_COMPOSE_EDIT_X_COMMENT_TO:
if (news && option(OPT_XCOMMENT_TO))
if (news && option(OPT_X_COMMENT_TO))
{
if (msg->env->x_comment_to)
strfcpy(buf, msg->env->x_comment_to, sizeof(buf));
Expand Down Expand Up @@ -945,7 +945,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
mutt_message_hook(NULL, msg, MUTT_SEND2HOOK);
break;
case OP_COMPOSE_EDIT_MESSAGE:
if (Editor && (mutt_strcmp("builtin", Editor) != 0) && !option(OPT_EDIT_HDRS))
if (Editor && (mutt_strcmp("builtin", Editor) != 0) && !option(OPT_EDIT_HEADERS))
{
mutt_edit_file(Editor, msg->content->filename);
mutt_update_encoding(msg->content);
Expand All @@ -957,7 +957,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */
case OP_COMPOSE_EDIT_HEADERS:
if ((mutt_strcmp("builtin", Editor) != 0) &&
(op == OP_COMPOSE_EDIT_HEADERS ||
(op == OP_COMPOSE_EDIT_MESSAGE && option(OPT_EDIT_HDRS))))
(op == OP_COMPOSE_EDIT_MESSAGE && option(OPT_EDIT_HEADERS))))
{
char *tag = NULL, *err = NULL;
mutt_env_to_local(msg->env);
Expand Down
6 changes: 3 additions & 3 deletions curs_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct Event mutt_getch(void)
return timeout;
}

if ((ch & 0x80) && option(OPT_METAKEY))
if ((ch & 0x80) && option(OPT_META_KEY))
{
/* send ALT-x as ESC-x */
ch &= ~0x80;
Expand Down Expand Up @@ -664,7 +664,7 @@ void mutt_reflow_windows(void)
option(OPT_STATUS_ON_TOP) ? MuttStatusWindow->rows : MuttHelpWindow->rows;

#ifdef USE_SIDEBAR
if (option(OPT_SIDEBAR))
if (option(OPT_SIDEBAR_VISIBLE))
{
memcpy(MuttSidebarWindow, MuttIndexWindow, sizeof(struct MuttWindow));
MuttSidebarWindow->cols = SidebarWidth;
Expand Down Expand Up @@ -700,7 +700,7 @@ static void reflow_message_window_rows(int mw_rows)
LINES - MuttStatusWindow->rows - MuttHelpWindow->rows - MuttMessageWindow->rows, 0);

#ifdef USE_SIDEBAR
if (option(OPT_SIDEBAR))
if (option(OPT_SIDEBAR_VISIBLE))
MuttSidebarWindow->rows = MuttIndexWindow->rows;
#endif

Expand Down
22 changes: 11 additions & 11 deletions curs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static int main_change_folder(struct Menu *menu, int op, char *buf, size_t bufsz
mutt_folder_hook(buf);

if ((Context = mx_open_mailbox(
buf, (option(OPT_READONLY) || op == OP_MAIN_CHANGE_FOLDER_READONLY) ? MUTT_READONLY : 0,
buf, (option(OPT_READ_ONLY) || op == OP_MAIN_CHANGE_FOLDER_READONLY) ? MUTT_READONLY : 0,
NULL)) != NULL)
{
menu->current = ci_first_message();
Expand Down Expand Up @@ -2004,7 +2004,7 @@ int mutt_index_menu(void)
case OP_MAIN_CHANGE_GROUP_READONLY:
unset_option(OPT_NEWS);
#endif
if (attach_msg || option(OPT_READONLY) ||
if (attach_msg || option(OPT_READ_ONLY) ||
#ifdef USE_NNTP
op == OP_MAIN_CHANGE_GROUP_READONLY ||
#endif
Expand Down Expand Up @@ -2139,7 +2139,7 @@ int mutt_index_menu(void)
menu->current = mutt_thread_next_unread(Context, CURHDR);
}

if (option(OPT_PGP_AUTO_DEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
int hint = Context->hdrs[Context->v2r[menu->current]]->index;

Expand Down Expand Up @@ -2858,7 +2858,7 @@ int mutt_index_menu(void)
/* L10N: CHECK_ACL */
CHECK_ACL(MUTT_ACL_INSERT, _("Cannot edit message"));

if (option(OPT_PGP_AUTO_DEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
mutt_edit_message(Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
Expand All @@ -2870,7 +2870,7 @@ int mutt_index_menu(void)
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_ATTACH;
if (option(OPT_PGP_AUTO_DEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
ci_send_message(SENDFORWARD, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
Expand All @@ -2885,7 +2885,7 @@ int mutt_index_menu(void)
CHECK_MSGCOUNT;
CHECK_VISIBLE;
CHECK_ATTACH;
if (option(OPT_PGP_AUTO_DEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
ci_send_message(SENDREPLY | SENDGROUPREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
Expand Down Expand Up @@ -2919,7 +2919,7 @@ int mutt_index_menu(void)
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
if (option(OPT_PGP_AUTO_DEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
ci_send_message(SENDREPLY | SENDLISTREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
Expand Down Expand Up @@ -3104,11 +3104,11 @@ int mutt_index_menu(void)
CHECK_ATTACH;
if (op != OP_FOLLOWUP || !CURHDR->env->followup_to ||
(mutt_strcasecmp(CURHDR->env->followup_to, "poster") != 0) ||
query_quadoption(OPT_FOLLOW_UP_TO_POSTER,
query_quadoption(OPT_FOLLOWUP_TO_POSTER,
_("Reply by mail as poster prefers?")) != MUTT_YES)
{
if (Context && Context->magic == MUTT_NNTP &&
!((struct NntpData *) Context->data)->allowed && query_quadoption(OPT_TO_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
!((struct NntpData *) Context->data)->allowed && query_quadoption(OPT_POST_MODERATED, _("Posting to this group not allowed, may be moderated. Continue?")) != MUTT_YES)
break;
if (op == OP_POST)
ci_send_message(SENDNEWS, NULL, NULL, Context, NULL);
Expand All @@ -3128,7 +3128,7 @@ int mutt_index_menu(void)
CHECK_ATTACH;
CHECK_MSGCOUNT;
CHECK_VISIBLE;
if (option(OPT_PGP_AUTO_DEC) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
if (option(OPT_PGP_AUTO_DECODE) && (tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
ci_send_message(SENDREPLY, NULL, NULL, Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
Expand Down Expand Up @@ -3256,7 +3256,7 @@ int mutt_index_menu(void)
break;

case OP_SIDEBAR_TOGGLE_VISIBLE:
toggle_option(OPT_SIDEBAR);
toggle_option(OPT_SIDEBAR_VISIBLE);
mutt_reflow_windows();
break;

Expand Down
6 changes: 3 additions & 3 deletions edit.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static void be_edit_header(struct Envelope *e, int force)
addch('\n');
}

if ((!e->cc && option(OPT_ASK_CC)) || force)
if ((!e->cc && option(OPT_ASKCC)) || force)
{
addstr("Cc: ");
tmp[0] = '\0';
Expand All @@ -307,7 +307,7 @@ static void be_edit_header(struct Envelope *e, int force)
addch('\n');
}

if (option(OPT_ASK_BCC) || force)
if (option(OPT_ASKBCC) || force)
{
addstr("Bcc: ");
tmp[0] = '\0';
Expand Down Expand Up @@ -458,7 +458,7 @@ int mutt_builtin_editor(const char *path, struct Header *msg, struct Header *cur
buf = NULL;
bufmax = buflen = 0;

if (option(OPT_EDIT_HDRS))
if (option(OPT_EDIT_HEADERS))
{
mutt_env_to_local(msg->env);
mutt_edit_headers(NONULL(Visual), path, msg, NULL, 0);
Expand Down
8 changes: 4 additions & 4 deletions handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ static int multipart_handler(struct Body *a, struct State *s)
NONULL(p->subtype));
}

if ((s->flags & MUTT_REPLYING) && (option(OPT_INCLUDE_ONLY_FIRST)) && (s->flags & MUTT_FIRSTDONE))
if ((s->flags & MUTT_REPLYING) && (option(OPT_INCLUDE_ONLYFIRST)) && (s->flags & MUTT_FIRSTDONE))
break;
}

Expand Down Expand Up @@ -1937,7 +1937,7 @@ int mutt_body_handler(struct Body *b, struct State *s)

/* only respect disposition == attachment if we're not
displaying from the attachment menu (i.e. pager) */
if ((!option(OPT_HONOR_DISP) || (b->disposition != DISPATTACH || option(OPT_VIEW_ATTACH))) &&
if ((!option(OPT_HONOR_DISPOSITION) || (b->disposition != DISPATTACH || option(OPT_VIEW_ATTACH))) &&
(plaintext || handler))
{
rc = run_decode_and_handler(b, s, handler, plaintext);
Expand All @@ -1946,10 +1946,10 @@ int mutt_body_handler(struct Body *b, struct State *s)
if we're not already being called from there */
else if ((s->flags & MUTT_DISPLAY) ||
(b->disposition == DISPATTACH && !option(OPT_VIEW_ATTACH) &&
option(OPT_HONOR_DISP) && (plaintext || handler)))
option(OPT_HONOR_DISPOSITION) && (plaintext || handler)))
{
state_mark_attach(s);
if (option(OPT_HONOR_DISP) && b->disposition == DISPATTACH)
if (option(OPT_HONOR_DISPOSITION) && b->disposition == DISPATTACH)
fputs(_("[-- This is an attachment "), s->fpout);
else
state_printf(s, _("[-- %s/%s is unsupported "), TYPE(b), b->subtype);
Expand Down
2 changes: 1 addition & 1 deletion hcache/kc.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static void *hcache_kyotocabinet_open(const char *path)

printfresult =
snprintf(kcdbpath, sizeof(kcdbpath), "%s#type=kct#opts=%s#rcomp=lex",
path, option(OPT_HCACHE_COMPRESS) ? "lc" : "l");
path, option(OPT_HEADER_CACHE_COMPRESS) ? "lc" : "l");
if ((printfresult < 0) || (printfresult >= sizeof(kcdbpath)))
{
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion hcache/qdbm.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static void *hcache_qdbm_open(const char *path)
{
int flags = VL_OWRITER | VL_OCREAT;

if (option(OPT_HCACHE_COMPRESS))
if (option(OPT_HEADER_CACHE_COMPRESS))
flags |= VL_OZCOMP;

return vlopen(path, flags, VL_CMPLEX);
Expand Down
2 changes: 1 addition & 1 deletion hcache/tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void *hcache_tokyocabinet_open(const char *path)
TCBDB *db = tcbdbnew();
if (!db)
return NULL;
if (option(OPT_HCACHE_COMPRESS))
if (option(OPT_HEADER_CACHE_COMPRESS))
tcbdbtune(db, 0, 0, 0, -1, -1, BDBTDEFLATE);
if (tcbdbopen(db, path, BDBOWRITER | BDBOCREAT))
return db;
Expand Down
10 changes: 5 additions & 5 deletions history.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static void shrink_histfile(void)
if ((f = fopen(HistFile, "r")) == NULL)
return;

if (option(OPT_HIST_REMOVE_DUPS))
if (option(OPT_HISTORY_REMOVE_DUPS))
for (hclass = 0; hclass < HC_LAST; hclass++)
dup_hashes[hclass] = hash_create(MAX(10, SaveHist * 2), MUTT_HASH_STRDUP_KEYS);

Expand All @@ -216,7 +216,7 @@ static void shrink_histfile(void)
if (hclass >= HC_LAST)
continue;
*p = '\0';
if (option(OPT_HIST_REMOVE_DUPS) && (dup_hash_inc(dup_hashes[hclass], linebuf + read) > 1))
if (option(OPT_HISTORY_REMOVE_DUPS) && (dup_hash_inc(dup_hashes[hclass], linebuf + read) > 1))
{
regen_file = true;
continue;
Expand Down Expand Up @@ -253,7 +253,7 @@ static void shrink_histfile(void)
if (hclass >= HC_LAST)
continue;
*p = '\0';
if (option(OPT_HIST_REMOVE_DUPS) &&
if (option(OPT_HISTORY_REMOVE_DUPS) &&
(dup_hash_dec(dup_hashes[hclass], linebuf + read) > 0))
continue;
*p = '|';
Expand All @@ -276,7 +276,7 @@ static void shrink_histfile(void)
safe_fclose(&tmp);
unlink(tmpfname);
}
if (option(OPT_HIST_REMOVE_DUPS))
if (option(OPT_HISTORY_REMOVE_DUPS))
for (hclass = 0; hclass < HC_LAST; hclass++)
hash_destroy(&dup_hashes[hclass], NULL);
}
Expand Down Expand Up @@ -401,7 +401,7 @@ void mutt_history_add(enum HistoryClass hclass, const char *s, int save)
*/
if (*s != ' ' && (!h->hist[prev] || (mutt_strcmp(h->hist[prev], s) != 0)))
{
if (option(OPT_HIST_REMOVE_DUPS))
if (option(OPT_HISTORY_REMOVE_DUPS))
remove_history_dups(hclass, s);
if (save && SaveHist)
save_history(hclass, s);
Expand Down
2 changes: 1 addition & 1 deletion imap/browse.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int imap_browse(char *path, struct BrowserState *state)

save_lsub = option(OPT_IMAP_CHECK_SUBSCRIBED);
unset_option(OPT_IMAP_CHECK_SUBSCRIBED);
strfcpy(list_cmd, option(OPT_IMAP_LSUB) ? "LSUB" : "LIST", sizeof(list_cmd));
strfcpy(list_cmd, option(OPT_IMAP_LIST_SUBSCRIBED) ? "LSUB" : "LIST", sizeof(list_cmd));

if (!(idata = imap_conn_find(&(mx.account), 0)))
goto fail;
Expand Down
2 changes: 1 addition & 1 deletion imap/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ static int cmd_handle_untagged(struct ImapData *idata)

return -1;
}
else if (option(OPT_IMAP_SERVER_NOISE) && (mutt_strncasecmp("NO", s, 2) == 0))
else if (option(OPT_IMAP_SERVERNOISE) && (mutt_strncasecmp("NO", s, 2) == 0))
{
mutt_debug(2, "Handling untagged NO\n");

Expand Down
8 changes: 4 additions & 4 deletions imap/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ int imap_open_connection(struct ImapData *idata)

if (option(OPT_SSL_FORCE_TLS))
rc = MUTT_YES;
else if ((rc = query_quadoption(OPT_SSL_START_TLS,
else if ((rc = query_quadoption(OPT_SSL_STARTTLS,
_("Secure connection with TLS?"))) == MUTT_ABORT)
goto err_close_conn;
if (rc == MUTT_YES)
Expand Down Expand Up @@ -842,7 +842,7 @@ static int imap_open_mailbox_append(struct Context *ctx, int flags)
return -1;

snprintf(buf, sizeof(buf), _("Create %s?"), mailbox);
if (option(OPT_CONFIRM_CREATE) && mutt_yesorno(buf, 1) != MUTT_YES)
if (option(OPT_CONFIRMCREATE) && mutt_yesorno(buf, 1) != MUTT_YES)
return -1;

if (imap_create_mailbox(idata, mailbox) < 0)
Expand Down Expand Up @@ -2150,7 +2150,7 @@ int imap_complete(char *dest, size_t dlen, char *path)
list[0] = '\0';

/* fire off command */
snprintf(buf, sizeof(buf), "%s \"\" \"%s%%\"", option(OPT_IMAP_LSUB) ? "LSUB" : "LIST", list);
snprintf(buf, sizeof(buf), "%s \"\" \"%s%%\"", option(OPT_IMAP_LIST_SUBSCRIBED) ? "LSUB" : "LIST", list);

imap_cmd_start(idata, buf);

Expand Down Expand Up @@ -2276,7 +2276,7 @@ int imap_fast_trash(struct Context *ctx, char *dest)
break;
mutt_debug(3, "imap_fast_trash: server suggests TRYCREATE\n");
snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox);
if (option(OPT_CONFIRM_CREATE) && mutt_yesorno(prompt, 1) != MUTT_YES)
if (option(OPT_CONFIRMCREATE) && mutt_yesorno(prompt, 1) != MUTT_YES)
{
mutt_clear_error();
goto out;
Expand Down
2 changes: 1 addition & 1 deletion imap/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,7 @@ int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int de
break;
mutt_debug(3, "imap_copy_messages: server suggests TRYCREATE\n");
snprintf(prompt, sizeof(prompt), _("Create %s?"), mbox);
if (option(OPT_CONFIRM_CREATE) && mutt_yesorno(prompt, 1) != MUTT_YES)
if (option(OPT_CONFIRMCREATE) && mutt_yesorno(prompt, 1) != MUTT_YES)
{
mutt_clear_error();
goto out;
Expand Down
2 changes: 1 addition & 1 deletion init.c
Original file line number Diff line number Diff line change
Expand Up @@ -4446,7 +4446,7 @@ void mutt_init(int skip_sys_rc, struct ListHead *commands)
mutt_read_histfile();

#ifdef USE_NOTMUCH
if (option(OPT_VIRT_SPOOL_FILE))
if (option(OPT_VIRTUAL_SPOOLFILE))
{
/* Find the first virtual folder and open it */
for (struct Buffy *b = Incoming; b; b = b->next)
Expand Down
Loading

0 comments on commit 5723a28

Please sign in to comment.