NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_index.c File Reference

Index Dialog. More...

#include "config.h"
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "gui/lib.h"
#include "lib.h"
#include "color/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "pager/lib.h"
#include "pattern/lib.h"
#include "format_flags.h"
#include "functions.h"
#include "globals.h"
#include "hdrline.h"
#include "hook.h"
#include "mutt_logging.h"
#include "mutt_mailbox.h"
#include "mutt_thread.h"
#include "mview.h"
#include "mx.h"
#include "opcodes.h"
#include "private_data.h"
#include "protos.h"
#include "shared_data.h"
#include "sort.h"
#include "status.h"
#include "notmuch/lib.h"
#include "nntp/lib.h"
#include "nntp/adata.h"
#include "monitor.h"
#include "sidebar/lib.h"
+ Include dependency graph for dlg_index.c:

Go to the source code of this file.

Functions

bool check_acl (struct Mailbox *m, AclFlags acl, const char *msg)
 Check the ACLs for a function.
 
void collapse_all (struct MailboxView *mv, struct Menu *menu, int toggle)
 Collapse/uncollapse all threads.
 
static void uncollapse_thread (struct MailboxView *mv, int index)
 Open a collapsed thread.
 
int find_next_undeleted (struct MailboxView *mv, int msgno, bool uncollapse)
 Find the next undeleted email.
 
int find_previous_undeleted (struct MailboxView *mv, int msgno, bool uncollapse)
 Find the previous undeleted email.
 
int find_first_message (struct MailboxView *mv)
 Get index of first new message.
 
void resort_index (struct MailboxView *mv, struct Menu *menu)
 Resort the index.
 
static void update_index_threaded (struct MailboxView *mv, enum MxStatus check, int oldcount)
 Update the index (if threaded)
 
static void update_index_unthreaded (struct MailboxView *mv, enum MxStatus check)
 Update the index (if unthreaded)
 
void update_index (struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared)
 Update the index.
 
static int index_mailbox_observer (struct NotifyCallback *nc)
 Notification that a Mailbox has changed - Implements observer_t -.
 
void change_folder_mailbox (struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only)
 Change to a different Mailbox by pointer.
 
struct Mailboxchange_folder_notmuch (struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only)
 Change to a different Notmuch Mailbox by string.
 
void change_folder_string (struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only)
 Change to a different Mailbox by string.
 
void index_make_entry (struct Menu *menu, char *buf, size_t buflen, int line)
 Format a menu item for the index list - Implements Menu::make_entry() -.
 
const struct AttrColorindex_color (struct Menu *menu, int line)
 Calculate the colour for a line of the index - Implements Menu::color() -.
 
void mutt_draw_statusline (struct MuttWindow *win, int cols, const char *buf, size_t buflen)
 Draw a highlighted status bar.
 
struct Mailboxdlg_index (struct MuttWindow *dlg, struct Mailbox *m_init)
 Display a list of emails -.
 
void mutt_set_header_color (struct Mailbox *m, struct Email *e)
 Select a colour for a message.
 
struct MuttWindowindex_pager_init (void)
 Allocate the Windows for the Index/Pager.
 
void index_change_folder (struct MuttWindow *dlg, struct Mailbox *m)
 Change the current folder, cautiously.
 

Variables

static const struct Mapping IndexHelp []
 Help Bar for the Index dialog.
 
const struct Mapping IndexNewsHelp []
 Help Bar for the News Index dialog.
 

Detailed Description

Index Dialog.

Authors
  • Michael R. Elkins
  • R Primus

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file dlg_index.c.

Function Documentation

◆ check_acl()

bool check_acl ( struct Mailbox m,
AclFlags  acl,
const char *  msg 
)

Check the ACLs for a function.

Parameters
mMailbox
aclACL, see AclFlags
msgError message for failure
Return values
trueThe function is permitted

Definition at line 141 of file dlg_index.c.

142{
143 if (!m)
144 return false;
145
146 if (!(m->rights & acl))
147 {
148 /* L10N: %s is one of the CHECK_ACL entries below. */
149 mutt_error(_("%s: Operation not permitted by ACL"), msg);
150 return false;
151 }
152
153 return true;
154}
#define mutt_error(...)
Definition: logging2.h:92
#define _(a)
Definition: message.h:28
AclFlags rights
ACL bits, see AclFlags.
Definition: mailbox.h:118
+ Here is the caller graph for this function:

◆ collapse_all()

void collapse_all ( struct MailboxView mv,
struct Menu menu,
int  toggle 
)

Collapse/uncollapse all threads.

Parameters
mvMailbox View
menucurrent menu
toggletoggle collapsed state

This function is called by the OP_MAIN_COLLAPSE_ALL command and on folder enter if the $collapse_all option is set. In the first case, the toggle parameter is 1 to actually toggle collapsed/uncollapsed state on all threads. In the second case, the toggle parameter is 0, actually turning this function into a one-way collapse.

Definition at line 168 of file dlg_index.c.

169{
170 if (!mv || !mv->mailbox || (mv->mailbox->msg_count == 0) || !menu)
171 return;
172
173 struct Email *e_cur = mutt_get_virt_email(mv->mailbox, menu_get_index(menu));
174 if (!e_cur)
175 return;
176
177 int final;
178
179 /* Figure out what the current message would be after folding / unfolding,
180 * so that we can restore the cursor in a sane way afterwards. */
181 if (e_cur->collapsed && toggle)
182 final = mutt_uncollapse_thread(e_cur);
183 else if (mutt_thread_can_collapse(e_cur))
184 final = mutt_collapse_thread(e_cur);
185 else
186 final = e_cur->vnum;
187
188 if (final == -1)
189 return;
190
191 struct Email *base = mutt_get_virt_email(mv->mailbox, final);
192 if (!base)
193 return;
194
195 /* Iterate all threads, perform collapse/uncollapse as needed */
196 mv->collapsed = toggle ? !mv->collapsed : true;
198
199 /* Restore the cursor */
201 menu->max = mv->mailbox->vcount;
202 for (int i = 0; i < mv->mailbox->vcount; i++)
203 {
204 struct Email *e = mutt_get_virt_email(mv->mailbox, i);
205 if (!e)
206 break;
207 if (e->index == base->index)
208 {
209 menu_set_index(menu, i);
210 break;
211 }
212 }
213
215}
#define MENU_REDRAW_INDEX
Redraw the index.
Definition: lib.h:57
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition: menu.c:180
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:156
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition: menu.c:170
void mutt_thread_collapse(struct ThreadsContext *tctx, bool collapse)
Toggle collapse.
Definition: mutt_thread.c:1786
off_t mutt_set_vnum(struct Mailbox *m)
Set the virtual index number of all the messages in a mailbox.
Definition: mutt_thread.c:1401
bool mutt_thread_can_collapse(struct Email *e)
Check whether a thread can be collapsed.
Definition: mutt_thread.c:1814
#define mutt_uncollapse_thread(e)
Definition: mutt_thread.h:106
#define mutt_collapse_thread(e)
Definition: mutt_thread.h:105
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: mview.c:407
The envelope/body of an email.
Definition: email.h:37
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:119
int vnum
Virtual message number.
Definition: email.h:113
int index
The absolute (unsorted) message number.
Definition: email.h:109
bool collapsed
Are all threads collapsed?
Definition: mview.h:48
struct ThreadsContext * threads
Threads context.
Definition: mview.h:43
struct Mailbox * mailbox
Current Mailbox.
Definition: mview.h:50
int vcount
The number of virtual messages.
Definition: mailbox.h:99
int msg_count
Total number of messages.
Definition: mailbox.h:88
int max
Number of entries in the menu.
Definition: lib.h:72
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ uncollapse_thread()

static void uncollapse_thread ( struct MailboxView mv,
int  index 
)
static

Open a collapsed thread.

Parameters
mvMailbox View
indexMessage number

Definition at line 222 of file dlg_index.c.

223{
224 if (!mv || !mv->mailbox)
225 return;
226
227 struct Mailbox *m = mv->mailbox;
228 struct Email *e = mutt_get_virt_email(m, index);
229 if (e && e->collapsed)
230 {
232 mutt_set_vnum(m);
233 }
234}
A mailbox.
Definition: mailbox.h:79
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_next_undeleted()

int find_next_undeleted ( struct MailboxView mv,
int  msgno,
bool  uncollapse 
)

Find the next undeleted email.

Parameters
mvMailbox view
msgnoMessage number to start at
uncollapseOpen collapsed threads
Return values
>=0Message number of next undeleted email
-1No more undeleted messages

Definition at line 244 of file dlg_index.c.

245{
246 if (!mv || !mv->mailbox)
247 return -1;
248
249 struct Mailbox *m = mv->mailbox;
250
251 int index = -1;
252 for (int i = msgno + 1; i < m->vcount; i++)
253 {
254 struct Email *e = mutt_get_virt_email(m, i);
255 if (!e)
256 continue;
257 if (!e->deleted)
258 {
259 index = i;
260 break;
261 }
262 }
263
264 if (uncollapse)
266
267 return index;
268}
static void uncollapse_thread(struct MailboxView *mv, int index)
Open a collapsed thread.
Definition: dlg_index.c:222
bool deleted
Email is deleted.
Definition: email.h:76
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_previous_undeleted()

int find_previous_undeleted ( struct MailboxView mv,
int  msgno,
bool  uncollapse 
)

Find the previous undeleted email.

Parameters
mvMailbox View
msgnoMessage number to start at
uncollapseOpen collapsed threads
Return values
>=0Message number of next undeleted email
-1No more undeleted messages

Definition at line 278 of file dlg_index.c.

279{
280 if (!mv || !mv->mailbox)
281 return -1;
282
283 struct Mailbox *m = mv->mailbox;
284
285 int index = -1;
286 for (int i = msgno - 1; i >= 0; i--)
287 {
288 struct Email *e = mutt_get_virt_email(m, i);
289 if (!e)
290 continue;
291 if (!e->deleted)
292 {
293 index = i;
294 break;
295 }
296 }
297
298 if (uncollapse)
300
301 return index;
302}
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ find_first_message()

int find_first_message ( struct MailboxView mv)

Get index of first new message.

Parameters
mvMailbox view
Return values
numIndex of first new message

Return the index of the first new message, or failing that, the first unread message.

Definition at line 312 of file dlg_index.c.

313{
314 if (!mv)
315 return 0;
316
317 struct Mailbox *m = mv->mailbox;
318 if (!m || (m->msg_count == 0))
319 return 0;
320
321 int old = -1;
322 for (int i = 0; i < m->vcount; i++)
323 {
324 struct Email *e = mutt_get_virt_email(m, i);
325 if (!e)
326 continue;
327 if (!e->read && !e->deleted)
328 {
329 if (!e->old)
330 return i;
331 if (old == -1)
332 old = i;
333 }
334 }
335 if (old != -1)
336 return old;
337
338 /* If `$use_threads` is not threaded and `$sort` is reverse, the latest
339 * message is first. Otherwise, the latest message is first if exactly
340 * one of `$use_threads` and `$sort` are reverse.
341 */
342 enum SortType c_sort = cs_subset_sort(m->sub, "sort");
343 if ((c_sort & SORT_MASK) == SORT_THREADS)
344 c_sort = cs_subset_sort(m->sub, "sort_aux");
345 bool reverse = false;
346 switch (mutt_thread_style())
347 {
348 case UT_FLAT:
349 reverse = c_sort & SORT_REVERSE;
350 break;
351 case UT_THREADS:
352 reverse = c_sort & SORT_REVERSE;
353 break;
354 case UT_REVERSE:
355 reverse = !(c_sort & SORT_REVERSE);
356 break;
357 default:
358 assert(false);
359 }
360
361 if (reverse || (m->vcount == 0))
362 return 0;
363
364 return m->vcount - 1;
365}
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:267
enum UseThreads mutt_thread_style(void)
Which threading style is active?
Definition: mutt_thread.c:79
@ UT_FLAT
Unthreaded.
Definition: mutt_thread.h:97
@ UT_THREADS
Normal threading (root above subthreads)
Definition: mutt_thread.h:98
@ UT_REVERSE
Reverse threading (subthreads above root)
Definition: mutt_thread.h:99
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:74
SortType
Methods for sorting.
Definition: sort2.h:38
@ SORT_THREADS
Sort by email threads.
Definition: sort2.h:45
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:75
bool read
Email is read.
Definition: email.h:48
bool old
Email is seen, but unread.
Definition: email.h:47
struct ConfigSubset * sub
Inherited config items.
Definition: mailbox.h:83
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resort_index()

void resort_index ( struct MailboxView mv,
struct Menu menu 
)

Resort the index.

Parameters
mvMailbox View
menuCurrent Menu

Definition at line 372 of file dlg_index.c.

373{
374 if (!mv || !mv->mailbox || !menu)
375 return;
376
377 struct Mailbox *m = mv->mailbox;
378 const int old_index = menu_get_index(menu);
379 struct Email *e_cur = mutt_get_virt_email(m, old_index);
380
381 int new_index = -1;
382 mutt_sort_headers(mv, false);
383
384 /* Restore the current message */
385 for (int i = 0; i < m->vcount; i++)
386 {
387 struct Email *e = mutt_get_virt_email(m, i);
388 if (!e)
389 continue;
390 if (e == e_cur)
391 {
392 new_index = i;
393 break;
394 }
395 }
396
397 if (mutt_using_threads() && (old_index < 0))
398 new_index = mutt_parent_message(e_cur, false);
399
400 if (old_index < 0)
401 new_index = find_first_message(mv);
402
403 menu->max = m->vcount;
404 menu_set_index(menu, new_index);
406}
int find_first_message(struct MailboxView *mv)
Get index of first new message.
Definition: dlg_index.c:312
int mutt_parent_message(struct Email *e, bool find_root)
Find the parent of a message.
Definition: mutt_thread.c:1351
#define mutt_using_threads()
Definition: mutt_thread.h:112
void mutt_sort_headers(struct MailboxView *mv, bool init)
Sort emails by their headers.
Definition: sort.c:352
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_index_threaded()

static void update_index_threaded ( struct MailboxView mv,
enum MxStatus  check,
int  oldcount 
)
static

Update the index (if threaded)

Parameters
mvMailbox
checkFlags, e.g. MX_STATUS_REOPENED
oldcountHow many items are currently in the index

Definition at line 414 of file dlg_index.c.

415{
416 struct Email **save_new = NULL;
417 const bool lmt = mview_has_limit(mv);
418
419 struct Mailbox *m = mv->mailbox;
420 int num_new = MAX(0, m->msg_count - oldcount);
421
422 const bool c_uncollapse_new = cs_subset_bool(m->sub, "uncollapse_new");
423 /* save the list of new messages */
424 if ((check != MX_STATUS_REOPENED) && (oldcount > 0) &&
425 (lmt || c_uncollapse_new) && (num_new > 0))
426 {
427 save_new = mutt_mem_malloc(num_new * sizeof(struct Email *));
428 for (int i = oldcount; i < m->msg_count; i++)
429 save_new[i - oldcount] = m->emails[i];
430 }
431
432 /* Sort first to thread the new messages, because some patterns
433 * require the threading information.
434 *
435 * If the mailbox was reopened, need to rethread from scratch. */
437
438 if (lmt)
439 {
440 for (int i = 0; i < m->msg_count; i++)
441 {
442 struct Email *e = m->emails[i];
443
444 if ((e->limit_visited && e->visible) ||
446 MUTT_MATCH_FULL_ADDRESS, m, e, NULL))
447 {
448 /* vnum will get properly set by mutt_set_vnum(), which
449 * is called by mutt_sort_headers() just below. */
450 e->vnum = 1;
451 e->visible = true;
452 }
453 else
454 {
455 e->vnum = -1;
456 e->visible = false;
457 }
458
459 // mark email as visited so we don't re-apply the pattern next time
460 e->limit_visited = true;
461 }
462 /* Need a second sort to set virtual numbers and redraw the tree */
463 mutt_sort_headers(mv, false);
464 }
465
466 /* uncollapse threads with new mail */
467 if (c_uncollapse_new)
468 {
469 if (check == MX_STATUS_REOPENED)
470 {
471 mv->collapsed = false;
473 mutt_set_vnum(m);
474 }
475 else if (oldcount > 0)
476 {
477 for (int j = 0; j < num_new; j++)
478 {
479 if (save_new[j]->visible)
480 {
481 mutt_uncollapse_thread(save_new[j]);
482 }
483 }
484 mutt_set_vnum(m);
485 }
486 }
487
488 FREE(&save_new);
489}
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:48
bool mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct PatternCache *cache)
Match a pattern against an email header.
Definition: exec.c:1137
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
Definition: memory.c:90
#define FREE(x)
Definition: memory.h:45
#define MAX(a, b)
Definition: memory.h:31
bool mview_has_limit(const struct MailboxView *mv)
Is a limit active?
Definition: mview.c:428
@ MX_STATUS_REOPENED
Mailbox was reopened.
Definition: mxapi.h:68
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
Definition: lib.h:106
#define SLIST_FIRST(head)
Definition: queue.h:229
bool visible
Is this message part of the view?
Definition: email.h:120
bool limit_visited
Has the limit pattern been applied to this message?
Definition: email.h:121
struct PatternList * limit_pattern
Compiled limit pattern.
Definition: mview.h:42
struct Email ** emails
Array of Emails.
Definition: mailbox.h:96
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_index_unthreaded()

static void update_index_unthreaded ( struct MailboxView mv,
enum MxStatus  check 
)
static

Update the index (if unthreaded)

Parameters
mvMailbox
checkFlags, e.g. MX_STATUS_REOPENED

Definition at line 496 of file dlg_index.c.

497{
498 /* We are in a limited view. Check if the new message(s) satisfy
499 * the limit criteria. If they do, set their virtual msgno so that
500 * they will be visible in the limited view */
501 if (mview_has_limit(mv))
502 {
503 int padding = mx_msg_padding_size(mv->mailbox);
504 mv->mailbox->vcount = mv->vsize = 0;
505 for (int i = 0; i < mv->mailbox->msg_count; i++)
506 {
507 struct Email *e = mv->mailbox->emails[i];
508 if (!e)
509 break;
510
511 if ((e->limit_visited && e->visible) ||
513 MUTT_MATCH_FULL_ADDRESS, mv->mailbox, e, NULL))
514 {
515 assert(mv->mailbox->vcount < mv->mailbox->msg_count);
516 e->vnum = mv->mailbox->vcount;
517 mv->mailbox->v2r[mv->mailbox->vcount] = i;
518 e->visible = true;
519 mv->mailbox->vcount++;
520 struct Body *b = e->body;
521 mv->vsize += b->length + b->offset - b->hdr_offset + padding;
522 }
523 else
524 {
525 e->visible = false;
526 }
527
528 // mark email as visited so we don't re-apply the pattern next time
529 e->limit_visited = true;
530 }
531 }
532
533 /* if the mailbox was reopened, need to rethread from scratch */
535}
int mx_msg_padding_size(struct Mailbox *m)
Bytes of padding between messages - Wrapper for MxOps::msg_padding_size()
Definition: mx.c:1566
The body of an email.
Definition: body.h:36
LOFF_T offset
offset where the actual data begins
Definition: body.h:52
LOFF_T length
length (in bytes) of attachment
Definition: body.h:53
long hdr_offset
Offset in stream where the headers begin.
Definition: body.h:80
struct Body * body
List of MIME parts.
Definition: email.h:67
off_t vsize
Size (in bytes) of the messages shown.
Definition: mview.h:40
int * v2r
Mapping from virtual to real msgno.
Definition: mailbox.h:98
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_index()

void update_index ( struct Menu menu,
struct MailboxView mv,
enum MxStatus  check,
int  oldcount,
const struct IndexSharedData shared 
)

Update the index.

Parameters
menuCurrent Menu
mvMailbox
checkFlags, e.g. MX_STATUS_REOPENED
oldcountHow many items are currently in the index
sharedShared Index data

Definition at line 545 of file dlg_index.c.

547{
548 if (!menu || !mv)
549 return;
550
551 struct Mailbox *m = mv->mailbox;
552 if (mutt_using_threads())
553 update_index_threaded(mv, check, oldcount);
554 else
555 update_index_unthreaded(mv, check);
556
557 const int old_index = menu_get_index(menu);
558 int index = -1;
559 if (oldcount)
560 {
561 /* restore the current message to the message it was pointing to */
562 for (int i = 0; i < m->vcount; i++)
563 {
564 struct Email *e = mutt_get_virt_email(m, i);
565 if (!e)
566 continue;
567 if (index_shared_data_is_cur_email(shared, e))
568 {
569 index = i;
570 break;
571 }
572 }
573 }
574
575 if (index < 0)
576 {
577 index = (old_index < m->vcount) ? old_index : find_first_message(mv);
578 }
579 menu_set_index(menu, index);
580}
static void update_index_threaded(struct MailboxView *mv, enum MxStatus check, int oldcount)
Update the index (if threaded)
Definition: dlg_index.c:414
static void update_index_unthreaded(struct MailboxView *mv, enum MxStatus check)
Update the index (if unthreaded)
Definition: dlg_index.c:496
bool index_shared_data_is_cur_email(const struct IndexSharedData *shared, const struct Email *e)
Check whether an email is the currently selected Email.
Definition: shared_data.c:263
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ change_folder_mailbox()

void change_folder_mailbox ( struct Menu menu,
struct Mailbox m,
int *  oldcount,
struct IndexSharedData shared,
bool  read_only 
)

Change to a different Mailbox by pointer.

Parameters
menuCurrent Menu
mMailbox
oldcountHow many items are currently in the index
sharedShared Index data
read_onlyOpen Mailbox in read-only mode

Definition at line 613 of file dlg_index.c.

615{
616 if (!m)
617 return;
618
619 /* keepalive failure in mutt_enter_fname may kill connection. */
620 if (shared->mailbox && (buf_is_empty(&shared->mailbox->pathbuf)))
621 {
622 mview_free(&shared->mailbox_view);
623 mailbox_free(&shared->mailbox);
624 }
625
626 if (shared->mailbox)
627 {
628 char *new_last_folder = NULL;
629#ifdef USE_INOTIFY
630 int monitor_remove_rc = mutt_monitor_remove(NULL);
631#endif
632#ifdef USE_COMP_MBOX
633 if (shared->mailbox->compress_info && (shared->mailbox->realpath[0] != '\0'))
634 new_last_folder = mutt_str_dup(shared->mailbox->realpath);
635 else
636#endif
637 new_last_folder = mutt_str_dup(mailbox_path(shared->mailbox));
638 *oldcount = shared->mailbox->msg_count;
639
640 const enum MxStatus check = mx_mbox_close(shared->mailbox);
641 if (check == MX_STATUS_OK)
642 {
643 mview_free(&shared->mailbox_view);
644 if (shared->mailbox != m)
645 {
646 mailbox_free(&shared->mailbox);
647 }
648 }
649 else
650 {
651#ifdef USE_INOTIFY
652 if (monitor_remove_rc == 0)
653 mutt_monitor_add(NULL);
654#endif
655 if ((check == MX_STATUS_NEW_MAIL) || (check == MX_STATUS_REOPENED))
656 update_index(menu, shared->mailbox_view, check, *oldcount, shared);
657
658 FREE(&new_last_folder);
661 return;
662 }
664 LastFolder = new_last_folder;
665 }
667
668 /* If the `folder-hook` were to call `unmailboxes`, then the Mailbox (`m`)
669 * could be deleted, leaving `m` dangling. */
670 // TODO: Refactor this function to avoid the need for an observer
672 char *dup_path = mutt_str_dup(mailbox_path(m));
673 char *dup_name = mutt_str_dup(m->name);
674
675 mutt_folder_hook(dup_path, dup_name);
676 if (m)
677 {
678 /* `m` is still valid, but we won't need the observer again before the end
679 * of the function. */
681 }
682 else
683 {
684 // Recreate the Mailbox as the folder-hook might have invoked `mailboxes`
685 // and/or `unmailboxes`.
686 m = mx_path_resolve(dup_path);
687 }
688
689 FREE(&dup_path);
690 FREE(&dup_name);
691
692 if (!m)
693 return;
694
695 const OpenMailboxFlags flags = read_only ? MUTT_READONLY : MUTT_OPEN_NO_FLAGS;
696 if (mx_mbox_open(m, flags))
697 {
698 struct MailboxView *mv = mview_new(m, NeoMutt->notify);
699 index_shared_data_set_mview(shared, mv);
700
701 menu->max = m->msg_count;
703#ifdef USE_INOTIFY
704 mutt_monitor_add(NULL);
705#endif
706 }
707 else
708 {
709 index_shared_data_set_mview(shared, NULL);
711 }
712
713 const bool c_collapse_all = cs_subset_bool(shared->sub, "collapse_all");
714 if (mutt_using_threads() && c_collapse_all)
715 collapse_all(shared->mailbox_view, menu, 0);
716
718 /* force the mailbox check after we have changed the folder */
719 struct EventMailbox ev_m = { shared->mailbox };
723}
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:303
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
Definition: compile.c:778
void update_index(struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared)
Update the index.
Definition: dlg_index.c:545
void collapse_all(struct MailboxView *mv, struct Menu *menu, int toggle)
Collapse/uncollapse all threads.
Definition: dlg_index.c:168
char * LastFolder
Previously selected mailbox.
Definition: globals.c:45
char * CurrentFolder
Currently selected mailbox.
Definition: globals.c:44
static int index_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: dlg_index.c:587
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Definition: hook.c:588
void index_shared_data_set_mview(struct IndexSharedData *shared, struct MailboxView *mv)
Set the MailboxView for the Index and friends.
Definition: shared_data.c:159
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
Definition: mailbox.c:90
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:210
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:60
int mutt_monitor_add(struct Mailbox *m)
Add a watch for a mailbox.
Definition: monitor.c:480
int mutt_monitor_remove(struct Mailbox *m)
Remove a watch for a mailbox.
Definition: monitor.c:524
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
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:251
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:327
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:73
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
Definition: mutt_mailbox.c:165
void mview_free(struct MailboxView **ptr)
Free a MailboxView.
Definition: mview.c:49
struct MailboxView * mview_new(struct Mailbox *m, struct Notify *parent)
Create a new MailboxView.
Definition: mview.c:78
bool mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
Definition: mx.c:304
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
Definition: mx.c:1697
enum MxStatus mx_mbox_close(struct Mailbox *m)
Save changes and close mailbox.
Definition: mx.c:615
#define MUTT_READONLY
Open in read-only mode.
Definition: mxapi.h:43
uint8_t OpenMailboxFlags
Flags for mutt_open_mailbox(), e.g. MUTT_NOSORT.
Definition: mxapi.h:39
#define MUTT_OPEN_NO_FLAGS
No flags are set.
Definition: mxapi.h:40
#define MUTT_MAILBOX_CHECK_FORCE
Ignore MailboxTime and check for new mail.
Definition: mxapi.h:54
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_snc(), and mbox_close()
Definition: mxapi.h:63
@ MX_STATUS_OK
No changes.
Definition: mxapi.h:65
@ MX_STATUS_NEW_MAIL
New mail received in Mailbox.
Definition: mxapi.h:66
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
Definition: notify_type.h:49
An Event that happened to a Mailbox.
Definition: mailbox.h:186
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition: mailbox.h:187
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
struct ConfigSubset * sub
Config set to use.
Definition: shared_data.h:38
struct MailboxView * mailbox_view
Current Mailbox view.
Definition: shared_data.h:40
struct SearchState * search_state
State of the current search.
Definition: shared_data.h:45
View of a Mailbox.
Definition: mview.h:39
struct Menu * menu
Needed for pattern compilation.
Definition: mview.h:46
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition: mailbox.h:81
char * name
A short name for the Mailbox.
Definition: mailbox.h:82
struct Notify * notify
Notifications: NotifyMailbox, EventMailbox.
Definition: mailbox.h:144
struct Buffer pathbuf
Path of the Mailbox.
Definition: mailbox.h:80
void * compress_info
Compressed mbox module private data.
Definition: mailbox.h:121
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct Notify * notify
Notifications handler.
Definition: neomutt.h:42
struct PatternList * pattern
compiled search pattern
Definition: search_state.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ change_folder_notmuch()

struct Mailbox * change_folder_notmuch ( struct Menu menu,
char *  buf,
int  buflen,
int *  oldcount,
struct IndexSharedData shared,
bool  read_only 
)

Change to a different Notmuch Mailbox by string.

Parameters
menuCurrent Menu
bufFolder to change to
buflenLength of buffer
oldcountHow many items are currently in the index
sharedShared Index data
read_onlyOpen Mailbox in read-only mode
Return values
ptrMailbox

Definition at line 736 of file dlg_index.c.

738{
739 if (!nm_url_from_query(NULL, buf, buflen))
740 {
741 mutt_message(_("Failed to create query, aborting"));
742 return NULL;
743 }
744
745 struct Mailbox *m_query = mx_path_resolve(buf);
746 change_folder_mailbox(menu, m_query, oldcount, shared, read_only);
747 return m_query;
748}
void change_folder_mailbox(struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Mailbox by pointer.
Definition: dlg_index.c:613
#define mutt_message(...)
Definition: logging2.h:91
char * nm_url_from_query(struct Mailbox *m, char *buf, size_t buflen)
Turn a query into a URL.
Definition: notmuch.c:1565
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ change_folder_string()

void change_folder_string ( struct Menu menu,
struct Buffer buf,
int *  oldcount,
struct IndexSharedData shared,
bool  read_only 
)

Change to a different Mailbox by string.

Parameters
menuCurrent Menu
bufFolder to change to
oldcountHow many items are currently in the index
sharedShared Index data
read_onlyOpen Mailbox in read-only mode

Definition at line 759 of file dlg_index.c.

761{
762#ifdef USE_NNTP
763 if (OptNews)
764 {
765 OptNews = false;
767 }
768 else
769#endif
770 {
771 const char *const c_folder = cs_subset_string(shared->sub, "folder");
772 mx_path_canon(buf, c_folder, NULL);
773 }
774
775 enum MailboxType type = mx_path_probe(buf_string(buf));
776 if ((type == MUTT_MAILBOX_ERROR) || (type == MUTT_UNKNOWN))
777 {
778 // Look for a Mailbox by its description, before failing
779 struct Mailbox *m = mailbox_find_name(buf_string(buf));
780 if (m)
781 {
782 change_folder_mailbox(menu, m, oldcount, shared, read_only);
783 }
784 else
785 {
786 mutt_error(_("%s is not a mailbox"), buf_string(buf));
787 }
788 return;
789 }
790
791 struct Mailbox *m = mx_path_resolve(buf_string(buf));
792 change_folder_mailbox(menu, m, oldcount, shared, read_only);
793}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:93
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:292
bool OptNews
(pseudo) used to change reader mode
Definition: globals.c:77
struct Mailbox * mailbox_find_name(const char *name)
Find the mailbox with a given name.
Definition: mailbox.c:180
MailboxType
Supported mailbox formats.
Definition: mailbox.h:41
@ MUTT_MAILBOX_ERROR
Error occurred examining Mailbox.
Definition: mailbox.h:43
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
Definition: mailbox.h:44
int mx_path_canon(struct Buffer *path, const char *folder, enum MailboxType *type)
Canonicalise a mailbox path - Wrapper for MxOps::path_canon()
Definition: mx.c:1389
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Definition: mx.c:1343
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition: newsrc.c:564
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition: nntp.c:77
size_t dsize
Length of data.
Definition: buffer.h:37
char * data
Pointer to data.
Definition: buffer.h:35
struct ConnAccount account
Account details: username, password, etc.
Definition: connection.h:50
struct Connection * conn
Connection to NNTP Server.
Definition: adata.h:62
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_draw_statusline()

void mutt_draw_statusline ( struct MuttWindow win,
int  cols,
const char *  buf,
size_t  buflen 
)

Draw a highlighted status bar.

Parameters
winWindow
colsMaximum number of screen columns
bufMessage to be displayed
buflenLength of the buffer

Users configure the highlighting of the status bar, e.g. color status red default "[0-9][0-9]:[0-9][0-9]"

Where regexes overlap, the one nearest the start will be used. If two regexes start at the same place, the longer match will be used.

Colours of the status bar

< First character of that colour

< Last character of that colour

Definition at line 925 of file dlg_index.c.

926{
927 if (!buf || !stdscr)
928 return;
929
930 size_t i = 0;
931 size_t offset = 0;
932 bool found = false;
933 size_t chunks = 0;
934 size_t len = 0;
935
939 struct StatusSyntax
940 {
941 const struct AttrColor *attr_color;
942 int first;
943 int last;
944 } *syntax = NULL;
945
948 do
949 {
950 struct RegexColor *cl = NULL;
951 found = false;
952
953 if (!buf[offset])
954 break;
955
956 /* loop through each "color status regex" */
958 {
959 regmatch_t pmatch[cl->match + 1];
960
961 if (regexec(&cl->regex, buf + offset, cl->match + 1, pmatch, 0) != 0)
962 continue; /* regex doesn't match the status bar */
963
964 int first = pmatch[cl->match].rm_so + offset;
965 int last = pmatch[cl->match].rm_eo + offset;
966
967 if (first == last)
968 continue; /* ignore an empty regex */
969
970 if (!found)
971 {
972 chunks++;
973 mutt_mem_realloc(&syntax, chunks * sizeof(struct StatusSyntax));
974 }
975
976 i = chunks - 1;
977 if (!found || (first < syntax[i].first) ||
978 ((first == syntax[i].first) && (last > syntax[i].last)))
979 {
980 const struct AttrColor *ac_merge = merged_color_overlay(ac_base, &cl->attr_color);
981
982 syntax[i].attr_color = ac_merge;
983 syntax[i].first = first;
984 syntax[i].last = last;
985 }
986 found = true;
987 }
988
989 if (syntax)
990 {
991 offset = syntax[i].last;
992 }
993 } while (found);
994
995 /* Only 'len' bytes will fit into 'cols' screen columns */
996 len = mutt_wstr_trunc(buf, buflen, cols, NULL);
997
998 offset = 0;
999
1000 if ((chunks > 0) && (syntax[0].first > 0))
1001 {
1002 /* Text before the first highlight */
1003 mutt_window_addnstr(win, buf, MIN(len, syntax[0].first));
1004 mutt_curses_set_color(ac_base);
1005 if (len <= syntax[0].first)
1006 goto dsl_finish; /* no more room */
1007
1008 offset = syntax[0].first;
1009 }
1010
1011 for (i = 0; i < chunks; i++)
1012 {
1013 /* Highlighted text */
1014 mutt_curses_set_color(syntax[i].attr_color);
1015 mutt_window_addnstr(win, buf + offset, MIN(len, syntax[i].last) - offset);
1016 if (len <= syntax[i].last)
1017 goto dsl_finish; /* no more room */
1018
1019 size_t next;
1020 if ((i + 1) == chunks)
1021 {
1022 next = len;
1023 }
1024 else
1025 {
1026 next = MIN(len, syntax[i + 1].first);
1027 }
1028
1029 mutt_curses_set_color(ac_base);
1030 offset = syntax[i].last;
1031 mutt_window_addnstr(win, buf + offset, next - offset);
1032
1033 offset = next;
1034 if (offset >= len)
1035 goto dsl_finish; /* no more room */
1036 }
1037
1038 mutt_curses_set_color(ac_base);
1039 if (offset < len)
1040 {
1041 /* Text after the last highlight */
1042 mutt_window_addnstr(win, buf + offset, len - offset);
1043 }
1044
1045 int width = mutt_strwidth(buf);
1046 if (width < cols)
1047 {
1048 /* Pad the rest of the line with whitespace */
1049 mutt_paddstr(win, cols - width, "");
1050 }
1051dsl_finish:
1052 FREE(&syntax);
1053}
struct RegexColorList * regex_colors_get_list(enum ColorId cid)
Return the RegexColorList for a colour id.
Definition: regex.c:184
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
Definition: simple.c:81
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:75
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:57
size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width)
Work out how to truncate a widechar string.
Definition: curs_lib.c:582
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:540
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition: curs_lib.c:642
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:114
#define MIN(a, b)
Definition: memory.h:32
const struct AttrColor * merged_color_overlay(const struct AttrColor *base, const struct AttrColor *over)
Combine two colours.
Definition: merged.c:109
void mutt_curses_set_color(const struct AttrColor *ac)
Set the colour and attributes for text.
Definition: mutt_curses.c:40
int mutt_window_addnstr(struct MuttWindow *win, const char *str, int num)
Write a partial string to a Window.
Definition: mutt_window.c:401
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:352
A curses colour and its attributes.
Definition: attr.h:35
A regular expression and a color to highlight a line.
Definition: regex4.h:37
regex_t regex
Compiled regex.
Definition: regex4.h:40
struct AttrColor attr_color
Colour and attributes to apply.
Definition: regex4.h:38
int match
Substring to match, 0 for old behaviour.
Definition: regex4.h:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_set_header_color()

void mutt_set_header_color ( struct Mailbox m,
struct Email e 
)

Select a colour for a message.

Parameters
mMailbox
eCurrent Email

Definition at line 1376 of file dlg_index.c.

1377{
1378 if (!e)
1379 return;
1380
1381 struct RegexColor *color = NULL;
1382 struct PatternCache cache = { 0 };
1383
1384 const struct AttrColor *ac_merge = NULL;
1386 {
1388 MUTT_MATCH_FULL_ADDRESS, m, e, &cache))
1389 {
1390 ac_merge = merged_color_overlay(ac_merge, &color->attr_color);
1391 }
1392 }
1393
1394 struct AttrColor *ac_normal = simple_color_get(MT_COLOR_NORMAL);
1395 if (ac_merge)
1396 ac_merge = merged_color_overlay(ac_normal, ac_merge);
1397 else
1398 ac_merge = ac_normal;
1399
1400 e->attr_color = ac_merge;
1401}
@ MT_COLOR_INDEX
Index: default colour.
Definition: color.h:83
const struct AttrColor * attr_color
Color-pair to use when displaying in the index.
Definition: email.h:111
Cache commonly-used patterns.
Definition: lib.h:117
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
Definition: regex4.h:42
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index_pager_init()

struct MuttWindow * index_pager_init ( void  )

Allocate the Windows for the Index/Pager.

Return values
ptrDialog containing nested Windows

Definition at line 1407 of file dlg_index.c.

1408{
1412
1413 struct IndexSharedData *shared = index_shared_data_new();
1414 notify_set_parent(shared->notify, dlg->notify);
1415
1416 dlg->wdata = shared;
1418
1419 const bool c_status_on_top = cs_subset_bool(NeoMutt->sub, "status_on_top");
1420
1421 struct MuttWindow *panel_index = ipanel_new(c_status_on_top, shared);
1422 struct MuttWindow *panel_pager = ppanel_new(c_status_on_top, shared);
1423
1424 mutt_window_add_child(dlg, panel_index);
1425 mutt_window_add_child(dlg, panel_pager);
1426
1427 return dlg;
1428}
void index_shared_data_free(struct MuttWindow *win, void **ptr)
Free Shared Index Data - Implements MuttWindow::wdata_free() -.
Definition: shared_data.c:277
struct IndexSharedData * index_shared_data_new(void)
Create new Index Data.
Definition: shared_data.c:306
struct MuttWindow * ipanel_new(bool status_on_top, struct IndexSharedData *shared)
Create the Windows for the Index panel.
Definition: ipanel.c:121
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:95
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:446
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Definition: mutt_window.c:182
@ WT_DLG_INDEX
Index Dialog, dlg_index()
Definition: mutt_window.h:86
@ MUTT_WIN_ORIENT_HORIZONTAL
Window uses all available horizontal space.
Definition: mutt_window.h:39
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:52
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition: mutt_window.h:48
struct MuttWindow * ppanel_new(bool status_on_top, struct IndexSharedData *shared)
Create the Windows for the Pager panel.
Definition: ppanel.c:122
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:159
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index_change_folder()

void index_change_folder ( struct MuttWindow dlg,
struct Mailbox m 
)

Change the current folder, cautiously.

Parameters
dlgDialog holding the Index
mMailbox to change to

Definition at line 1435 of file dlg_index.c.

1436{
1437 if (!dlg || !m)
1438 return;
1439
1440 struct IndexSharedData *shared = dlg->wdata;
1441 if (!shared)
1442 return;
1443
1444 struct MuttWindow *panel_index = window_find_child(dlg, WT_INDEX);
1445 if (!panel_index)
1446 return;
1447
1448 struct IndexPrivateData *priv = panel_index->wdata;
1449 if (!priv)
1450 return;
1451
1452 change_folder_mailbox(priv->menu, m, &priv->oldcount, shared, false);
1453}
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:533
@ WT_INDEX
A panel containing the Index Window.
Definition: mutt_window.h:97
Private state data for the Index.
Definition: private_data.h:35
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:42
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:43
int oldcount
Old count of Emails in the Mailbox.
Definition: private_data.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ IndexHelp

const struct Mapping IndexHelp[]
static
Initial value:
= {
{ N_("Quit"), OP_QUIT },
{ N_("Del"), OP_DELETE },
{ N_("Undel"), OP_UNDELETE },
{ N_("Save"), OP_SAVE },
{ N_("Mail"), OP_MAIL },
{ N_("Reply"), OP_REPLY },
{ N_("Group"), OP_GROUP_REPLY },
{ N_("Help"), OP_HELP },
{ NULL, 0 },
}
#define N_(a)
Definition: message.h:32

Help Bar for the Index dialog.

Definition at line 103 of file dlg_index.c.

◆ IndexNewsHelp

const struct Mapping IndexNewsHelp[]
Initial value:
= {
{ N_("Quit"), OP_QUIT },
{ N_("Del"), OP_DELETE },
{ N_("Undel"), OP_UNDELETE },
{ N_("Save"), OP_SAVE },
{ N_("Post"), OP_POST },
{ N_("Followup"), OP_FOLLOWUP },
{ N_("Catchup"), OP_CATCHUP },
{ N_("Help"), OP_HELP },
{ NULL, 0 },
}

Help Bar for the News Index dialog.

Definition at line 119 of file dlg_index.c.