NeoMutt  2025-09-05-55-g97fc89
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_browser.c
Go to the documentation of this file.
1
30
75
76#include "config.h"
77#include <dirent.h>
78#include <errno.h>
79#include <limits.h>
80#include <stdbool.h>
81#include <stdio.h>
82#include <string.h>
83#include <sys/stat.h>
84#include "mutt/lib.h"
85#include "config/lib.h"
86#include "email/lib.h"
87#include "core/lib.h"
88#include "conn/lib.h"
89#include "gui/lib.h"
90#include "lib.h"
91#include "expando/lib.h"
92#include "imap/lib.h"
93#include "key/lib.h"
94#include "menu/lib.h"
95#include "nntp/lib.h"
96#include "expando.h"
97#include "functions.h"
98#include "globals.h"
99#include "mutt_logging.h"
100#include "mutt_mailbox.h"
101#include "muttlib.h"
102#include "mx.h"
103#include "nntp/adata.h" // IWYU pragma: keep
104#include "nntp/mdata.h" // IWYU pragma: keep
105#include "private_data.h"
106#include "sort.h"
107
109static const struct Mapping FolderHelp[] = {
110 // clang-format off
111 { N_("Exit"), OP_EXIT },
112 { N_("Chdir"), OP_CHANGE_DIRECTORY },
113 { N_("Goto"), OP_BROWSER_GOTO_FOLDER },
114 { N_("Mask"), OP_ENTER_MASK },
115 { N_("Help"), OP_HELP },
116 { NULL, 0 },
117 // clang-format on
118};
119
121static const struct Mapping FolderNewsHelp[] = {
122 // clang-format off
123 { N_("Exit"), OP_EXIT },
124 { N_("List"), OP_TOGGLE_MAILBOXES },
125 { N_("Subscribe"), OP_BROWSER_SUBSCRIBE },
126 { N_("Unsubscribe"), OP_BROWSER_UNSUBSCRIBE },
127 { N_("Catchup"), OP_CATCHUP },
128 { N_("Mask"), OP_ENTER_MASK },
129 { N_("Help"), OP_HELP },
130 { NULL, 0 },
131 // clang-format on
132};
133
135struct Buffer LastDir = { 0 };
137struct Buffer LastDirBackup = { 0 };
138
144static void init_lastdir(void)
145{
146 static bool done = false;
147 if (!done)
148 {
151 done = true;
152 }
153}
154
163
171bool link_is_dir(const char *folder, const char *path)
172{
173 struct stat st = { 0 };
174 bool rc = false;
175
176 struct Buffer *fullpath = buf_pool_get();
177 buf_concat_path(fullpath, folder, path);
178
179 if (stat(buf_string(fullpath), &st) == 0)
180 rc = S_ISDIR(st.st_mode);
181
182 buf_pool_release(&fullpath);
183
184 return rc;
185}
186
197void browser_add_folder(const struct Menu *menu, struct BrowserState *state,
198 const char *name, const char *desc,
199 const struct stat *st, struct Mailbox *m, void *data)
200{
201 if ((!menu || state->is_mailbox_list) && m && !m->visible)
202 {
203 return;
204 }
205
206 struct FolderFile ff = { 0 };
207
208 if (st)
209 {
210 ff.mode = st->st_mode;
211 ff.mtime = st->st_mtime;
212 ff.size = st->st_size;
213 ff.gid = st->st_gid;
214 ff.uid = st->st_uid;
215 ff.nlink = st->st_nlink;
216 ff.local = true;
217 }
218 else
219 {
220 ff.local = false;
221 }
222
223 if (m)
224 {
225 ff.has_mailbox = true;
226 ff.gen = m->gen;
227 ff.has_new_mail = m->has_new;
228 ff.msg_count = m->msg_count;
229 ff.msg_unread = m->msg_unread;
230 ff.notify_user = m->notify_user;
232 }
233
234 ff.name = mutt_str_dup(name);
235 ff.desc = mutt_str_dup(desc ? desc : name);
236 ff.imap = false;
237 if (OptNews)
238 ff.nd = data;
239
240 ARRAY_ADD(&state->entry, ff);
241}
242
247void init_state(struct BrowserState *state)
248{
249 ARRAY_INIT(&state->entry);
250 ARRAY_RESERVE(&state->entry, 256);
251 state->imap_browse = false;
252}
253
264int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state,
265 const char *dirname, const char *prefix)
266{
267 int rc = -1;
268 struct Buffer *buf = buf_pool_get();
269 if (OptNews)
270 {
272
273 init_state(state);
274
275 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
276 for (unsigned int i = 0; i < adata->groups_num; i++)
277 {
278 struct NntpMboxData *mdata = adata->groups_list[i];
279 if (!mdata)
280 continue;
281 if (prefix && *prefix && !mutt_str_startswith(mdata->group, prefix))
282 continue;
283 if (!mutt_regex_match(c_mask, mdata->group))
284 {
285 continue;
286 }
287 browser_add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata);
288 }
289 }
290 else
291 {
292 struct stat st = { 0 };
293 DIR *dir = NULL;
294 struct dirent *de = NULL;
295
296 while (stat(dirname, &st) == -1)
297 {
298 if (errno == ENOENT)
299 {
300 /* The last used directory is deleted, try to use the parent dir. */
301 char *c = strrchr(dirname, '/');
302
303 if (c && (c > dirname))
304 {
305 *c = '\0';
306 continue;
307 }
308 }
309 mutt_perror("%s", dirname);
310 goto ed_out;
311 }
312
313 if (!S_ISDIR(st.st_mode))
314 {
315 mutt_error(_("%s is not a directory"), dirname);
316 goto ed_out;
317 }
318
319 if (m)
321
322 dir = mutt_file_opendir(dirname, MUTT_OPENDIR_NONE);
323 if (!dir)
324 {
325 mutt_perror("%s", dirname);
326 goto ed_out;
327 }
328
329 init_state(state);
330
331 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
333
334 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
335 while ((de = readdir(dir)))
336 {
337 if (mutt_str_equal(de->d_name, "."))
338 continue; /* we don't need . */
339
340 if (prefix && *prefix && !mutt_str_startswith(de->d_name, prefix))
341 {
342 continue;
343 }
344 if (!mutt_regex_match(c_mask, de->d_name))
345 {
346 continue;
347 }
348
349 buf_concat_path(buf, dirname, de->d_name);
350 if (lstat(buf_string(buf), &st) == -1)
351 continue;
352
353 /* No size for directories or symlinks */
354 if (S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))
355 st.st_size = 0;
356 else if (!S_ISREG(st.st_mode))
357 continue;
358
359 struct MailboxNode *np = NULL;
360 STAILQ_FOREACH(np, &ml, entries)
361 {
363 break;
364 }
365
366 if (np && m && m->poll_new_mail && mutt_str_equal(np->mailbox->realpath, m->realpath))
367 {
368 np->mailbox->msg_count = m->msg_count;
369 np->mailbox->msg_unread = m->msg_unread;
370 }
371 browser_add_folder(menu, state, de->d_name, NULL, &st, np ? np->mailbox : NULL, NULL);
372 }
374 closedir(dir);
375 }
376 browser_sort(state);
377 rc = 0;
378ed_out:
379 buf_pool_release(&buf);
380 return rc;
381}
382
391int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
392{
393 struct stat st = { 0 };
394 struct Buffer *md = NULL;
395 struct Buffer *mailbox = NULL;
396
397 if (OptNews)
398 {
400
401 init_state(state);
402
403 const bool c_show_only_unread = cs_subset_bool(NeoMutt->sub, "show_only_unread");
404 for (unsigned int i = 0; i < adata->groups_num; i++)
405 {
406 struct NntpMboxData *mdata = adata->groups_list[i];
407 if (mdata && (mdata->has_new_mail ||
408 (mdata->subscribed && (mdata->unread || !c_show_only_unread))))
409 {
410 browser_add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata);
411 }
412 }
413 }
414 else
415 {
416 init_state(state);
417
419 return -1;
420 mailbox = buf_pool_get();
421 md = buf_pool_get();
422
424
425 struct MailboxList ml = STAILQ_HEAD_INITIALIZER(ml);
427 struct MailboxNode *np = NULL;
428 const bool c_browser_abbreviate_mailboxes = cs_subset_bool(NeoMutt->sub, "browser_abbreviate_mailboxes");
429
430 STAILQ_FOREACH(np, &ml, entries)
431 {
432 if (!np->mailbox)
433 continue;
434
435 if (m && m->poll_new_mail && mutt_str_equal(np->mailbox->realpath, m->realpath))
436 {
437 np->mailbox->msg_count = m->msg_count;
438 np->mailbox->msg_unread = m->msg_unread;
439 }
440
442 if (c_browser_abbreviate_mailboxes)
444
445 switch (np->mailbox->type)
446 {
447 case MUTT_IMAP:
448 case MUTT_POP:
450 np->mailbox->name, NULL, np->mailbox, NULL);
451 continue;
452 case MUTT_NOTMUCH:
453 case MUTT_NNTP:
454 browser_add_folder(menu, state, mailbox_path(np->mailbox),
455 np->mailbox->name, NULL, np->mailbox, NULL);
456 continue;
457 default: /* Continue */
458 break;
459 }
460
461 if (lstat(mailbox_path(np->mailbox), &st) == -1)
462 continue;
463
464 if ((!S_ISREG(st.st_mode)) && (!S_ISDIR(st.st_mode)) && (!S_ISLNK(st.st_mode)))
465 continue;
466
467 if (np->mailbox->type == MUTT_MAILDIR)
468 {
469 struct stat st2 = { 0 };
470
471 buf_printf(md, "%s/new", mailbox_path(np->mailbox));
472 if (stat(buf_string(md), &st) < 0)
473 st.st_mtime = 0;
474 buf_printf(md, "%s/cur", mailbox_path(np->mailbox));
475 if (stat(buf_string(md), &st2) < 0)
476 st2.st_mtime = 0;
477 if (st2.st_mtime > st.st_mtime)
478 st.st_mtime = st2.st_mtime;
479 }
480
481 browser_add_folder(menu, state, buf_string(mailbox), np->mailbox->name,
482 &st, np->mailbox, NULL);
483 }
485 }
486 browser_sort(state);
487
488 buf_pool_release(&mailbox);
489 buf_pool_release(&md);
490 return 0;
491}
492
496static int select_file_search(struct Menu *menu, regex_t *rx, int line)
497{
498 struct BrowserPrivateData *priv = menu->mdata;
499 struct BrowserEntryArray *entry = &priv->state.entry;
500 if (OptNews)
501 return regexec(rx, ARRAY_GET(entry, line)->desc, 0, NULL, 0);
502 struct FolderFile *ff = ARRAY_GET(entry, line);
503 char *search_on = ff->desc ? ff->desc : ff->name;
504
505 return regexec(rx, search_on, 0, NULL, 0);
506}
507
513static int folder_make_entry(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
514{
515 struct BrowserPrivateData *priv = menu->mdata;
516 struct BrowserState *bstate = &priv->state;
517 struct BrowserEntryArray *entry = &bstate->entry;
518 struct Folder folder = {
519 .ff = ARRAY_GET(entry, line),
520 .num = line,
521 };
522
523 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
524 if (c_arrow_cursor)
525 {
526 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
527 if (max_cols > 0)
528 max_cols -= (mutt_strwidth(c_arrow_string) + 1);
529 }
530
531 if (OptNews)
532 {
533 const struct Expando *c_group_index_format = cs_subset_expando(NeoMutt->sub, "group_index_format");
534 return expando_filter(c_group_index_format, GroupIndexRenderCallbacks, &folder,
535 MUTT_FORMAT_ARROWCURSOR, max_cols, NeoMutt->env, buf);
536 }
537
538 if (bstate->is_mailbox_list)
539 {
540 const struct Expando *c_mailbox_folder_format = cs_subset_expando(NeoMutt->sub, "mailbox_folder_format");
541 return expando_filter(c_mailbox_folder_format, FolderRenderCallbacks, &folder,
542 MUTT_FORMAT_ARROWCURSOR, max_cols, NeoMutt->env, buf);
543 }
544
545 const struct Expando *c_folder_format = cs_subset_expando(NeoMutt->sub, "folder_format");
546 return expando_filter(c_folder_format, FolderRenderCallbacks, &folder,
547 MUTT_FORMAT_ARROWCURSOR, max_cols, NeoMutt->env, buf);
548}
549
558void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
559{
560 menu->top = 0;
561 /* Reset menu position to 1.
562 * We do not risk overflow as the init_menu function changes
563 * current if it is bigger than state->entrylen. */
564 if (!ARRAY_EMPTY(&state->entry) &&
565 (mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "..") ||
566 mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "../")))
567 {
568 /* Skip the first entry, unless there's only one entry. */
569 menu_set_index(menu, (menu->max > 1));
570 }
571 else
572 {
573 menu_set_index(menu, 0);
574 }
575}
576
584void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m,
585 struct MuttWindow *sbar)
586{
587 char title[256] = { 0 };
588 menu->max = ARRAY_SIZE(&state->entry);
589
590 int index = menu_get_index(menu);
591 if (index >= menu->max)
592 menu_set_index(menu, menu->max - 1);
593 if (index < 0)
594 menu_set_index(menu, 0);
595 if (menu->top > index)
596 menu->top = 0;
597
598 menu->num_tagged = 0;
599
600 if (OptNews)
601 {
602 if (state->is_mailbox_list)
603 {
604 snprintf(title, sizeof(title), _("Subscribed newsgroups"));
605 }
606 else
607 {
608 snprintf(title, sizeof(title), _("Newsgroups on server [%s]"),
609 CurrentNewsSrv->conn->account.host);
610 }
611 }
612 else
613 {
614 if (state->is_mailbox_list)
615 {
616 snprintf(title, sizeof(title), _("Mailboxes [%d]"),
618 }
619 else
620 {
621 struct Buffer *path = buf_pool_get();
622 buf_copy(path, &LastDir);
623 buf_pretty_mailbox(path);
624 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
625 const bool c_imap_list_subscribed = cs_subset_bool(NeoMutt->sub, "imap_list_subscribed");
626 if (state->imap_browse && c_imap_list_subscribed)
627 {
628 snprintf(title, sizeof(title), _("Subscribed [%s], File mask: %s"),
629 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
630 }
631 else
632 {
633 snprintf(title, sizeof(title), _("Directory [%s], File mask: %s"),
634 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
635 }
636 buf_pool_release(&path);
637 }
638 }
639 sbar_set_title(sbar, title);
640
641 /* Browser tracking feature.
642 * The goal is to highlight the good directory if LastDir is the parent dir
643 * of LastDirBackup (this occurs mostly when one hit "../"). It should also work
644 * properly when the user is in examine_mailboxes-mode. */
646 {
647 char target_dir[PATH_MAX] = { 0 };
648
649 /* Check what kind of dir LastDirBackup is. */
651 {
652 mutt_str_copy(target_dir, buf_string(&LastDirBackup), sizeof(target_dir));
653 imap_clean_path(target_dir, sizeof(target_dir));
654 }
655 else
656 {
657 mutt_str_copy(target_dir, strrchr(buf_string(&LastDirBackup), '/') + 1,
658 sizeof(target_dir));
659 }
660
661 /* If we get here, it means that LastDir is the parent directory of
662 * LastDirBackup. I.e., we're returning from a subdirectory, and we want
663 * to position the cursor on the directory we're returning from. */
664 bool matched = false;
665 struct FolderFile *ff = NULL;
666 ARRAY_FOREACH(ff, &state->entry)
667 {
668 if (mutt_str_equal(ff->name, target_dir))
669 {
670 menu_set_index(menu, ARRAY_FOREACH_IDX_ff);
671 matched = true;
672 break;
673 }
674 }
675 if (!matched)
676 browser_highlight_default(state, menu);
677 }
678 else
679 {
680 browser_highlight_default(state, menu);
681 }
682
684}
685
689static int file_tag(struct Menu *menu, int sel, int act)
690{
691 struct BrowserPrivateData *priv = menu->mdata;
692 struct BrowserEntryArray *entry = &priv->state.entry;
693 struct FolderFile *ff = ARRAY_GET(entry, sel);
694 if (S_ISDIR(ff->mode) ||
695 (S_ISLNK(ff->mode) && link_is_dir(buf_string(&LastDir), ff->name)))
696 {
697 mutt_error(_("Can't attach a directory"));
698 return 0;
699 }
700
701 bool ot = ff->tagged;
702 ff->tagged = ((act >= 0) ? act : !ff->tagged);
703
704 return ff->tagged - ot;
705}
706
711{
712 if (nc->event_type != NT_CONFIG)
713 return 0;
714 if (!nc->global_data || !nc->event_data)
715 return -1;
716
717 struct EventConfig *ev_c = nc->event_data;
718
719 struct BrowserPrivateData *priv = nc->global_data;
720 struct Menu *menu = priv->menu;
721
722 if (mutt_str_equal(ev_c->name, "browser_sort_dirs_first"))
723 {
724 struct BrowserState *state = &priv->state;
725 browser_sort(state);
726 browser_highlight_default(state, menu);
727 }
728 else if (!mutt_str_equal(ev_c->name, "browser_abbreviate_mailboxes") &&
729 !mutt_str_equal(ev_c->name, "browser_sort") &&
730 !mutt_str_equal(ev_c->name, "date_format") &&
731 !mutt_str_equal(ev_c->name, "folder") &&
732 !mutt_str_equal(ev_c->name, "folder_format") &&
733 !mutt_str_equal(ev_c->name, "group_index_format") &&
734 !mutt_str_equal(ev_c->name, "mailbox_folder_format"))
735 {
736 return 0;
737 }
738
740 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC, MENU_REDRAW_FULL\n");
741
742 return 0;
743}
744
751{
752 if (nc->event_type != NT_MAILBOX)
753 return 0;
755 return 0;
756 if (!nc->global_data || !nc->event_data)
757 return -1;
758
759 struct BrowserPrivateData *priv = nc->global_data;
760
761 struct BrowserState *state = &priv->state;
762 if (state->is_mailbox_list)
763 {
764 struct EventMailbox *ev_m = nc->event_data;
765 struct Mailbox *m = ev_m->mailbox;
766 struct FolderFile *ff = NULL;
767 ARRAY_FOREACH(ff, &state->entry)
768 {
769 if (ff->gen != m->gen)
770 continue;
771
772 ff->has_new_mail = m->has_new;
773 ff->msg_count = m->msg_count;
774 ff->msg_unread = m->msg_unread;
775 ff->notify_user = m->notify_user;
777 mutt_str_replace(&ff->desc, m->name);
778 break;
779 }
780 }
781
783 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC, MENU_REDRAW_FULL\n");
784
785 return 0;
786}
787
796{
797 if (nc->event_type != NT_WINDOW)
798 return 0;
799 if (!nc->global_data || !nc->event_data)
800 return -1;
802 return 0;
803
804 struct BrowserPrivateData *priv = nc->global_data;
805 struct MuttWindow *win_menu = priv->menu->win;
806
807 struct EventWindow *ev_w = nc->event_data;
808 if (ev_w->win != win_menu)
809 return 0;
810
814
815 mutt_debug(LL_DEBUG5, "window delete done\n");
816 return 0;
817}
818
829void mutt_browser_select_dir(const char *f)
830{
831 init_lastdir();
832
834
835 /* Method that will fetch the parent path depending on the type of the path. */
836 char buf[PATH_MAX] = { 0 };
837 mutt_get_parent_path(buf_string(&LastDirBackup), buf, sizeof(buf));
838 buf_strcpy(&LastDir, buf);
839}
840
852void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m,
853 char ***files, int *numfiles)
854{
856 priv->file = file;
857 priv->mailbox = m;
858 priv->files = files;
859 priv->numfiles = numfiles;
860 priv->multiple = (flags & MUTT_SEL_MULTI);
861 priv->folder = (flags & MUTT_SEL_FOLDER);
862 priv->state.is_mailbox_list = (flags & MUTT_SEL_MAILBOX) && priv->folder;
863 priv->last_selected_mailbox = -1;
864
865 init_lastdir();
866
867 if (OptNews)
868 {
869 if (buf_is_empty(file))
870 {
872
873 /* default state for news reader mode is browse subscribed newsgroups */
874 priv->state.is_mailbox_list = false;
875 for (size_t i = 0; i < adata->groups_num; i++)
876 {
877 struct NntpMboxData *mdata = adata->groups_list[i];
878 if (mdata && mdata->subscribed)
879 {
880 priv->state.is_mailbox_list = true;
881 break;
882 }
883 }
884 }
885 else
886 {
887 buf_copy(priv->prefix, file);
888 }
889 }
890 else if (!buf_is_empty(file))
891 {
892 buf_expand_path(file);
893 if (imap_path_probe(buf_string(file), NULL) == MUTT_IMAP)
894 {
895 init_state(&priv->state);
896 priv->state.imap_browse = true;
897 if (imap_browse(buf_string(file), &priv->state) == 0)
898 {
900 browser_sort(&priv->state);
901 }
902 }
903 else
904 {
905 int i = buf_len(file);
906 i--;
907 for (; (i > 0) && ((buf_string(file))[i] != '/'); i--)
908 {
909 ; // do nothing
910 }
911
912 if (i > 0)
913 {
914 if ((buf_string(file))[0] == '/')
915 {
916 buf_strcpy_n(&LastDir, buf_string(file), i);
917 }
918 else
919 {
921 buf_addch(&LastDir, '/');
922 buf_addstr_n(&LastDir, buf_string(file), i);
923 }
924 }
925 else
926 {
927 if ((buf_string(file))[0] == '/')
928 buf_strcpy(&LastDir, "/");
929 else
931 }
932
933 if ((i <= 0) && (buf_string(file)[0] != '/'))
934 buf_copy(priv->prefix, file);
935 else
936 buf_strcpy(priv->prefix, buf_string(file) + i + 1);
937 priv->kill_prefix = true;
938 }
939 }
940 else
941 {
942 if (priv->folder)
943 {
944 /* Whether we use the tracking feature of the browser depends
945 * on which sort method we chose to use. This variable is defined
946 * only to help readability of the code. */
947 bool browser_track = false;
948
949 const enum EmailSortType c_browser_sort = cs_subset_sort(NeoMutt->sub, "browser_sort");
950 switch (c_browser_sort & SORT_MASK)
951 {
955 browser_track = true;
956 break;
957 }
958
959 /* We use mutt_browser_select_dir to initialize the two
960 * variables (LastDir, LastDirBackup) at the appropriate
961 * values.
962 *
963 * We do it only when LastDir is not set (first pass there)
964 * or when CurrentFolder and LastDirBackup are not the same.
965 * This code is executed only when we list files, not when
966 * we press up/down keys to navigate in a displayed list.
967 *
968 * We only do this when CurrentFolder has been set (ie, not
969 * when listing folders on startup with "neomutt -y").
970 *
971 * This tracker is only used when browser_track is true,
972 * meaning only with sort methods SUBJECT/DESC for now. */
973 if (CurrentFolder)
974 {
975 if (buf_is_empty(&LastDir))
976 {
977 /* If browsing in "local"-mode, than we chose to define LastDir to
978 * MailDir */
980 {
981 case MUTT_IMAP:
982 case MUTT_MAILDIR:
983 case MUTT_MBOX:
984 case MUTT_MH:
985 case MUTT_MMDF:
986 {
987 const char *const c_folder = cs_subset_string(NeoMutt->sub, "folder");
988 const char *const c_spool_file = cs_subset_string(NeoMutt->sub, "spool_file");
989 if (c_folder)
990 buf_strcpy(&LastDir, c_folder);
991 else if (c_spool_file)
992 mutt_browser_select_dir(c_spool_file);
993 break;
994 }
995 default:
997 break;
998 }
999 }
1001 {
1003 }
1004 }
1005
1006 /* When browser tracking feature is disabled, clear LastDirBackup */
1007 if (!browser_track)
1009 }
1010 else
1011 {
1013 }
1014
1015 if (!priv->state.is_mailbox_list &&
1017 {
1018 init_state(&priv->state);
1019 priv->state.imap_browse = true;
1021 browser_sort(&priv->state);
1022 }
1023 else
1024 {
1025 size_t i = buf_len(&LastDir);
1026 while ((i > 0) && (buf_string(&LastDir)[--i] == '/'))
1027 LastDir.data[i] = '\0';
1029 if (buf_is_empty(&LastDir))
1031 }
1032 }
1033
1034 buf_reset(file);
1035
1036 const struct Mapping *help_data = NULL;
1037
1038 if (OptNews)
1039 help_data = FolderNewsHelp;
1040 else
1041 help_data = FolderHelp;
1042
1044
1045 struct Menu *menu = sdw.menu;
1047 menu->search = select_file_search;
1048 menu->mdata = priv;
1049
1050 priv->menu = menu;
1051 if (priv->multiple)
1052 priv->menu->tag = file_tag;
1053
1054 priv->sbar = sdw.sbar;
1055
1056 struct MuttWindow *win_menu = priv->menu->win;
1057
1058 // NT_COLOR is handled by the SimpleDialog
1062
1063 struct MuttWindow *old_focus = window_set_focus(priv->menu->win);
1064
1065 if (priv->state.is_mailbox_list)
1066 {
1067 examine_mailboxes(m, NULL, &priv->state);
1068 }
1069 else if (!priv->state.imap_browse)
1070 {
1071 // examine_directory() calls browser_add_folder() which needs the menu
1072 if (examine_directory(m, priv->menu, &priv->state, buf_string(&LastDir),
1073 buf_string(priv->prefix)) == -1)
1074 {
1075 goto bail;
1076 }
1077 }
1078
1079 init_menu(&priv->state, priv->menu, m, priv->sbar);
1080
1081 // ---------------------------------------------------------------------------
1082 // Event Loop
1083 int op = OP_NULL;
1084 do
1085 {
1086 menu_tagging_dispatcher(priv->menu->win, op);
1087 window_redraw(NULL);
1088
1090 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
1091 if (op < 0)
1092 continue;
1093 if (op == OP_NULL)
1094 {
1096 continue;
1097 }
1099
1100 int rc = browser_function_dispatcher(sdw.dlg, op);
1101
1102 if (rc == FR_UNKNOWN)
1103 rc = menu_function_dispatcher(menu->win, op);
1104 if (rc == FR_UNKNOWN)
1105 rc = global_function_dispatcher(NULL, op);
1106 } while (!priv->done);
1107 // ---------------------------------------------------------------------------
1108
1109bail:
1110 window_set_focus(old_focus);
1111 simple_dialog_free(&sdw.dlg);
1113}
#define ARRAY_RESERVE(head, num)
Reserve memory for the array.
Definition array.h:189
#define ARRAY_FIRST(head)
Convenience method to get the first element.
Definition array.h:135
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition array.h:156
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:214
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition array.h:74
#define ARRAY_SIZE(head)
The number of elements stored.
Definition array.h:87
#define ARRAY_INIT(head)
Initialize an array.
Definition array.h:65
#define ARRAY_GET(head, idx)
Return the element at index.
Definition array.h:109
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
Definition browse.c:197
const struct ExpandoRenderCallback FolderRenderCallbacks[]
Callbacks for Browser Expandos.
Definition expando.c:478
Browser Expando definitions.
int browser_function_dispatcher(struct MuttWindow *win, int op)
Perform a Browser function.
Definition functions.c:1130
Browser functions.
Select a Mailbox from a list.
#define MUTT_SEL_MAILBOX
Select a mailbox.
Definition lib.h:58
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Definition sort.c:186
#define MUTT_SEL_FOLDER
Select a local directory.
Definition lib.h:60
#define MUTT_SEL_MULTI
Multi-selection is enabled.
Definition lib.h:59
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition lib.h:56
struct BrowserPrivateData * browser_private_data_new(void)
Create new Browser Data.
Private state data for the Browser.
Browser sorting functions.
@ BROWSER_SORT_ALPHA
Sort by name.
Definition sort.h:31
@ BROWSER_SORT_UNSORTED
Sort into the raw order.
Definition sort.h:37
@ BROWSER_SORT_DESC
Sort by description.
Definition sort.h:34
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
size_t buf_addstr_n(struct Buffer *buf, const char *s, size_t len)
Add a string to a Buffer, expanding it if necessary.
Definition buffer.c:96
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
Definition buffer.c:491
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition buffer.c:377
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition buffer.c:76
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition buffer.c:291
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
Definition buffer.c:182
size_t buf_strcpy_n(struct Buffer *buf, const char *s, size_t len)
Copy a string into a Buffer.
Definition buffer.c:416
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
Definition buffer.c:241
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition buffer.c:601
size_t buf_concat_path(struct Buffer *buf, const char *dir, const char *fname)
Join a directory name and a filename.
Definition buffer.c:509
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
Definition buffer.c:337
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
Definition helpers.c:217
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition helpers.c:266
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando config item by name.
Convenience wrapper for the config headers.
#define SORT_MASK
Mask for the sort id.
Definition sort.h:38
Connection Library.
Convenience wrapper for the core headers.
@ NT_MAILBOX_DELETE
Mailbox is about to be deleted.
Definition mailbox.h:183
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition mailbox.h:223
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition mailbox.h:51
@ MUTT_MMDF
'mmdf' Mailbox type
Definition mailbox.h:46
@ MUTT_POP
'POP3' Mailbox type
Definition mailbox.h:52
@ MUTT_MH
'MH' Mailbox type
Definition mailbox.h:47
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition mailbox.h:49
@ MUTT_IMAP
'IMAP' Mailbox type
Definition mailbox.h:50
@ MUTT_MBOX
'mbox' Mailbox type
Definition mailbox.h:45
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Definition mailbox.h:42
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition mailbox.h:48
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition curs_lib.c:445
@ FR_UNKNOWN
Unknown function.
Definition dispatcher.h:33
int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *dirname, const char *prefix)
Get list of all files/newsgroups with mask.
void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar)
Set up a new menu.
static void init_lastdir(void)
Initialise the browser directories.
static const struct Mapping FolderNewsHelp[]
Help Bar for the NNTP Mailbox browser dialog.
struct Buffer LastDir
Browser: previous selected directory.
void mutt_browser_select_dir(const char *f)
Remember the last directory selected.
void init_state(struct BrowserState *state)
Initialise a browser state.
struct Buffer LastDirBackup
Browser: backup copy of the current directory.
static const struct Mapping FolderHelp[]
Help Bar for the File/Dir/Mailbox browser dialog.
void browser_add_folder(const struct Menu *menu, struct BrowserState *state, const char *name, const char *desc, const struct stat *st, struct Mailbox *m, void *data)
Add a folder to the browser list.
void mutt_browser_cleanup(void)
Clean up working Buffers.
void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
Decide which browser item should be highlighted.
int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
Get list of mailboxes/subscribed newsgroups.
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
Structs that make up an email.
EmailSortType
Methods for sorting Emails.
Definition sort.h:53
int expando_filter(const struct Expando *exp, const struct ExpandoRenderCallback *erc, void *data, MuttFormatFlags flags, int max_cols, char **env_list, struct Buffer *buf)
Render an Expando and run the result through a filter.
Definition filter.c:138
Parse Expando string.
const struct ExpandoRenderCallback GroupIndexRenderCallbacks[]
Callbacks for Nntp Browser Expandos.
DIR * mutt_file_opendir(const char *path, enum MuttOpenDirMode mode)
Open a directory.
Definition file.c:542
@ MUTT_OPENDIR_NONE
Plain opendir()
Definition file.h:63
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
Definition get.c:537
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
Definition get.c:294
bool OptNews
(pseudo) used to change reader mode
Definition globals.c:64
char * CurrentFolder
Currently selected mailbox.
Definition globals.c:39
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
Definition tagging.c:230
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
Definition global.c:181
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
Definition functions.c:319
void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m, char ***files, int *numfiles)
Let the user select a file -.
#define mutt_error(...)
Definition logging2.h:93
#define mutt_debug(LEVEL,...)
Definition logging2.h:90
#define mutt_perror(...)
Definition logging2.h:94
static int folder_make_entry(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
Format a Folder for the Menu - Implements Menu::make_entry() -.
static int select_file_search(struct Menu *menu, regex_t *rx, int line)
Menu search callback for matching files - Implements Menu::search() -.
static int file_tag(struct Menu *menu, int sel, int act)
Tag an entry in the menu - Implements Menu::tag() -.
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox?
Definition imap.c:2349
static int browser_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
static int browser_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
static int browser_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
void browser_private_data_free(struct BrowserPrivateData **ptr)
Free Private Browser Data - Implements MuttWindow::wdata_free() -.
Convenience wrapper for the gui headers.
void simple_dialog_free(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition simple.c:168
struct SimpleDialogWindows simple_dialog_new(enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
Create a simple index Dialog.
Definition simple.c:132
IMAP network mailbox.
void imap_clean_path(char *path, size_t plen)
Cleans an IMAP path using imap_fix_path.
Definition util.c:190
Manage keymappings.
#define GETCH_NO_FLAGS
No flags are set.
Definition lib.h:53
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:48
@ LL_DEBUG1
Log at debug level 1.
Definition logging2.h:44
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition lib.h:59
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition menu.c:184
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:160
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:174
Convenience wrapper for the library headers.
#define N_(a)
Definition message.h:32
#define _(a)
Definition message.h:28
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition notify.c:230
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition notify.c:191
const char * mutt_path_getcwd(struct Buffer *cwd)
Get the current working directory.
Definition path.c:476
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
Definition regex.c:613
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:255
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:660
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition string.c:232
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition string.c:581
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition string.c:282
#define PATH_MAX
Definition mutt.h:42
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
NeoMutt Logging.
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
Mailbox helper functions.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
@ WT_DLG_BROWSER
Browser Dialog, dlg_browser()
Definition mutt_window.h:81
@ NT_WINDOW_DELETE
Window is about to be deleted.
void mutt_get_parent_path(const char *path, char *buf, size_t buflen)
Find the parent of a path (or mailbox)
Definition muttlib.c:921
void buf_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition muttlib.c:518
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Definition muttlib.c:314
Some miscellaneous functions.
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Definition mx.c:1326
API for mailboxes.
#define MUTT_MAILBOX_CHECK_NO_FLAGS
No flags are set.
Definition mxapi.h:50
void neomutt_mailboxlist_clear(struct MailboxList *ml)
Free a Mailbox List.
Definition neomutt.c:173
size_t neomutt_mailboxlist_get_all(struct MailboxList *head, struct NeoMutt *n, enum MailboxType type)
Get a List of all Mailboxes.
Definition neomutt.c:196
Nntp-specific Account data.
Usenet network mailbox type; talk to an NNTP server.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition nntp.c:76
Nntp-specific Mailbox data.
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition notify_type.h:57
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition notify_type.h:43
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
Definition notify_type.h:49
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition opcodes.c:48
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:82
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:96
#define STAILQ_HEAD_INITIALIZER(head)
Definition queue.h:324
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
#define TAILQ_EMPTY(head)
Definition queue.h:778
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition render.h:37
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
Definition sbar.c:227
#define NONULL(x)
Definition string2.h:43
void * adata
Private data (for Mailbox backends)
Definition account.h:42
Private state data for the Browser.
char *** files
Array of selected files.
struct Menu * menu
Menu.
struct Buffer * prefix
Folder prefix string.
bool kill_prefix
Prefix is in use.
bool done
Should we close the Dialog?
bool folder
Select folders.
int last_selected_mailbox
Index of last selected Mailbox.
int * numfiles
Number of selected files.
struct Mailbox * mailbox
Mailbox.
struct BrowserState state
State containing list of files/dir/mailboxes.
struct Buffer * file
Buffer for the result.
bool multiple
Allow multiple selections.
struct MuttWindow * sbar
Status Bar.
State of the file/mailbox browser.
Definition lib.h:144
char * folder
Folder name.
Definition lib.h:147
bool is_mailbox_list
Viewing mailboxes.
Definition lib.h:148
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition lib.h:145
bool imap_browse
IMAP folder.
Definition lib.h:146
String manipulation buffer.
Definition buffer.h:36
char * data
Pointer to data.
Definition buffer.h:37
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
Definition subset.h:51
A config-change event.
Definition subset.h:70
const char * name
Name of config item that changed.
Definition subset.h:72
An Event that happened to a Mailbox.
Definition mailbox.h:199
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition mailbox.h:200
An Event that happened to a Window.
struct MuttWindow * win
Window that changed.
WindowNotifyFlags flags
Attributes of Window that changed.
Parsed Expando trees.
Definition expando.h:41
Browser entry representing a folder/dir.
Definition lib.h:78
bool imap
This is an IMAP folder.
Definition lib.h:95
bool has_mailbox
This is a mailbox.
Definition lib.h:98
char * name
Name of file/dir/mailbox.
Definition lib.h:86
uid_t uid
File's User ID.
Definition lib.h:82
bool tagged
Folder is tagged.
Definition lib.h:102
gid_t gid
File's Group ID.
Definition lib.h:83
bool has_new_mail
true if mailbox has "new mail"
Definition lib.h:89
bool poll_new_mail
Check mailbox for new mail.
Definition lib.h:101
bool notify_user
User will be notified of new mail.
Definition lib.h:100
nlink_t nlink
Number of hard links.
Definition lib.h:84
char * desc
Description of mailbox.
Definition lib.h:87
struct NntpMboxData * nd
Extra NNTP data.
Definition lib.h:103
off_t size
File size.
Definition lib.h:80
int gen
Unique id, used for (un)sorting.
Definition lib.h:105
bool local
Folder is on local filesystem.
Definition lib.h:99
time_t mtime
Modification time.
Definition lib.h:81
int msg_count
total number of messages
Definition lib.h:90
mode_t mode
File permissions.
Definition lib.h:79
int msg_unread
number of unread messages
Definition lib.h:91
A folder/dir in the browser.
Definition lib.h:69
List of Mailboxes.
Definition mailbox.h:166
struct Mailbox * mailbox
Mailbox in the list.
Definition mailbox.h:167
A mailbox.
Definition mailbox.h:79
bool has_new
Mailbox has new mail.
Definition mailbox.h:85
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition mailbox.h:81
int msg_count
Total number of messages.
Definition mailbox.h:88
enum MailboxType type
Mailbox type.
Definition mailbox.h:102
bool poll_new_mail
Check for new mail.
Definition mailbox.h:115
void * mdata
Driver specific data.
Definition mailbox.h:132
char * name
A short name for the Mailbox.
Definition mailbox.h:82
bool notify_user
Notify the user of new mail.
Definition mailbox.h:113
bool visible
True if a result of "mailboxes".
Definition mailbox.h:130
int msg_unread
Number of unread messages.
Definition mailbox.h:89
int gen
Generation number, for sorting.
Definition mailbox.h:147
Mapping between user-readable string and a constant.
Definition mapping.h:33
Definition lib.h:79
struct MuttWindow * win
Window holding the Menu.
Definition lib.h:86
int num_tagged
Number of tagged entries.
Definition lib.h:93
int(* search)(struct Menu *menu, regex_t *rx, int line)
Definition lib.h:119
int top
Entry that is the top of the current page.
Definition lib.h:90
int(* tag)(struct Menu *menu, int sel, int act)
Definition lib.h:131
int(* make_entry)(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
Definition lib.h:106
struct ConfigSubset * sub
Inherited config items.
Definition lib.h:87
void * mdata
Private data.
Definition lib.h:147
int max
Number of entries in the menu.
Definition lib.h:81
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Container for Accounts, Notifications.
Definition neomutt.h:43
char ** env
Private copy of the environment variables.
Definition neomutt.h:55
struct AccountList accounts
List of all Accounts.
Definition neomutt.h:48
struct Notify * notify
Notifications handler.
Definition neomutt.h:44
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:47
NNTP-specific Account data -.
Definition adata.h:36
struct NntpMboxData ** groups_list
Definition adata.h:60
unsigned int groups_num
Definition adata.h:58
NNTP-specific Mailbox data -.
Definition mdata.h:34
struct NntpAccountData * adata
Definition mdata.h:48
Data passed to a notification function.
Definition observer.h:34
void * event_data
Data from notify_send()
Definition observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition observer.h:36
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition observer.h:37
void * global_data
Data from notify_observer_add()
Definition observer.h:39
Cached regular expression.
Definition regex3.h:86
char * pattern
printable version
Definition regex3.h:87
Tuple for the results of simple_dialog_new()
Definition simple.h:35
struct MuttWindow * sbar
Simple Bar.
Definition simple.h:37
struct Menu * menu
Menu.
Definition simple.h:38
struct MuttWindow * dlg
Main Dialog Window.
Definition simple.h:36
@ MENU_BROWSER
General file/mailbox browser.
Definition type.h:41