1 Anyway, here's patch-1.5.8.hr.sensible_browser_position.3:
3 --- mutt-1.5.8/menu.c.orig 2005-02-12 21:01:55.000000000 +0100
4 +++ mutt-1.5.8/menu.c 2005-03-09 16:39:49.000000000 +0100
7 int mutt_menuLoop (MUTTMENU *menu)
9 + static int last_position = -1;
12 + if (menu->is_mailbox_list && last_position >= 0)
13 + menu->current = last_position;
17 if (option (OPTMENUCALLER))
22 + if (menu->is_mailbox_list)
23 + last_position = menu->current;
27 --- mutt-1.5.8/browser.c.orig 2005-02-03 19:47:52.000000000 +0100
28 +++ mutt-1.5.8/browser.c 2005-03-09 16:48:31.000000000 +0100
33 +static char OldLastDir[_POSIX_PATH_MAX] = "";
34 static char LastDir[_POSIX_PATH_MAX] = "";
35 static char LastDirBackup[_POSIX_PATH_MAX] = "";
42 + menu->is_mailbox_list = 1;
43 snprintf (title, titlelen, _("Mailboxes [%d]"), mutt_buffy_check (0));
47 + menu->is_mailbox_list = 0;
48 strfcpy (path, LastDir, sizeof (path));
49 mutt_pretty_mailbox (path);
51 - if (state->imap_browse && option (OPTIMAPLSUB))
52 - snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
53 - path, NONULL (Mask.pattern));
55 + if (state->imap_browse && option (OPTIMAPLSUB))
56 + snprintf (title, titlelen, _("Subscribed [%s], File mask: %s"),
57 + path, NONULL (Mask.pattern));
60 - snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
61 - path, NONULL(Mask.pattern));
63 + char *p = strrchr (OldLastDir, '/');
64 + if (p && p - OldLastDir == mutt_strlen (LastDir) &&
65 + mutt_strncmp (LastDir, OldLastDir, p - OldLastDir) == 0)
67 + /* If we get here, it means that LastDir is the parent directory of
68 + * OldLastDir. I.e., we're returning from a subdirectory, and we want
69 + * to position the cursor on the directory we're returning from. */
71 + for (i = 0; i < state->entrymax; i++)
72 + if (mutt_strcmp (state->entry[i].name, p + 1) == 0)
75 + snprintf (title, titlelen, _("Directory [%s], File mask: %s"),
76 + path, NONULL(Mask.pattern));
80 menu->redraw = REDRAW_FULL;
86 - char OldLastDir[_POSIX_PATH_MAX];
88 /* save the old directory */
89 strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
90 --- mutt-1.5.8/mutt_menu.h.orig 2003-10-04 21:29:27.000000000 +0200
91 +++ mutt-1.5.8/mutt_menu.h 2005-03-09 16:39:49.000000000 +0100
93 int offset; /* which screen row to start the index */
94 int pagelen; /* number of entries per screen */
96 + int is_mailbox_list;
98 /* Setting dialog != NULL overrides normal menu behaviour.
99 * In dialog mode menubar is hidden and prompt keys are checked before