1 --- mutt-1.4-orig/init.h 2002-04-25 15:26:37.000000000 +0200
2 +++ mutt-1.4/init.h 2003-01-26 19:33:40.000000000 +0100
4 ** you use `+' or `=' for any other variables since expansion takes place
5 ** during the `set' command.
7 + { "folder_columns", DT_NUM, R_NONE, UL &FolderColumns, UL 1 },
10 + ** Specifies the number of folder columns in folder browser.
13 { "folder_format", DT_STR, R_INDEX, UL &FolderFormat, UL "%2C %t %N %F %2l %-8.8u %-8.8g %8s %d %f" },
16 --- mutt-1.4-orig/globals.h 2002-01-03 21:57:19.000000000 +0100
17 +++ mutt-1.4/globals.h 2003-01-26 19:34:05.000000000 +0100
19 WHERE unsigned short Counter INITVAL (0);
21 WHERE short ConnectTimeout;
22 +WHERE short FolderColumns;
24 WHERE short PagerContext;
25 WHERE short PagerIndexLines;
26 --- mutt-1.4-orig/mutt_menu.h 2001-09-11 13:20:34.000000000 +0200
27 +++ mutt-1.4/mutt_menu.h 2003-01-26 19:33:01.000000000 +0100
29 int menu; /* menu definition for keymap entries. */
30 int offset; /* which screen row to start the index */
31 int pagelen; /* number of entries per screen */
32 + int columns; /* number of columns in menu */
35 /* Setting dialog != NULL overrides normal menu behaviour.
36 --- mutt-1.4-orig/browser.c 2002-03-19 10:54:00.000000000 +0100
37 +++ mutt-1.4/browser.c 2003-01-26 19:35:34.000000000 +0100
41 static void init_menu (struct browser_state *state, MUTTMENU *menu, char *title,
42 - size_t titlelen, int buffy)
43 + size_t titlelen, int buffy, int columns)
45 char path[_POSIX_PATH_MAX];
47 menu->max = state->entrylen;
49 + menu->columns = columns;
51 if(menu->current >= menu->max)
52 menu->current = menu->max - 1;
53 if (menu->current < 0)
55 menu->help = mutt_compile_help (helpstr, sizeof (helpstr), MENU_FOLDER,
58 - init_menu (&state, menu, title, sizeof (title), buffy);
59 + init_menu (&state, menu, title, sizeof (title), buffy, FolderColumns);
67 - init_menu (&state, menu, title, sizeof (title), buffy);
68 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
73 menu->data = state.entry;
76 - init_menu (&state, menu, title, sizeof (title), buffy);
77 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
78 MAYBE_REDRAW (menu->redraw);
82 sizeof (struct folder_file) * (state.entrylen - (nentry+1)));
84 mutt_message _("Mailbox deleted.");
85 - init_menu (&state, menu, title, sizeof (title), buffy);
86 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
87 MAYBE_REDRAW (menu->redraw);
91 menu->data = state.entry;
94 - init_menu (&state, menu, title, sizeof (title), buffy);
95 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
103 - init_menu (&state, menu, title, sizeof (title), buffy);
104 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
108 @@ -1012,12 +1014,12 @@
109 state.imap_browse = 1;
110 imap_browse (LastDir, &state);
111 menu->data = state.entry;
112 - init_menu (&state, menu, title, sizeof (title), buffy);
113 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
117 if (examine_directory (menu, &state, LastDir, NULL) == 0)
118 - init_menu (&state, menu, title, sizeof (title), buffy);
119 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
122 mutt_error _("Error scanning directory.");
123 @@ -1101,7 +1103,7 @@
125 else if (examine_directory (menu, &state, LastDir, prefix) == -1)
127 - init_menu (&state, menu, title, sizeof (title), buffy);
128 + init_menu (&state, menu, title, sizeof (title), buffy, 1);
131 case OP_BROWSER_NEW_FILE:
132 --- mutt-1.4.2.1/menu.c.orig 2004-02-14 17:54:37.148495120 +0100
133 +++ mutt-1.4.2.1/menu.c 2004-02-14 17:55:46.357973680 +0100
135 menu->make_entry (s, l, menu, i);
138 -void menu_pad_string (char *s, size_t n)
139 +void menu_pad_string (MUTTMENU *menu, char *s, size_t n)
141 int shift = option (OPTARROWCURSOR) ? 3 : 0;
142 int cols = COLS - shift;
143 @@ -196,69 +196,89 @@
144 menu->redraw &= ~REDRAW_STATUS;
147 -void menu_redraw_index (MUTTMENU *menu)
148 +void menu_item_pos(MUTTMENU *menu, int item, int *row, int *col)
153 - for (i = menu->top; i < menu->top + menu->pagelen; i++)
157 - menu_make_entry (buf, sizeof (buf), menu, i);
158 - menu_pad_string (buf, sizeof (buf));
159 + *row = (item - menu->top) % menu->pagelen;
160 + *col = (item - menu->top) / menu->pagelen;
163 - if (option (OPTARROWCURSOR))
165 - attrset (menu->color (i));
166 - CLEARLINE (i - menu->top + menu->offset);
167 +void menu_redraw_index (MUTTMENU *menu)
173 - if (i == menu->current)
174 + for (i = menu->top; i < menu->top + (menu->pagelen * menu->columns); i++)
176 - SETCOLOR (MT_COLOR_INDICATOR);
178 - attrset (menu->color (i));
182 - move (i - menu->top + menu->offset, 3);
183 + menu_item_pos(menu, i, &row, &col);
186 + menu_make_entry (buf, sizeof (buf), menu, i);
187 + menu_pad_string (menu, buf, sizeof (buf));
189 - print_enriched_string (menu->color(i), (unsigned char *) buf, 1);
190 - SETCOLOR (MT_COLOR_NORMAL);
194 - if (i == menu->current)
196 - SETCOLOR (MT_COLOR_INDICATOR);
197 - BKGDSET (MT_COLOR_INDICATOR);
198 + if (option (OPTARROWCURSOR))
200 + attrset (menu->color (i));
202 + move(menu->offset + row, col * (COLS / menu->columns));
204 + if (i == menu->current)
206 + SETCOLOR (MT_COLOR_INDICATOR);
208 + attrset (menu->color (i));
212 + move(row + menu->offset, col * COLS / menu->columns + 3);
214 + print_enriched_string (menu->color(i), (unsigned char *) buf,
216 + SETCOLOR (MT_COLOR_NORMAL);
219 + { /* !option(OPTARROWCURSOR) */
220 + if (i == menu->current)
222 + SETCOLOR (MT_COLOR_INDICATOR);
223 + BKGDSET (MT_COLOR_INDICATOR);
226 + attrset (menu->color (i));
228 + move(row + menu->offset, col * (COLS / menu->columns));
230 + print_enriched_string (menu->color(i), (unsigned char *) buf,
231 + i != menu->current);
233 + SETCOLOR (MT_COLOR_NORMAL);
234 + BKGDSET (MT_COLOR_NORMAL);
241 + move(row + menu->offset, col); clrtoeol();
246 - attrset (menu->color (i));
248 - CLEARLINE (i - menu->top + menu->offset);
249 - print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
250 - SETCOLOR (MT_COLOR_NORMAL);
251 - BKGDSET (MT_COLOR_NORMAL);
255 - CLEARLINE (i - menu->top + menu->offset);
261 void menu_redraw_motion (MUTTMENU *menu)
270 menu->redraw &= ~REDRAW_MOTION;
274 - move (menu->oldcurrent + menu->offset - menu->top, 0);
276 + menu_item_pos(menu, menu->oldcurrent, &row, &col);
277 + move(row + menu->offset, col * (COLS / menu->columns));
278 SETCOLOR (MT_COLOR_NORMAL);
279 BKGDSET (MT_COLOR_NORMAL);
281 @@ -270,16 +290,18 @@
283 if (menu->redraw & REDRAW_MOTION_RESYNCH)
286 + move(row + menu->offset, col * (COLS / menu->columns));
287 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
288 - menu_pad_string (buf, sizeof (buf));
289 - move (menu->oldcurrent + menu->offset - menu->top, 3);
290 + menu_pad_string (menu, buf, sizeof (buf));
291 + move(row + menu->offset, col * COLS / menu->columns + 3);
292 print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
293 SETCOLOR (MT_COLOR_NORMAL);
296 /* now draw it in the new location */
297 - move (menu->current + menu->offset - menu->top, 0);
299 + menu_item_pos(menu, menu->current, &row, &col);
300 + move(row + menu->offset, col * COLS / menu->columns);
301 SETCOLOR (MT_COLOR_INDICATOR);
303 SETCOLOR (MT_COLOR_NORMAL);
304 @@ -288,17 +310,19 @@
306 /* erase the current indicator */
307 attrset (menu->color (menu->oldcurrent));
309 + move(row + menu->offset, col * (COLS / menu->columns));
310 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
311 - menu_pad_string (buf, sizeof (buf));
312 + menu_pad_string (menu, buf, sizeof (buf));
313 print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
316 + menu_item_pos(menu, menu->current, &row, &col);
317 /* now draw the new one to reflect the change */
318 menu_make_entry (buf, sizeof (buf), menu, menu->current);
319 - menu_pad_string (buf, sizeof (buf));
320 + menu_pad_string (menu, buf, sizeof (buf));
321 SETCOLOR (MT_COLOR_INDICATOR);
322 BKGDSET (MT_COLOR_INDICATOR);
323 - CLEARLINE (menu->current - menu->top + menu->offset);
324 + move(row + menu->offset, col * (COLS / menu->columns));
325 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
326 SETCOLOR (MT_COLOR_NORMAL);
327 BKGDSET (MT_COLOR_NORMAL);
328 @@ -309,21 +333,22 @@
329 void menu_redraw_current (MUTTMENU *menu)
334 - move (menu->current + menu->offset - menu->top, 0);
335 menu_make_entry (buf, sizeof (buf), menu, menu->current);
336 - menu_pad_string (buf, sizeof (buf));
337 + menu_pad_string (menu, buf, sizeof (buf));
339 + menu_item_pos(menu, menu->current, &row, &col);
340 if (option (OPTARROWCURSOR))
342 int attr = menu->color (menu->current);
345 + move(row + menu->offset, col * (COLS / menu->columns));
346 SETCOLOR (MT_COLOR_INDICATOR);
350 - menu_pad_string (buf, sizeof (buf));
351 + menu_pad_string (menu, buf, sizeof (buf));
352 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 1);
353 SETCOLOR (MT_COLOR_NORMAL);
357 SETCOLOR (MT_COLOR_INDICATOR);
358 BKGDSET (MT_COLOR_INDICATOR);
360 + move(row + menu->offset, col * (COLS / menu->columns));
361 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
362 SETCOLOR (MT_COLOR_NORMAL);
363 BKGDSET (MT_COLOR_NORMAL);
364 @@ -360,18 +385,18 @@
366 void menu_check_recenter (MUTTMENU *menu)
368 - if (menu->max <= menu->pagelen && menu->top != 0)
369 + if (menu->max <= menu->pagelen * menu->columns && menu->top != 0)
372 set_option (OPTNEEDREDRAW);
373 menu->redraw |= REDRAW_INDEX;
375 - else if (menu->current >= menu->top + menu->pagelen)
376 + else if (menu->current >= menu->top + menu->pagelen * menu->columns)
378 if (option (OPTMENUSCROLL) || (menu->pagelen <= 0))
379 - menu->top = menu->current - menu->pagelen + 1;
380 + menu->top = menu->current - menu->pagelen * menu->columns + 1;
382 - menu->top += menu->pagelen * ((menu->current - menu->top) / menu->pagelen);
383 + menu->top += menu->pagelen * menu->columns * ((menu->current - menu->top) / (menu->pagelen * menu->columns));
384 menu->redraw |= REDRAW_INDEX;
386 else if (menu->current < menu->top)
388 menu->top = menu->current;
391 - menu->top -= menu->pagelen * ((menu->top + menu->pagelen - 1 - menu->current) / menu->pagelen);
392 + menu->top -= menu->pagelen * menu->columns * ((menu->top + menu->pagelen - 1 - menu->current) / menu->pagelen);
397 p->pagelen = PAGELEN;
398 p->color = default_color;
399 p->search = menu_search_generic;