NeoMutt  2025-12-11-596-g7cc1dd
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 // Work on a mutable copy to avoid modifying the const dirname parameter
297 char dstrbuf[PATH_MAX] = { 0 };
298 mutt_str_copy(dstrbuf, dirname, sizeof(dstrbuf));
299
300 while (stat(dstrbuf, &st) == -1)
301 {
302 if (errno == ENOENT)
303 {
304 /* The last used directory is deleted, try to use the parent dir. */
305 char *c = strrchr(dstrbuf, '/');
306
307 if (c && (c > dstrbuf))
308 {
309 *c = '\0';
310 continue;
311 }
312 }
313 mutt_perror("%s", dstrbuf);
314 goto ed_out;
315 }
316
317 if (!S_ISDIR(st.st_mode))
318 {
319 mutt_error(_("%s is not a directory"), dstrbuf);
320 goto ed_out;
321 }
322
323 if (m)
325
326 dir = mutt_file_opendir(dstrbuf, MUTT_OPENDIR_NONE);
327 if (!dir)
328 {
329 mutt_perror("%s", dstrbuf);
330 goto ed_out;
331 }
332
333 init_state(state);
334
335 struct MailboxArray ma = neomutt_mailboxes_get(NeoMutt, MUTT_MAILBOX_ANY);
336
337 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
338 while ((de = readdir(dir)))
339 {
340 if (mutt_str_equal(de->d_name, "."))
341 continue; /* we don't need . */
342
343 if (prefix && *prefix && !mutt_str_startswith(de->d_name, prefix))
344 {
345 continue;
346 }
347 if (!mutt_regex_match(c_mask, de->d_name))
348 {
349 continue;
350 }
351
352 buf_concat_path(buf, dstrbuf, de->d_name);
353 if (lstat(buf_string(buf), &st) == -1)
354 continue;
355
356 /* No size for directories or symlinks */
357 if (S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))
358 st.st_size = 0;
359 else if (!S_ISREG(st.st_mode))
360 continue;
361
362 struct Mailbox **mp = NULL;
363 ARRAY_FOREACH(mp, &ma)
364 {
365 if (mutt_str_equal(buf_string(buf), mailbox_path(*mp)))
366 break;
367 }
368
369 struct Mailbox *m_match = mp ? *mp : NULL;
370 if (m_match && m && m->poll_new_mail && mutt_str_equal(m_match->realpath, m->realpath))
371 {
372 m_match->msg_count = m->msg_count;
373 m_match->msg_unread = m->msg_unread;
374 }
375 browser_add_folder(menu, state, de->d_name, NULL, &st, m_match, NULL);
376 }
377 ARRAY_FREE(&ma); // Clean up the ARRAY, but not the Mailboxes
378 closedir(dir);
379 }
380 browser_sort(state);
381 rc = 0;
382ed_out:
383 buf_pool_release(&buf);
384 return rc;
385}
386
395int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
396{
397 struct stat st = { 0 };
398 struct Buffer *md = NULL;
399 struct Buffer *mailbox = NULL;
400
401 if (OptNews)
402 {
404
405 init_state(state);
406
407 const bool c_show_only_unread = cs_subset_bool(NeoMutt->sub, "show_only_unread");
408 for (unsigned int i = 0; i < adata->groups_num; i++)
409 {
410 struct NntpMboxData *mdata = adata->groups_list[i];
411 if (mdata && (mdata->has_new_mail ||
412 (mdata->subscribed && (mdata->unread || !c_show_only_unread))))
413 {
414 browser_add_folder(menu, state, mdata->group, NULL, NULL, NULL, mdata);
415 }
416 }
417 }
418 else
419 {
420 init_state(state);
421
423 return -1;
424
425 mailbox = buf_pool_get();
426 md = buf_pool_get();
427
429
430 struct MailboxArray ma = neomutt_mailboxes_get(NeoMutt, MUTT_MAILBOX_ANY);
431 const bool c_browser_abbreviate_mailboxes = cs_subset_bool(NeoMutt->sub, "browser_abbreviate_mailboxes");
432
433 struct Mailbox **mp = NULL;
434 ARRAY_FOREACH(mp, &ma)
435 {
436 struct Mailbox *m_match = *mp;
437
438 if (m && m->poll_new_mail && mutt_str_equal(m_match->realpath, m->realpath))
439 {
440 m_match->msg_count = m->msg_count;
441 m_match->msg_unread = m->msg_unread;
442 }
443
444 buf_strcpy(mailbox, mailbox_path(m_match));
445 if (c_browser_abbreviate_mailboxes)
446 pretty_mailbox(mailbox);
447
448 switch (m_match->type)
449 {
450 case MUTT_IMAP:
451 case MUTT_POP:
452 browser_add_folder(menu, state, buf_string(mailbox), m_match->name,
453 NULL, m_match, NULL);
454 continue;
455 case MUTT_NOTMUCH:
456 case MUTT_NNTP:
457 browser_add_folder(menu, state, mailbox_path(m_match), m_match->name,
458 NULL, m_match, NULL);
459 continue;
460 default: /* Continue */
461 break;
462 }
463
464 if (lstat(mailbox_path(m_match), &st) == -1)
465 continue;
466
467 if ((!S_ISREG(st.st_mode)) && (!S_ISDIR(st.st_mode)) && (!S_ISLNK(st.st_mode)))
468 continue;
469
470 if (m_match->type == MUTT_MAILDIR)
471 {
472 struct stat st2 = { 0 };
473
474 buf_printf(md, "%s/new", mailbox_path(m_match));
475 if (stat(buf_string(md), &st) < 0)
476 st.st_mtime = 0;
477 buf_printf(md, "%s/cur", mailbox_path(m_match));
478 if (stat(buf_string(md), &st2) < 0)
479 st2.st_mtime = 0;
480 if (st2.st_mtime > st.st_mtime)
481 st.st_mtime = st2.st_mtime;
482 }
483
484 browser_add_folder(menu, state, buf_string(mailbox), m_match->name, &st, m_match, NULL);
485 }
486 ARRAY_FREE(&ma); // Clean up the ARRAY, but not the Mailboxes
487 }
488 browser_sort(state);
489
490 buf_pool_release(&mailbox);
491 buf_pool_release(&md);
492 return 0;
493}
494
498static int select_file_search(struct Menu *menu, regex_t *rx, int line)
499{
500 struct BrowserPrivateData *priv = menu->mdata;
501 struct BrowserEntryArray *entry = &priv->state.entry;
502 if (OptNews)
503 return regexec(rx, ARRAY_GET(entry, line)->desc, 0, NULL, 0);
504 struct FolderFile *ff = ARRAY_GET(entry, line);
505 char *search_on = ff->desc ? ff->desc : ff->name;
506
507 return regexec(rx, search_on, 0, NULL, 0);
508}
509
515static int folder_make_entry(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
516{
517 struct BrowserPrivateData *priv = menu->mdata;
518 struct BrowserState *bstate = &priv->state;
519 struct BrowserEntryArray *entry = &bstate->entry;
520 struct Folder folder = {
521 .ff = ARRAY_GET(entry, line),
522 .num = line,
523 };
524
525 const bool c_arrow_cursor = cs_subset_bool(menu->sub, "arrow_cursor");
526 if (c_arrow_cursor)
527 {
528 const char *const c_arrow_string = cs_subset_string(menu->sub, "arrow_string");
529 if (max_cols > 0)
530 max_cols -= (mutt_strwidth(c_arrow_string) + 1);
531 }
532
533 if (OptNews)
534 {
535 const struct Expando *c_group_index_format = cs_subset_expando(NeoMutt->sub, "group_index_format");
536 return expando_filter(c_group_index_format, GroupIndexRenderCallbacks, &folder,
537 MUTT_FORMAT_ARROWCURSOR, max_cols, NeoMutt->env, buf);
538 }
539
540 if (bstate->is_mailbox_list)
541 {
542 const struct Expando *c_mailbox_folder_format = cs_subset_expando(NeoMutt->sub, "mailbox_folder_format");
543 return expando_filter(c_mailbox_folder_format, FolderRenderCallbacks, &folder,
544 MUTT_FORMAT_ARROWCURSOR, max_cols, NeoMutt->env, buf);
545 }
546
547 const struct Expando *c_folder_format = cs_subset_expando(NeoMutt->sub, "folder_format");
548 return expando_filter(c_folder_format, FolderRenderCallbacks, &folder,
549 MUTT_FORMAT_ARROWCURSOR, max_cols, NeoMutt->env, buf);
550}
551
560void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
561{
562 menu->top = 0;
563 /* Reset menu position to 1.
564 * We do not risk overflow as the init_menu function changes
565 * current if it is bigger than state->entrylen. */
566 if (!ARRAY_EMPTY(&state->entry) &&
567 (mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "..") ||
568 mutt_str_equal(ARRAY_FIRST(&state->entry)->desc, "../")))
569 {
570 /* Skip the first entry, unless there's only one entry. */
571 menu_set_index(menu, (menu->max > 1));
572 }
573 else
574 {
575 menu_set_index(menu, 0);
576 }
577}
578
586void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m,
587 struct MuttWindow *sbar)
588{
589 char title[256] = { 0 };
590 menu->max = ARRAY_SIZE(&state->entry);
591
592 int index = menu_get_index(menu);
593 if (index >= menu->max)
594 menu_set_index(menu, menu->max - 1);
595 if (index < 0)
596 menu_set_index(menu, 0);
597 if (menu->top > index)
598 menu->top = 0;
599
600 menu->num_tagged = 0;
601
602 if (OptNews)
603 {
604 if (state->is_mailbox_list)
605 {
606 snprintf(title, sizeof(title), _("Subscribed newsgroups"));
607 }
608 else
609 {
610 snprintf(title, sizeof(title), _("Newsgroups on server [%s]"),
611 CurrentNewsSrv->conn->account.host);
612 }
613 }
614 else
615 {
616 if (state->is_mailbox_list)
617 {
618 snprintf(title, sizeof(title), _("Mailboxes [%d]"),
620 }
621 else
622 {
623 struct Buffer *path = buf_pool_get();
624 buf_copy(path, &LastDir);
625 pretty_mailbox(path);
626 const struct Regex *c_mask = cs_subset_regex(NeoMutt->sub, "mask");
627 const bool c_imap_list_subscribed = cs_subset_bool(NeoMutt->sub, "imap_list_subscribed");
628 if (state->imap_browse && c_imap_list_subscribed)
629 {
630 snprintf(title, sizeof(title), _("Subscribed [%s], File mask: %s"),
631 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
632 }
633 else
634 {
635 snprintf(title, sizeof(title), _("Directory [%s], File mask: %s"),
636 buf_string(path), NONULL(c_mask ? c_mask->pattern : NULL));
637 }
638 buf_pool_release(&path);
639 }
640 }
641 sbar_set_title(sbar, title);
642
643 /* Browser tracking feature.
644 * The goal is to highlight the good directory if LastDir is the parent dir
645 * of LastDirBackup (this occurs mostly when one hit "../"). It should also work
646 * properly when the user is in examine_mailboxes-mode. */
648 {
649 char target_dir[PATH_MAX] = { 0 };
650
651 /* Check what kind of dir LastDirBackup is. */
653 {
654 mutt_str_copy(target_dir, buf_string(&LastDirBackup), sizeof(target_dir));
655 imap_clean_path(target_dir, sizeof(target_dir));
656 }
657 else
658 {
659 const char *slash = strrchr(buf_string(&LastDirBackup), '/');
660 if (slash)
661 mutt_str_copy(target_dir, slash + 1, sizeof(target_dir));
662 else
663 mutt_str_copy(target_dir, buf_string(&LastDirBackup), sizeof(target_dir));
664 }
665
666 /* If we get here, it means that LastDir is the parent directory of
667 * LastDirBackup. I.e., we're returning from a subdirectory, and we want
668 * to position the cursor on the directory we're returning from. */
669 bool matched = false;
670 struct FolderFile *ff = NULL;
671 ARRAY_FOREACH(ff, &state->entry)
672 {
673 if (mutt_str_equal(ff->name, target_dir))
674 {
675 menu_set_index(menu, ARRAY_FOREACH_IDX_ff);
676 matched = true;
677 break;
678 }
679 }
680 if (!matched)
681 browser_highlight_default(state, menu);
682 }
683 else
684 {
685 browser_highlight_default(state, menu);
686 }
687
689}
690
694static int file_tag(struct Menu *menu, int sel, int act)
695{
696 struct BrowserPrivateData *priv = menu->mdata;
697 struct BrowserEntryArray *entry = &priv->state.entry;
698 struct FolderFile *ff = ARRAY_GET(entry, sel);
699 if (S_ISDIR(ff->mode) ||
700 (S_ISLNK(ff->mode) && link_is_dir(buf_string(&LastDir), ff->name)))
701 {
702 mutt_error(_("Can't attach a directory"));
703 return 0;
704 }
705
706 bool ot = ff->tagged;
707 ff->tagged = ((act >= 0) ? act : !ff->tagged);
708
709 return ff->tagged - ot;
710}
711
716{
717 if (nc->event_type != NT_CONFIG)
718 return 0;
719 if (!nc->global_data || !nc->event_data)
720 return -1;
721
722 struct EventConfig *ev_c = nc->event_data;
723
724 struct BrowserPrivateData *priv = nc->global_data;
725 struct Menu *menu = priv->menu;
726
727 if (mutt_str_equal(ev_c->name, "browser_sort_dirs_first"))
728 {
729 struct BrowserState *state = &priv->state;
730 browser_sort(state);
731 browser_highlight_default(state, menu);
732 }
733 else if (!mutt_str_equal(ev_c->name, "browser_abbreviate_mailboxes") &&
734 !mutt_str_equal(ev_c->name, "browser_sort") &&
735 !mutt_str_equal(ev_c->name, "date_format") &&
736 !mutt_str_equal(ev_c->name, "folder") &&
737 !mutt_str_equal(ev_c->name, "folder_format") &&
738 !mutt_str_equal(ev_c->name, "group_index_format") &&
739 !mutt_str_equal(ev_c->name, "mailbox_folder_format"))
740 {
741 return 0;
742 }
743
745 mutt_debug(LL_DEBUG5, "config done, request WA_RECALC, MENU_REDRAW_FULL\n");
746
747 return 0;
748}
749
756{
757 if (nc->event_type != NT_MAILBOX)
758 return 0;
760 return 0;
761 if (!nc->global_data || !nc->event_data)
762 return -1;
763
764 struct BrowserPrivateData *priv = nc->global_data;
765
766 struct BrowserState *state = &priv->state;
767 if (state->is_mailbox_list)
768 {
769 struct EventMailbox *ev_m = nc->event_data;
770 struct Mailbox *m = ev_m->mailbox;
771 struct FolderFile *ff = NULL;
772 ARRAY_FOREACH(ff, &state->entry)
773 {
774 if (ff->gen != m->gen)
775 continue;
776
777 ff->has_new_mail = m->has_new;
778 ff->msg_count = m->msg_count;
779 ff->msg_unread = m->msg_unread;
780 ff->notify_user = m->notify_user;
782 mutt_str_replace(&ff->desc, m->name);
783 break;
784 }
785 }
786
788 mutt_debug(LL_DEBUG5, "mailbox done, request WA_RECALC, MENU_REDRAW_FULL\n");
789
790 return 0;
791}
792
801{
802 if (nc->event_type != NT_WINDOW)
803 return 0;
804 if (!nc->global_data || !nc->event_data)
805 return -1;
807 return 0;
808
809 struct BrowserPrivateData *priv = nc->global_data;
810 struct MuttWindow *win_menu = priv->menu->win;
811
812 struct EventWindow *ev_w = nc->event_data;
813 if (ev_w->win != win_menu)
814 return 0;
815
819
820 mutt_debug(LL_DEBUG5, "window delete done\n");
821 return 0;
822}
823
834void mutt_browser_select_dir(const char *f)
835{
836 init_lastdir();
837
839
840 /* Method that will fetch the parent path depending on the type of the path. */
841 char buf[PATH_MAX] = { 0 };
842 mutt_get_parent_path(buf_string(&LastDirBackup), buf, sizeof(buf));
843 buf_strcpy(&LastDir, buf);
844}
845
857void dlg_browser(struct Buffer *file, SelectFileFlags flags, struct Mailbox *m,
858 char ***files, int *numfiles)
859{
861 priv->file = file;
862 priv->mailbox = m;
863 priv->files = files;
864 priv->numfiles = numfiles;
865 priv->multiple = (flags & MUTT_SEL_MULTI);
866 priv->folder = (flags & MUTT_SEL_FOLDER);
867 priv->state.is_mailbox_list = (flags & MUTT_SEL_MAILBOX) && priv->folder;
868 priv->last_selected_mailbox = -1;
869
870 init_lastdir();
871
872 if (OptNews)
873 {
874 if (buf_is_empty(file))
875 {
877
878 /* default state for news reader mode is browse subscribed newsgroups */
879 priv->state.is_mailbox_list = false;
880 for (size_t i = 0; i < adata->groups_num; i++)
881 {
882 struct NntpMboxData *mdata = adata->groups_list[i];
883 if (mdata && mdata->subscribed)
884 {
885 priv->state.is_mailbox_list = true;
886 break;
887 }
888 }
889 }
890 else
891 {
892 buf_copy(priv->prefix, file);
893 }
894 }
895 else if (!buf_is_empty(file))
896 {
897 expand_path(file, false);
898 if (imap_path_probe(buf_string(file), NULL) == MUTT_IMAP)
899 {
900 init_state(&priv->state);
901 priv->state.imap_browse = true;
902 if (imap_browse(buf_string(file), &priv->state) == 0)
903 {
905 browser_sort(&priv->state);
906 }
907 }
908 else
909 {
910 int i = buf_len(file);
911 i--;
912 for (; (i > 0) && ((buf_string(file))[i] != '/'); i--)
913 {
914 ; // do nothing
915 }
916
917 if (i > 0)
918 {
919 if ((buf_string(file))[0] == '/')
920 {
921 buf_strcpy_n(&LastDir, buf_string(file), i);
922 }
923 else
924 {
926 buf_addch(&LastDir, '/');
927 buf_addstr_n(&LastDir, buf_string(file), i);
928 }
929 }
930 else
931 {
932 if ((buf_string(file))[0] == '/')
933 buf_strcpy(&LastDir, "/");
934 else
936 }
937
938 if ((i <= 0) && (buf_string(file)[0] != '/'))
939 buf_copy(priv->prefix, file);
940 else
941 buf_strcpy(priv->prefix, buf_string(file) + i + 1);
942 priv->kill_prefix = true;
943 }
944 }
945 else
946 {
947 if (priv->folder)
948 {
949 /* Whether we use the tracking feature of the browser depends
950 * on which sort method we chose to use. This variable is defined
951 * only to help readability of the code. */
952 bool browser_track = false;
953
954 const enum EmailSortType c_browser_sort = cs_subset_sort(NeoMutt->sub, "browser_sort");
955 switch (c_browser_sort & SORT_MASK)
956 {
960 browser_track = true;
961 break;
962 }
963
964 /* We use mutt_browser_select_dir to initialize the two
965 * variables (LastDir, LastDirBackup) at the appropriate
966 * values.
967 *
968 * We do it only when LastDir is not set (first pass there)
969 * or when CurrentFolder and LastDirBackup are not the same.
970 * This code is executed only when we list files, not when
971 * we press up/down keys to navigate in a displayed list.
972 *
973 * We only do this when CurrentFolder has been set (ie, not
974 * when listing folders on startup with "neomutt -y").
975 *
976 * This tracker is only used when browser_track is true,
977 * meaning only with sort methods SUBJECT/DESC for now. */
978 if (CurrentFolder)
979 {
980 if (buf_is_empty(&LastDir))
981 {
982 /* If browsing in "local"-mode, than we chose to define LastDir to
983 * MailDir */
985 {
986 case MUTT_IMAP:
987 case MUTT_MAILDIR:
988 case MUTT_MBOX:
989 case MUTT_MH:
990 case MUTT_MMDF:
991 {
992 const char *const c_folder = cs_subset_string(NeoMutt->sub, "folder");
993 const char *const c_spool_file = cs_subset_string(NeoMutt->sub, "spool_file");
994 if (c_folder)
995 buf_strcpy(&LastDir, c_folder);
996 else if (c_spool_file)
997 mutt_browser_select_dir(c_spool_file);
998 break;
999 }
1000 default:
1002 break;
1003 }
1004 }
1006 {
1008 }
1009 }
1010
1011 /* When browser tracking feature is disabled, clear LastDirBackup */
1012 if (!browser_track)
1014 }
1015 else
1016 {
1018 }
1019
1020 if (!priv->state.is_mailbox_list &&
1022 {
1023 init_state(&priv->state);
1024 priv->state.imap_browse = true;
1026 browser_sort(&priv->state);
1027 }
1028 else
1029 {
1030 size_t i = buf_len(&LastDir);
1031 while ((i > 0) && (buf_string(&LastDir)[--i] == '/'))
1032 LastDir.data[i] = '\0';
1034 if (buf_is_empty(&LastDir))
1036 }
1037 }
1038
1039 buf_reset(file);
1040
1041 const struct Mapping *help_data = NULL;
1042
1043 if (OptNews)
1044 help_data = FolderNewsHelp;
1045 else
1046 help_data = FolderHelp;
1047
1049
1050 struct Menu *menu = sdw.menu;
1052 menu->search = select_file_search;
1053 menu->mdata = priv;
1054
1055 priv->menu = menu;
1056 if (priv->multiple)
1057 priv->menu->tag = file_tag;
1058
1059 priv->sbar = sdw.sbar;
1060
1061 struct MuttWindow *win_menu = priv->menu->win;
1062
1063 // NT_COLOR is handled by the SimpleDialog
1067
1068 struct MuttWindow *old_focus = window_set_focus(priv->menu->win);
1069
1070 if (priv->state.is_mailbox_list)
1071 {
1072 examine_mailboxes(m, NULL, &priv->state);
1073 }
1074 else if (!priv->state.imap_browse)
1075 {
1076 // examine_directory() calls browser_add_folder() which needs the menu
1077 if (examine_directory(m, priv->menu, &priv->state, buf_string(&LastDir),
1078 buf_string(priv->prefix)) == -1)
1079 {
1080 goto bail;
1081 }
1082 }
1083
1084 init_menu(&priv->state, priv->menu, m, priv->sbar);
1085
1086 // ---------------------------------------------------------------------------
1087 // Event Loop
1088 int op = OP_NULL;
1089 struct KeyEvent event = { 0, OP_NULL };
1090 do
1091 {
1092 menu_tagging_dispatcher(priv->menu->win, &event);
1093 window_redraw(NULL);
1094
1096 op = event.op;
1097 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
1098 if (op < 0)
1099 continue;
1100 if (op == OP_NULL)
1101 {
1103 continue;
1104 }
1106
1107 int rc = browser_function_dispatcher(sdw.dlg, &event);
1108
1109 if (rc == FR_UNKNOWN)
1110 rc = menu_function_dispatcher(menu->win, &event);
1111 if (rc == FR_UNKNOWN)
1112 rc = global_function_dispatcher(menu->win, &event);
1113 } while (!priv->done);
1114 // ---------------------------------------------------------------------------
1115
1116bail:
1117 window_set_focus(old_focus);
1118 simple_dialog_free(&sdw.dlg);
1120}
#define ARRAY_FIRST(head)
Convenience method to get the first element.
Definition array.h:136
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition array.h:157
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:223
#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_RESERVE(head, n)
Reserve memory for the array.
Definition array.h:191
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
#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:196
const struct ExpandoRenderCallback FolderRenderCallbacks[]
Callbacks for Browser Expandos.
Definition expando.c:478
Browser Expando definitions.
struct MenuDefinition * MdBrowser
Browser Menu Definition.
Definition functions.c:64
int browser_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Browser function.
Definition functions.c:1161
Browser functions.
Select a Mailbox from a list.
#define MUTT_SEL_MAILBOX
Select a mailbox.
Definition lib.h:59
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:61
#define MUTT_SEL_MULTI
Multi-selection is enabled.
Definition lib.h:60
uint8_t SelectFileFlags
Flags for mutt_select_file(), e.g. MUTT_SEL_MAILBOX.
Definition lib.h:57
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:39
Connection Library.
Convenience wrapper for the core headers.
@ NT_MAILBOX_DELETE
Mailbox is about to be deleted.
Definition mailbox.h:173
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition mailbox.h:213
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition mailbox.h:50
@ MUTT_MMDF
'mmdf' Mailbox type
Definition mailbox.h:45
@ MUTT_POP
'POP3' Mailbox type
Definition mailbox.h:51
@ MUTT_MH
'MH' Mailbox type
Definition mailbox.h:46
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition mailbox.h:48
@ MUTT_IMAP
'IMAP' Mailbox type
Definition mailbox.h:49
@ MUTT_MBOX
'mbox' Mailbox type
Definition mailbox.h:44
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Definition mailbox.h:41
@ MUTT_MAILDIR
'Maildir' Mailbox type
Definition mailbox.h:47
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition curs_lib.c:444
@ FR_UNKNOWN
Unknown function.
Definition dispatcher.h:34
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:139
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:539
@ MUTT_OPENDIR_NONE
Plain opendir()
Definition file.h:63
struct KeyEvent km_dokey(const struct MenuDefinition *md, GetChFlags flags)
Determine what a keypress should do.
Definition get.c:434
void km_error_key(const struct MenuDefinition *md)
Handle an unbound key sequence.
Definition get.c:285
#define GETCH_NO_FLAGS
No flags are set.
Definition get.h:34
bool OptNews
(pseudo) used to change reader mode
Definition globals.c:53
char * CurrentFolder
Currently selected mailbox.
Definition globals.c:38
Global variables.
int menu_tagging_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
Definition tagging.c:230
int global_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Global function - Implements function_dispatcher_t -.
Definition global.c:182
int menu_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Menu function - Implements function_dispatcher_t -.
Definition functions.c:320
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:94
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
#define mutt_perror(...)
Definition logging2.h:95
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:2546
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:169
struct SimpleDialogWindows simple_dialog_new(const struct MenuDefinition *md, 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:192
Manage keymappings.
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:49
@ LL_DEBUG1
Log at debug level 1.
Definition logging2.h:45
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition lib.h:60
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition menu.c:188
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:164
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:178
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:614
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:257
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:665
size_t mutt_str_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix.
Definition string.c:234
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:586
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition string.c:284
#define PATH_MAX
Definition mutt.h:49
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:80
@ 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:866
void pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition muttlib.c:427
void expand_path(struct Buffer *buf, bool regex)
Create the canonical path.
Definition muttlib.c:121
Some miscellaneous functions.
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Definition mx.c:1323
API for mailboxes.
#define MUTT_MAILBOX_CHECK_NO_FLAGS
No flags are set.
Definition mxapi.h:49
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching Mailboxes.
Definition neomutt.c:526
Nntp-specific Account data.
Usenet network mailbox type; talk to an NNTP server.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition nntp.c:74
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:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
#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:44
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:145
char * folder
Folder name.
Definition lib.h:148
bool is_mailbox_list
Viewing mailboxes.
Definition lib.h:149
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition lib.h:146
bool imap_browse
IMAP folder.
Definition lib.h:147
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:189
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition mailbox.h:190
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:79
bool imap
This is an IMAP folder.
Definition lib.h:96
bool has_mailbox
This is a mailbox.
Definition lib.h:99
char * name
Name of file/dir/mailbox.
Definition lib.h:87
uid_t uid
File's User ID.
Definition lib.h:83
bool tagged
Folder is tagged.
Definition lib.h:103
gid_t gid
File's Group ID.
Definition lib.h:84
bool has_new_mail
true if mailbox has "new mail"
Definition lib.h:90
bool poll_new_mail
Check mailbox for new mail.
Definition lib.h:102
bool notify_user
User will be notified of new mail.
Definition lib.h:101
nlink_t nlink
Number of hard links.
Definition lib.h:85
char * desc
Description of mailbox.
Definition lib.h:88
struct NntpMboxData * nd
Extra NNTP data.
Definition lib.h:104
off_t size
File size.
Definition lib.h:81
int gen
Unique id, used for (un)sorting.
Definition lib.h:106
bool local
Folder is on local filesystem.
Definition lib.h:100
time_t mtime
Modification time.
Definition lib.h:82
int msg_count
total number of messages
Definition lib.h:91
mode_t mode
File permissions.
Definition lib.h:80
int msg_unread
number of unread messages
Definition lib.h:92
A folder/dir in the browser.
Definition lib.h:70
An event such as a keypress.
Definition get.h:50
int op
Function opcode, e.g. OP_HELP.
Definition get.h:52
A mailbox.
Definition mailbox.h:78
bool has_new
Mailbox has new mail.
Definition mailbox.h:84
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition mailbox.h:80
int msg_count
Total number of messages.
Definition mailbox.h:87
enum MailboxType type
Mailbox type.
Definition mailbox.h:101
bool poll_new_mail
Check for new mail.
Definition mailbox.h:114
void * mdata
Driver specific data.
Definition mailbox.h:131
char * name
A short name for the Mailbox.
Definition mailbox.h:81
bool notify_user
Notify the user of new mail.
Definition mailbox.h:112
bool visible
True if a result of "mailboxes".
Definition mailbox.h:129
int msg_unread
Number of unread messages.
Definition mailbox.h:88
int gen
Generation number, for sorting.
Definition mailbox.h:146
Mapping between user-readable string and a constant.
Definition mapping.h:33
Definition lib.h:80
struct MuttWindow * win
Window holding the Menu.
Definition lib.h:88
int num_tagged
Number of tagged entries.
Definition lib.h:95
int(* search)(struct Menu *menu, regex_t *rx, int line)
Definition lib.h:121
int top
Entry that is the top of the current page.
Definition lib.h:92
int(* tag)(struct Menu *menu, int sel, int act)
Definition lib.h:133
int(* make_entry)(struct Menu *menu, int line, int max_cols, struct Buffer *buf)
Definition lib.h:108
struct ConfigSubset * sub
Inherited config items.
Definition lib.h:89
void * mdata
Private data.
Definition lib.h:149
int max
Number of entries in the menu.
Definition lib.h:82
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Container for Accounts, Notifications.
Definition neomutt.h:41
struct AccountArray accounts
All Accounts.
Definition neomutt.h:50
char ** env
Private copy of the environment variables.
Definition neomutt.h:58
struct Notify * notify
Notifications handler.
Definition neomutt.h:45
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
NNTP-specific Account data -.
Definition adata.h:36
struct NntpMboxData ** groups_list
List of newsgroups.
Definition adata.h:60
unsigned int groups_num
Number of newsgroups.
Definition adata.h:58
NNTP-specific Mailbox data -.
Definition mdata.h:34
struct NntpAccountData * adata
Account data.
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:85
char * pattern
printable version
Definition regex3.h:86
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