+2007-03-03 18:47 -0800 Brendan Cully <brendan@kublai.com> (f23dba931c3f)
+
+ * UPDATING, copy.c, globals.h, handler.c, init.c, init.h,
+ mutt_curses.h, pager.c: Add $wrap, which supersedes $wrapmargin.
+ When set to a positive number, wrap at that column. When set to a
+ negative number, keep that many characters empty on the right.
+
+2007-03-03 00:35 -0800 Brendan Cully <brendan@kublai.com> (3e3d3bf73c9f)
+
+ * ChangeLog, hg-changelog-map, hg-commit: Use hg-commit to perform
+ commits that also update the ChangeLog.
+
2007-03-03 00:34 -0800 Brendan Cully <brendan@kublai.com> (03596c38dd53)
* hg-commit: Use hg-commit to perform commits that also update the
The keys used are:
!: modified feature, -: deleted feature, +: new feature
+ + $wrap (>0 wraps at $wrap, <0 = $wrapmargin)
+ $assumed_charset, $attach_charset, $ignore_linear_white_space
+ $save_history, $history_file (save history across sessions)
+ $smtp_url (ESMTP relay support)
if (flags & (CH_DECODE|CH_PREFIX))
{
if (mutt_write_one_header (out, 0, headers[x],
- flags & CH_PREFIX ? prefix : 0, COLS - WrapMargin) == -1)
+ flags & CH_PREFIX ? prefix : 0, mutt_term_width (Wrap)) == -1)
{
error = TRUE;
break;
WHERE short SendmailWait;
WHERE short SleepTime INITVAL (1);
WHERE short Timeout;
-WHERE short WrapMargin;
+WHERE short Wrap;
WHERE short WriteInc;
WHERE short ScoreThresholdDelete;
if (s->prefix)
add = 1;
- if ((flowed_max = FLOWED_MAX) > COLS - 3)
- flowed_max = COLS - 3;
- if (flowed_max > COLS - WrapMargin)
- flowed_max = COLS - WrapMargin;
- if (flowed_max <= 0)
- flowed_max = COLS;
+ if ((flowed_max = FLOWED_MAX) > mutt_term_width (0) - 3)
+ flowed_max = mutt_term_width (0) - 3;
+ if (flowed_max > mutt_term_width (Wrap))
+ flowed_max = mutt_term_width (Wrap);
while (bytes > 0 && fgets (line, sizeof (line), s->fpin))
if (query || *s->dptr != '=')
{
+ val = *ptr;
+ /* compatibility alias */
+ if (mutt_strcmp (MuttVars[idx].option, "wrapmargin") == 0)
+ val = *ptr < 0 ? -*ptr : 0;
+
/* user requested the value of this variable */
- snprintf (err->data, err->dsize, "%s=%d", MuttVars[idx].option, *ptr);
+ snprintf (err->data, err->dsize, "%s=%d", MuttVars[idx].option, val);
break;
}
if (*ptr < 0)
*ptr = 0;
}
+ else if (mutt_strcmp (MuttVars[idx].option, "wrapmargin") == 0)
+ {
+ if (*ptr < 0)
+ *ptr = 0;
+ else
+ *ptr = -*ptr;
+ }
}
else if (DTYPE (MuttVars[idx].type) == DT_QUAD)
{
else if (DTYPE (MuttVars[idx].type) == DT_QUAD)
strfcpy (tmp, vals[quadoption (MuttVars[idx].data)], sizeof (tmp));
else if (DTYPE (MuttVars[idx].type) == DT_NUM)
- snprintf (tmp, sizeof (tmp), "%d", (*((short *) MuttVars[idx].data)));
+ {
+ short sval = *((short *) MuttVars[idx].data);
+
+ /* avert your eyes, gentle reader */
+ if (mutt_strcmp (MuttVars[idx].option, "wrapmargin") == 0)
+ sval = sval > 0 ? 0 : -sval;
+
+ snprintf (tmp, sizeof (tmp), "%d", sval);
+ }
else if (DTYPE (MuttVars[idx].type) == DT_SORT)
{
const struct mapping_t *map;
** When set, mutt will weed headers when displaying, forwarding,
** printing, or replying to messages.
*/
+ { "wrap", DT_NUM, R_PAGER, UL &Wrap, 0 },
+ /*
+ ** .pp
+ ** When set to a positive value, mutt will wrap text at $$wrap characters.
+ ** When set to a negative value, mutt will wrap text so that there are $$wrap
+ ** characters of empty space on the right side of the terminal.
+ */
{ "wrap_search", DT_BOOL, R_NONE, OPTWRAPSEARCH, 1 },
/*
** .pp
** When set, searches will wrap around the first (or last) message. When
** unset, searches will not wrap.
*/
- { "wrapmargin", DT_NUM, R_PAGER, UL &WrapMargin, 0 },
+ { "wrapmargin", DT_NUM, R_PAGER, UL &Wrap, 0 },
/*
** .pp
- ** Controls the size of the margin remaining at the right side of
- ** the terminal when mutt's pager does smart wrapping.
+ ** (DEPRECATED) Equivalent to setting $wrap with a negative value.
*/
{ "write_inc", DT_NUM, R_NONE, UL &WriteInc, 10 },
/*
long size);
void mutt_progress_update (progress_t* progress, long pos);
+static inline int mutt_term_width(short wrap)
+{
+ if (wrap < 0)
+ return COLS > -wrap ? COLS + wrap : COLS;
+ else if (wrap)
+ return wrap < COLS ? wrap : COLS;
+ else
+ return COLS;
+}
+
extern int *ColorQuote;
extern int ColorQuoteUsed;
extern int ColorDefs[];
wchar_t wc;
mbstate_t mbstate;
- int wrap_cols = COLS - WrapMargin;
-
- if (wrap_cols <= 0)
- wrap_cols = COLS;
+ int wrap_cols = mutt_term_width (Wrap);
/* FIXME: this should come from lineInfo */
memset(&mbstate, 0, sizeof(mbstate));