--- mutt-1.5.8/PATCHES~ never +++ mutt-1.5.8/PATCHES Sun Mar 6 18:01:13 CST 2005 @@ -1,0 +1 @@ +patch-1.5.8.dgc.softfill.3 diff -Pur mutt-1.5.8-base/commands.c mutt-1.5.8/commands.c --- mutt-1.5.8-base/commands.c Sat Feb 12 13:22:15 2005 +++ mutt-1.5.8/commands.c Sun Mar 6 18:01:13 2005 @@ -284,7 +284,7 @@ if (mutt_strwidth (prompt) > COLS - extra_space) { mutt_format_string (prompt, sizeof (prompt), - 0, COLS-extra_space, 0, 0, + 0, COLS-extra_space, FMT_LEFT, 0, prompt, sizeof (prompt), 0); safe_strcat (prompt, sizeof (prompt), "...?"); } diff -Pur mutt-1.5.8-base/curs_lib.c mutt-1.5.8/curs_lib.c --- mutt-1.5.8-base/curs_lib.c Thu Feb 3 12:47:52 2005 +++ mutt-1.5.8/curs_lib.c Sun Mar 6 18:01:13 2005 @@ -304,7 +304,7 @@ dprint (1, (debugfile, "%s\n", Errorbuf)); mutt_format_string (Errorbuf, sizeof (Errorbuf), - 0, COLS-2, 0, 0, Errorbuf, sizeof (Errorbuf), 0); + 0, COLS-2, FMT_LEFT, 0, Errorbuf, sizeof (Errorbuf), 0); if (!option (OPTKEEPQUIET)) { @@ -328,7 +328,7 @@ va_end (ap); mutt_format_string (Errorbuf, sizeof (Errorbuf), - 0, COLS-2, 0, 0, Errorbuf, sizeof (Errorbuf), 0); + 0, COLS-2, FMT_LEFT, 0, Errorbuf, sizeof (Errorbuf), 0); if (!option (OPTKEEPQUIET)) { @@ -585,7 +585,7 @@ void mutt_format_string (char *dest, size_t destlen, int min_width, int max_width, - int right_justify, char m_pad_char, + int justify, char m_pad_char, const char *s, size_t n, int arboreal) { @@ -629,7 +629,7 @@ w = (int)destlen < min_width ? destlen : min_width; if (w <= 0) *p = '\0'; - else if (right_justify) + else if (justify == FMT_RIGHT) /* right justify */ { p[w] = '\0'; while (--p >= dest) @@ -637,7 +637,27 @@ while (--w >= 0) dest[w] = m_pad_char; } - else + else if (justify == FMT_CENTER) /* center */ + { + char *savedp = p; + int half = (w+1) / 2; /* half of cushion space */ + + p[w] = '\0'; + + /* move str to center of buffer */ + while (--p >= dest) + p[half] = *p; + + /* fill rhs */ + p = savedp + half; + while (--w >= half) + *p++ = m_pad_char; + + /* fill lhs */ + while (half--) + dest[half] = m_pad_char; + } + else /* left justify */ { while (--w >= 0) *p++ = m_pad_char; @@ -659,13 +679,15 @@ const char *s, int arboreal) { - int right_justify = 1; + int justify = FMT_RIGHT; char *p; int min_width; int max_width = INT_MAX; if (*prefix == '-') - ++prefix, right_justify = 0; + ++prefix, justify = FMT_LEFT; + else if (*prefix == '=') + ++prefix, justify = FMT_CENTER; min_width = strtol (prefix, &p, 10); if (*p == '.') { @@ -676,7 +698,7 @@ } mutt_format_string (dest, destlen, min_width, max_width, - right_justify, ' ', s, mutt_strlen (s), arboreal); + justify, ' ', s, mutt_strlen (s), arboreal); } void mutt_format_s (char *dest, @@ -697,7 +719,7 @@ /* * mutt_paddstr (n, s) is almost equivalent to - * mutt_format_string (bigbuf, big, n, n, 0, ' ', s, big, 0), addstr (bigbuf) + * mutt_format_string (bigbuf, big, n, n, FMT_LEFT, ' ', s, big, 0), addstr (bigbuf) */ void mutt_paddstr (int n, const char *s) diff -Pur mutt-1.5.8-base/doc/manual.sgml.head mutt-1.5.8/doc/manual.sgml.head --- mutt-1.5.8-base/doc/manual.sgml.head Sat Feb 12 13:41:36 2005 +++ mutt-1.5.8/doc/manual.sgml.head Sun Mar 6 18:01:13 2005 @@ -1699,6 +1699,63 @@ argument, or you can remove all hooks of a specific type by saying something like Format strings