if (C_TextFlowed)
mutt_str_strfcpy(prefix, ">", sizeof(prefix));
else
- mutt_make_string(prefix, sizeof(prefix), NONULL(C_IndentString), Context,
- Context->mailbox, e);
+ mutt_make_string(prefix, sizeof(prefix), wraplen, NONULL(C_IndentString),
+ Context, Context->mailbox, e);
}
if ((cmflags & MUTT_CM_NOHEADER) == 0)
if (C_Attribution)
{
setlocale(LC_TIME, NONULL(C_AttributionLocale));
- mutt_make_string(tmp, sizeof(tmp) - 1, C_Attribution, Context,
+ mutt_make_string(tmp, sizeof(tmp) - 1, 0, C_Attribution, Context,
Context->mailbox, Context->mailbox->emails[n]);
setlocale(LC_TIME, "");
strcat(tmp, "\n");
* mutt_make_string_flags - Create formatted strings using mailbox expandos
* @param buf Buffer for the result
* @param buflen Buffer length
+ * @param cols Number of screen columns (OPTIONAL)
* @param s printf-line format string
* @param ctx Mailbox Context
* @param m Mailbox
* @param e Email
* @param flags Flags, see #MuttFormatFlags
*/
-void mutt_make_string_flags(char *buf, size_t buflen, const char *s, struct Context *ctx,
- struct Mailbox *m, struct Email *e, MuttFormatFlags flags)
+void mutt_make_string_flags(char *buf, size_t buflen, int cols, const char *s,
+ struct Context *ctx, struct Mailbox *m,
+ struct Email *e, MuttFormatFlags flags)
{
struct HdrFormatInfo hfi;
hfi.mailbox = m;
hfi.pager_progress = 0;
- mutt_expando_format(buf, buflen, 0, MuttIndexWindow->cols, s,
- index_format_str, (unsigned long) &hfi, flags);
+ mutt_expando_format(buf, buflen, 0, cols, s, index_format_str, (unsigned long) &hfi, flags);
}
/**
bool mutt_is_mail_list(const struct Address *addr);
bool mutt_is_subscribed_list(const struct Address *addr);
-void mutt_make_string_flags(char *buf, size_t buflen, const char *s,
+void mutt_make_string_flags(char *buf, size_t buflen, int cols, const char *s,
struct Context *ctx, struct Mailbox *m,
struct Email *e, MuttFormatFlags flags);
void mutt_make_string_info(char *buf, size_t buflen, int cols, const char *s,
struct HdrFormatInfo *hfi, MuttFormatFlags flags);
-#define mutt_make_string(BUF, BUFLEN, S, CTX, M, E) \
- mutt_make_string_flags(BUF, BUFLEN, S, CTX, M, E, 0)
+#define mutt_make_string(BUF, BUFLEN, COLS, S, CTX, M, E) \
+ mutt_make_string_flags(BUF, BUFLEN, COLS, S, CTX, M, E, MUTT_FORMAT_NO_FLAGS)
#endif /* MUTT_HDRLINE_H */
if ((mutt_pattern_exec(SLIST_FIRST(hook->pattern), 0, m, e, &cache) > 0) ^
hook->regex.pat_not)
{
- mutt_make_string_flags(path, pathlen, hook->command, ctx, m, e, MUTT_FORMAT_PLAIN);
+ mutt_make_string_flags(path, pathlen, 0, hook->command, ctx, m, e, MUTT_FORMAT_PLAIN);
return 0;
}
}
}
}
- mutt_make_string_flags(buf, buflen, NONULL(C_IndexFormat), Context,
- Context->mailbox, e, flags);
+ mutt_make_string_flags(buf, buflen, menu->indexwin->cols, NONULL(C_IndexFormat),
+ Context, Context->mailbox, e, flags);
}
/**
#include "mutt_logging.h"
#include "mutt_menu.h"
#include "mutt_thread.h"
+#include "mutt_window.h"
#include "muttlib.h"
#include "mx.h"
#include "ncrypt/ncrypt.h"
{
struct Context *ctx = menu->data;
- mutt_make_string_flags(buf, buflen, NONULL(C_IndexFormat), ctx, ctx->mailbox,
+ mutt_make_string_flags(buf, buflen, menu->indexwin->cols,
+ NONULL(C_IndexFormat), ctx, ctx->mailbox,
ctx->mailbox->emails[line], MUTT_FORMAT_ARROWCURSOR);
}
C_MessageFormat && aptr->content->email)
{
char s[128];
- mutt_make_string_flags(s, sizeof(s), C_MessageFormat, NULL, NULL,
- aptr->content->email,
+ mutt_make_string_flags(s, sizeof(s), cols, C_MessageFormat, NULL,
+ NULL, aptr->content->email,
MUTT_FORMAT_FORCESUBJ | MUTT_FORMAT_ARROWCURSOR);
if (*s)
{
mutt_str_strfcpy(prefix2, prefix, sizeof(prefix2));
else if (!C_TextFlowed)
{
- mutt_make_string(prefix2, sizeof(prefix2), NONULL(C_IndentString),
+ mutt_make_string(prefix2, sizeof(prefix2), 0, NONULL(C_IndentString),
Context, Context->mailbox, e);
}
else
mutt_str_strfcpy(prefix, ">", sizeof(prefix));
else
{
- mutt_make_string(prefix, sizeof(prefix), NONULL(C_IndentString), Context,
- Context->mailbox, e_parent);
+ mutt_make_string(prefix, sizeof(prefix), 0, NONULL(C_IndentString),
+ Context, Context->mailbox, e_parent);
}
}
if (!C_TextFlowed)
{
- mutt_make_string(prefix, sizeof(prefix), NONULL(C_IndentString), Context,
- Context->mailbox, e_parent);
+ mutt_make_string(prefix, sizeof(prefix), 0, NONULL(C_IndentString),
+ Context, Context->mailbox, e_parent);
}
else
mutt_str_strfcpy(prefix, ">", sizeof(prefix));
char buf[1024];
setlocale(LC_TIME, NONULL(C_AttributionLocale));
- mutt_make_string(buf, sizeof(buf), C_ForwardAttributionIntro, NULL, m, e);
+ mutt_make_string(buf, sizeof(buf), 0, C_ForwardAttributionIntro, NULL, m, e);
setlocale(LC_TIME, "");
fputs(buf, fp);
fputs("\n\n", fp);
char buf[1024];
setlocale(LC_TIME, NONULL(C_AttributionLocale));
- mutt_make_string(buf, sizeof(buf), C_ForwardAttributionTrailer, NULL, m, e);
+ mutt_make_string(buf, sizeof(buf), 0, C_ForwardAttributionTrailer, NULL, m, e);
setlocale(LC_TIME, "");
fputc('\n', fp);
fputs(buf, fp);
char buf[1024];
setlocale(LC_TIME, NONULL(C_AttributionLocale));
- mutt_make_string(buf, sizeof(buf), C_Attribution, NULL, m, e);
+ mutt_make_string(buf, sizeof(buf), 0, C_Attribution, NULL, m, e);
setlocale(LC_TIME, "");
fputs(buf, fp_out);
fputc('\n', fp_out);
return;
char buf[256];
- mutt_make_string(buf, sizeof(buf), C_PostIndentString, NULL, m, e);
+ mutt_make_string(buf, sizeof(buf), 0, C_PostIndentString, NULL, m, e);
fputs(buf, fp_out);
fputc('\n', fp_out);
}
char buf[256];
/* set the default subject for the message. */
- mutt_make_string(buf, sizeof(buf), NONULL(C_ForwardFormat), NULL, m, e);
+ mutt_make_string(buf, sizeof(buf), 0, NONULL(C_ForwardFormat), NULL, m, e);
mutt_str_replace(&env->subject, buf);
}