NeoMutt  2024-10-02-37-gfa9146
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
dlg_index.c File Reference

Index Dialog. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include <string.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 "expando/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "nntp/lib.h"
#include "pager/lib.h"
#include "pattern/lib.h"
#include "sidebar/lib.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 "nntp/adata.h"
#include "private_data.h"
#include "protos.h"
#include "shared_data.h"
#include "sort.h"
#include "status.h"
#include "notmuch/lib.h"
#include "monitor.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.
 
int index_make_entry (struct Menu *menu, int line, int max_cols, struct Buffer *buf)
 Format an Email for the Menu - 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 max_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
  • Pietro Cerutti
  • Richard Russon
  • R Primus
  • Eric Blake
  • Igor Serebryany
  • Dennis Schön
  • Tóth János

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 139 of file dlg_index.c.

140{
141 if (!m)
142 return false;
143
144 if (!(m->rights & acl))
145 {
146 /* L10N: %s is one of the CHECK_ACL entries below. */
147 mutt_error(_("%s: Operation not permitted by ACL"), msg);
148 return false;
149 }
150
151 return true;
152}
#define mutt_error(...)
Definition: logging2.h:92
#define _(a)
Definition: message.h:28
AclFlags rights
ACL bits, see AclFlags.
Definition: mailbox.h:119
+ 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 166 of file dlg_index.c.

167{
168 if (!mv || !mv->mailbox || (mv->mailbox->msg_count == 0) || !menu)
169 return;
170
171 struct Email *e_cur = mutt_get_virt_email(mv->mailbox, menu_get_index(menu));
172 if (!e_cur)
173 return;
174
175 int final;
176
177 /* Figure out what the current message would be after folding / unfolding,
178 * so that we can restore the cursor in a sane way afterwards. */
179 if (e_cur->collapsed && toggle)
180 final = mutt_uncollapse_thread(e_cur);
181 else if (mutt_thread_can_collapse(e_cur))
182 final = mutt_collapse_thread(e_cur);
183 else
184 final = e_cur->vnum;
185
186 if (final == -1)
187 return;
188
189 struct Email *base = mutt_get_virt_email(mv->mailbox, final);
190 if (!base)
191 return;
192
193 /* Iterate all threads, perform collapse/uncollapse as needed */
194 mv->collapsed = toggle ? !mv->collapsed : true;
196
197 /* Restore the cursor */
199 menu->max = mv->mailbox->vcount;
200 for (int i = 0; i < mv->mailbox->vcount; i++)
201 {
202 struct Email *e = mutt_get_virt_email(mv->mailbox, i);
203 if (!e)
204 break;
205 if (e->index == base->index)
206 {
207 menu_set_index(menu, i);
208 break;
209 }
210 }
211
213}
#define MENU_REDRAW_INDEX
Redraw the index.
Definition: lib.h:56
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
void mutt_thread_collapse(struct ThreadsContext *tctx, bool collapse)
Toggle collapse.
Definition: mutt_thread.c:1789
off_t mutt_set_vnum(struct Mailbox *m)
Set the virtual index number of all the messages in a mailbox.
Definition: mutt_thread.c:1404
bool mutt_thread_can_collapse(struct Email *e)
Check whether a thread can be collapsed.
Definition: mutt_thread.c:1817
#define mutt_uncollapse_thread(e)
Definition: mutt_thread.h:108
#define mutt_collapse_thread(e)
Definition: mutt_thread.h:107
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: mview.c:418
The envelope/body of an email.
Definition: email.h:39
bool collapsed
Is this message part of a collapsed thread?
Definition: email.h:120
int vnum
Virtual message number.
Definition: email.h:114
int index
The absolute (unsorted) message number.
Definition: email.h:110
bool collapsed
Are all threads collapsed?
Definition: mview.h:49
struct ThreadsContext * threads
Threads context.
Definition: mview.h:44
struct Mailbox * mailbox
Current Mailbox.
Definition: mview.h:51
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:81
+ 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 220 of file dlg_index.c.

221{
222 if (!mv || !mv->mailbox)
223 return;
224
225 struct Mailbox *m = mv->mailbox;
226 struct Email *e = mutt_get_virt_email(m, index);
227 if (e && e->collapsed)
228 {
230 mutt_set_vnum(m);
231 }
232}
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 242 of file dlg_index.c.

243{
244 if (!mv || !mv->mailbox)
245 return -1;
246
247 struct Mailbox *m = mv->mailbox;
248
249 int index = -1;
250 for (int i = msgno + 1; i < m->vcount; i++)
251 {
252 struct Email *e = mutt_get_virt_email(m, i);
253 if (!e)
254 continue;
255 if (!e->deleted)
256 {
257 index = i;
258 break;
259 }
260 }
261
262 if (uncollapse)
264
265 return index;
266}
static void uncollapse_thread(struct MailboxView *mv, int index)
Open a collapsed thread.
Definition: dlg_index.c:220
bool deleted
Email is deleted.
Definition: email.h:78
+ 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 276 of file dlg_index.c.

277{
278 if (!mv || !mv->mailbox)
279 return -1;
280
281 struct Mailbox *m = mv->mailbox;
282
283 int index = -1;
284 for (int i = msgno - 1; i >= 0; i--)
285 {
286 struct Email *e = mutt_get_virt_email(m, i);
287 if (!e)
288 continue;
289 if (!e->deleted)
290 {
291 index = i;
292 break;
293 }
294 }
295
296 if (uncollapse)
298
299 return index;
300}
+ 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 310 of file dlg_index.c.

311{
312 if (!mv)
313 return 0;
314
315 struct Mailbox *m = mv->mailbox;
316 if (!m || (m->msg_count == 0))
317 return 0;
318
319 int old = -1;
320 for (int i = 0; i < m->vcount; i++)
321 {
322 struct Email *e = mutt_get_virt_email(m, i);
323 if (!e)
324 continue;
325 if (!e->read && !e->deleted)
326 {
327 if (!e->old)
328 return i;
329 if (old == -1)
330 old = i;
331 }
332 }
333 if (old != -1)
334 return old;
335
336 /* If `$use_threads` is not threaded and `$sort` is reverse, the latest
337 * message is first. Otherwise, the latest message is first if exactly
338 * one of `$use_threads` and `$sort` are reverse.
339 */
340 enum SortType c_sort = cs_subset_sort(m->sub, "sort");
341 if ((c_sort & SORT_MASK) == SORT_THREADS)
342 c_sort = cs_subset_sort(m->sub, "sort_aux");
343 bool reverse = false;
344 switch (mutt_thread_style())
345 {
346 case UT_FLAT:
347 reverse = c_sort & SORT_REVERSE;
348 break;
349 case UT_THREADS:
350 reverse = c_sort & SORT_REVERSE;
351 break;
352 case UT_REVERSE:
353 reverse = !(c_sort & SORT_REVERSE);
354 break;
355 default:
356 ASSERT(false);
357 }
358
359 if (reverse || (m->vcount == 0))
360 return 0;
361
362 return m->vcount - 1;
363}
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:266
enum UseThreads mutt_thread_style(void)
Which threading style is active?
Definition: mutt_thread.c:82
@ UT_FLAT
Unthreaded.
Definition: mutt_thread.h:99
@ UT_THREADS
Normal threading (root above subthreads)
Definition: mutt_thread.h:100
@ UT_REVERSE
Reverse threading (subthreads above root)
Definition: mutt_thread.h:101
#define ASSERT(COND)
Definition: signal2.h:58
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:70
SortType
Methods for sorting.
Definition: sort2.h:34
@ SORT_THREADS
Sort by email threads.
Definition: sort2.h:41
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:71
bool read
Email is read.
Definition: email.h:50
bool old
Email is seen, but unread.
Definition: email.h:49
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 370 of file dlg_index.c.

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

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

495{
496 /* We are in a limited view. Check if the new message(s) satisfy
497 * the limit criteria. If they do, set their virtual msgno so that
498 * they will be visible in the limited view */
499 if (mview_has_limit(mv))
500 {
501 int padding = mx_msg_padding_size(mv->mailbox);
502 mv->mailbox->vcount = mv->vsize = 0;
503 for (int i = 0; i < mv->mailbox->msg_count; i++)
504 {
505 struct Email *e = mv->mailbox->emails[i];
506 if (!e)
507 break;
508
509 if ((e->limit_visited && e->visible) ||
511 MUTT_MATCH_FULL_ADDRESS, mv->mailbox, e, NULL))
512 {
514 e->vnum = mv->mailbox->vcount;
515 mv->mailbox->v2r[mv->mailbox->vcount] = i;
516 e->visible = true;
517 mv->mailbox->vcount++;
518 struct Body *b = e->body;
519 mv->vsize += b->length + b->offset - b->hdr_offset + padding;
520 }
521 else
522 {
523 e->visible = false;
524 }
525
526 // mark email as visited so we don't re-apply the pattern next time
527 e->limit_visited = true;
528 }
529 }
530
531 /* if the mailbox was reopened, need to rethread from scratch */
533}
int mx_msg_padding_size(struct Mailbox *m)
Bytes of padding between messages - Wrapper for MxOps::msg_padding_size()
Definition: mx.c:1505
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:81
struct Body * body
List of MIME parts.
Definition: email.h:69
off_t vsize
Size (in bytes) of the messages shown.
Definition: mview.h:41
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 543 of file dlg_index.c.

545{
546 if (!menu || !mv)
547 return;
548
549 struct Mailbox *m = mv->mailbox;
550 if (mutt_using_threads())
551 update_index_threaded(mv, check, oldcount);
552 else
553 update_index_unthreaded(mv, check);
554
555 menu->max = m->vcount;
556 const int old_index = menu_get_index(menu);
557 int index = -1;
558 if (oldcount)
559 {
560 /* restore the current message to the message it was pointing to */
561 for (int i = 0; i < m->vcount; i++)
562 {
563 struct Email *e = mutt_get_virt_email(m, i);
564 if (!e)
565 continue;
566 if (index_shared_data_is_cur_email(shared, e))
567 {
568 index = i;
569 break;
570 }
571 }
572 }
573
574 if (index < 0)
575 {
576 index = (old_index < m->vcount) ? old_index : find_first_message(mv);
577 }
578 menu_set_index(menu, index);
579}
static void update_index_threaded(struct MailboxView *mv, enum MxStatus check, int oldcount)
Update the index (if threaded)
Definition: dlg_index.c:412
static void update_index_unthreaded(struct MailboxView *mv, enum MxStatus check)
Update the index (if unthreaded)
Definition: dlg_index.c:494
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:264
+ 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 612 of file dlg_index.c.

614{
615 if (!m)
616 return;
617
618 /* keepalive failure in mutt_enter_fname may kill connection. */
619 if (shared->mailbox && (buf_is_empty(&shared->mailbox->pathbuf)))
620 {
621 mview_free(&shared->mailbox_view);
622 mailbox_free(&shared->mailbox);
623 }
624
625 if (shared->mailbox)
626 {
627 char *new_last_folder = NULL;
628#ifdef USE_INOTIFY
629 int monitor_remove_rc = mutt_monitor_remove(NULL);
630#endif
631 if (shared->mailbox->compress_info && (shared->mailbox->realpath[0] != '\0'))
632 new_last_folder = mutt_str_dup(shared->mailbox->realpath);
633 else
634 new_last_folder = mutt_str_dup(mailbox_path(shared->mailbox));
635 *oldcount = shared->mailbox->msg_count;
636
637 const enum MxStatus check = mx_mbox_close(shared->mailbox);
638 if (check == MX_STATUS_OK)
639 {
640 mview_free(&shared->mailbox_view);
641 if (shared->mailbox != m)
642 {
643 mailbox_free(&shared->mailbox);
644 }
645 }
646 else
647 {
648#ifdef USE_INOTIFY
649 if (monitor_remove_rc == 0)
650 mutt_monitor_add(NULL);
651#endif
652 if ((check == MX_STATUS_NEW_MAIL) || (check == MX_STATUS_REOPENED))
653 update_index(menu, shared->mailbox_view, check, *oldcount, shared);
654
655 FREE(&new_last_folder);
658 return;
659 }
661 LastFolder = new_last_folder;
662 }
664
665 /* If the `folder-hook` were to call `unmailboxes`, then the Mailbox (`m`)
666 * could be deleted, leaving `m` dangling. */
667 // TODO: Refactor this function to avoid the need for an observer
669 char *dup_path = mutt_str_dup(mailbox_path(m));
670 char *dup_name = mutt_str_dup(m->name);
671
672 mutt_folder_hook(dup_path, dup_name);
673 if (m)
674 {
675 /* `m` is still valid, but we won't need the observer again before the end
676 * of the function. */
678 }
679 else
680 {
681 // Recreate the Mailbox as the folder-hook might have invoked `mailboxes`
682 // and/or `unmailboxes`.
683 m = mx_path_resolve(dup_path);
684 }
685
686 FREE(&dup_path);
687 FREE(&dup_name);
688
689 if (!m)
690 return;
691
692 const OpenMailboxFlags flags = read_only ? MUTT_READONLY : MUTT_OPEN_NO_FLAGS;
693 if (mx_mbox_open(m, flags))
694 {
695 struct MailboxView *mv = mview_new(m, NeoMutt->notify);
696 index_shared_data_set_mview(shared, mv);
697
698 menu->max = m->msg_count;
700#ifdef USE_INOTIFY
701 mutt_monitor_add(NULL);
702#endif
703 }
704 else
705 {
706 index_shared_data_set_mview(shared, NULL);
708 }
709
710 const bool c_collapse_all = cs_subset_bool(shared->sub, "collapse_all");
711 if (mutt_using_threads() && c_collapse_all)
712 collapse_all(shared->mailbox_view, menu, 0);
713
715 /* force the mailbox check after we have changed the folder */
716 struct EventMailbox ev_m = { shared->mailbox };
720}
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:291
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
Definition: compile.c:778
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
Definition: mailbox.c:89
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:223
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:543
void collapse_all(struct MailboxView *mv, struct Menu *menu, int toggle)
Collapse/uncollapse all threads.
Definition: dlg_index.c:166
char * LastFolder
Previously selected mailbox.
Definition: globals.c:43
char * CurrentFolder
Currently selected mailbox.
Definition: globals.c:42
static int index_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
Definition: dlg_index.c:586
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Definition: hook.c:631
void index_shared_data_set_mview(struct IndexSharedData *shared, struct MailboxView *mv)
Set the MailboxView for the Index and friends.
Definition: shared_data.c:160
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:59
int mutt_monitor_add(struct Mailbox *m)
Add a watch for a mailbox.
Definition: monitor.c:484
int mutt_monitor_remove(struct Mailbox *m)
Remove a watch for a mailbox.
Definition: monitor.c:528
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:253
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:280
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:74
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
Definition: mutt_mailbox.c:169
void mview_free(struct MailboxView **ptr)
Free a MailboxView.
Definition: mview.c:50
struct MailboxView * mview_new(struct Mailbox *m, struct Notify *parent)
Create a new MailboxView.
Definition: mview.c:91
bool mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
Definition: mx.c:288
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
Definition: mx.c:1636
enum MxStatus mx_mbox_close(struct Mailbox *m)
Save changes and close mailbox.
Definition: mx.c:598
#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_POSTPONED
Make sure the number of postponed messages is updated.
Definition: mxapi.h:54
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_sync(), 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:199
struct Mailbox * mailbox
The Mailbox this Event relates to.
Definition: mailbox.h:200
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:40
struct Menu * menu
Needed for pattern compilation.
Definition: mview.h:47
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:145
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:42
struct Notify * notify
Notifications handler.
Definition: neomutt.h:43
struct PatternList * pattern
compiled search pattern
Definition: search_state.h:37
+ 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 733 of file dlg_index.c.

735{
736 if (!nm_url_from_query(NULL, buf, buflen))
737 {
738 mutt_message(_("Failed to create query, aborting"));
739 return NULL;
740 }
741
742 struct Mailbox *m_query = mx_path_resolve(buf);
743 change_folder_mailbox(menu, m_query, oldcount, shared, read_only);
744 if (!shared->mailbox_view)
745 mailbox_free(&m_query);
746 return m_query;
747}
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:612
#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:1579
+ 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 758 of file dlg_index.c.

760{
761 if (OptNews)
762 {
763 OptNews = false;
765 }
766 else
767 {
768 const char *const c_folder = cs_subset_string(shared->sub, "folder");
769 mx_path_canon(buf, c_folder, NULL);
770 }
771
772 enum MailboxType type = mx_path_probe(buf_string(buf));
773 if ((type == MUTT_MAILBOX_ERROR) || (type == MUTT_UNKNOWN))
774 {
775 // Look for a Mailbox by its description, before failing
776 struct Mailbox *m = mailbox_find_name(buf_string(buf));
777 if (m)
778 {
779 change_folder_mailbox(menu, m, oldcount, shared, read_only);
780 }
781 else
782 {
783 mutt_error(_("%s is not a mailbox"), buf_string(buf));
784 }
785 return;
786 }
787
788 struct Mailbox *m = mx_path_resolve(buf_string(buf));
789 change_folder_mailbox(menu, m, oldcount, shared, read_only);
790}
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:96
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:291
struct Mailbox * mailbox_find_name(const char *name)
Find the mailbox with a given name.
Definition: mailbox.c:187
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
bool OptNews
(pseudo) used to change reader mode
Definition: globals.c:67
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:1367
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Definition: mx.c:1321
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition: newsrc.c:558
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition: nntp.c:77
size_t dsize
Length of data.
Definition: buffer.h:39
char * data
Pointer to data.
Definition: buffer.h:37
struct ConnAccount account
Account details: username, password, etc.
Definition: connection.h:49
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  max_cols,
const char *  buf,
size_t  buflen 
)

Draw a highlighted status bar.

Parameters
winWindow
max_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 929 of file dlg_index.c.

930{
931 if (!buf || !stdscr)
932 return;
933
934 size_t i = 0;
935 size_t offset = 0;
936 bool found = false;
937 size_t chunks = 0;
938 size_t len = 0;
939
943 struct StatusSyntax
944 {
945 const struct AttrColor *attr_color;
946 int first;
947 int last;
948 } *syntax = NULL;
949
952 do
953 {
954 struct RegexColor *cl = NULL;
955 found = false;
956
957 if (!buf[offset])
958 break;
959
960 /* loop through each "color status regex" */
962 {
963 regmatch_t pmatch[cl->match + 1];
964 memset(pmatch, 0, (cl->match + 1) * sizeof(regmatch_t));
965
966 if (regexec(&cl->regex, buf + offset, cl->match + 1, pmatch, 0) != 0)
967 continue; /* regex doesn't match the status bar */
968
969 int first = pmatch[cl->match].rm_so + offset;
970 int last = pmatch[cl->match].rm_eo + offset;
971
972 if (first == last)
973 continue; /* ignore an empty regex */
974
975 if (!found)
976 {
977 chunks++;
978 mutt_mem_realloc(&syntax, chunks * sizeof(struct StatusSyntax));
979 }
980
981 i = chunks - 1;
982 if (!found || (first < syntax[i].first) ||
983 ((first == syntax[i].first) && (last > syntax[i].last)))
984 {
985 const struct AttrColor *ac_merge = merged_color_overlay(ac_base, &cl->attr_color);
986
987 syntax[i].attr_color = ac_merge;
988 syntax[i].first = first;
989 syntax[i].last = last;
990 }
991 found = true;
992 }
993
994 if (syntax)
995 {
996 offset = syntax[i].last;
997 }
998 } while (found);
999
1000 /* Only 'len' bytes will fit into 'max_cols' screen columns */
1001 len = mutt_wstr_trunc(buf, buflen, max_cols, NULL);
1002
1003 offset = 0;
1004
1005 if ((chunks > 0) && (syntax[0].first > 0))
1006 {
1007 /* Text before the first highlight */
1008 mutt_window_addnstr(win, buf, MIN(len, syntax[0].first));
1009 mutt_curses_set_color(ac_base);
1010 if (len <= syntax[0].first)
1011 goto dsl_finish; /* no more room */
1012
1013 offset = syntax[0].first;
1014 }
1015
1016 for (i = 0; i < chunks; i++)
1017 {
1018 /* Highlighted text */
1019 mutt_curses_set_color(syntax[i].attr_color);
1020 mutt_window_addnstr(win, buf + offset, MIN(len, syntax[i].last) - offset);
1021 if (len <= syntax[i].last)
1022 goto dsl_finish; /* no more room */
1023
1024 size_t next;
1025 if ((i + 1) == chunks)
1026 {
1027 next = len;
1028 }
1029 else
1030 {
1031 next = MIN(len, syntax[i + 1].first);
1032 }
1033
1034 mutt_curses_set_color(ac_base);
1035 offset = syntax[i].last;
1036 mutt_window_addnstr(win, buf + offset, next - offset);
1037
1038 offset = next;
1039 if (offset >= len)
1040 goto dsl_finish; /* no more room */
1041 }
1042
1043 mutt_curses_set_color(ac_base);
1044 if (offset < len)
1045 {
1046 /* Text after the last highlight */
1047 mutt_window_addnstr(win, buf + offset, len - offset);
1048 }
1049
1050 int width = mutt_strwidth(buf);
1051 if (width < max_cols)
1052 {
1053 /* Pad the rest of the line with whitespace */
1054 mutt_paddstr(win, max_cols - width, "");
1055 }
1056dsl_finish:
1057 FREE(&syntax);
1058}
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:88
@ MT_COLOR_STATUS
Status bar (takes a pattern)
Definition: color.h:75
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:59
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:383
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
Definition: curs_lib.c:341
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
Definition: curs_lib.c:443
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
Definition: memory.c:115
#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:107
void mutt_curses_set_color(const struct AttrColor *ac)
Set the colour and attributes for text.
Definition: mutt_curses.c:38
int mutt_window_addnstr(struct MuttWindow *win, const char *str, int num)
Write a partial string to a Window.
Definition: mutt_window.c:400
#define STAILQ_FOREACH(var, head, field)
Definition: queue.h:352
A curses colour and its attributes.
Definition: attr.h:66
A regular expression and a color to highlight a line.
Definition: regex4.h:36
regex_t regex
Compiled regex.
Definition: regex4.h:39
struct AttrColor attr_color
Colour and attributes to apply.
Definition: regex4.h:37
int match
Substring to match, 0 for old behaviour.
Definition: regex4.h:40
+ 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 1373 of file dlg_index.c.

1374{
1375 if (!e)
1376 return;
1377
1378 struct RegexColor *color = NULL;
1379 struct PatternCache cache = { 0 };
1380
1381 const struct AttrColor *ac_merge = NULL;
1383 {
1385 MUTT_MATCH_FULL_ADDRESS, m, e, &cache))
1386 {
1387 ac_merge = merged_color_overlay(ac_merge, &color->attr_color);
1388 }
1389 }
1390
1391 struct AttrColor *ac_normal = simple_color_get(MT_COLOR_NORMAL);
1392 if (ac_merge)
1393 ac_merge = merged_color_overlay(ac_normal, ac_merge);
1394 else
1395 ac_merge = ac_normal;
1396
1397 e->attr_color = ac_merge;
1398}
@ 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:112
Cache commonly-used patterns.
Definition: lib.h:116
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
Definition: regex4.h:41
+ 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 1404 of file dlg_index.c.

1405{
1409
1410 struct IndexSharedData *shared = index_shared_data_new();
1411 notify_set_parent(shared->notify, dlg->notify);
1412
1413 dlg->wdata = shared;
1415
1416 const bool c_status_on_top = cs_subset_bool(NeoMutt->sub, "status_on_top");
1417
1418 struct MuttWindow *panel_index = ipanel_new(c_status_on_top, shared);
1419 struct MuttWindow *panel_pager = ppanel_new(c_status_on_top, shared);
1420
1421 mutt_window_add_child(dlg, panel_index);
1422 mutt_window_add_child(dlg, panel_pager);
1423
1424 return dlg;
1425}
void index_shared_data_free(struct MuttWindow *win, void **ptr)
Free Shared Index Data - Implements MuttWindow::wdata_free() -.
Definition: shared_data.c:278
struct IndexSharedData * index_shared_data_new(void)
Create new Index Data.
Definition: shared_data.c:307
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:445
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:181
@ 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:133
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:144
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:137
void(* wdata_free)(struct MuttWindow *win, void **ptr)
Definition: mutt_window.h:158
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:46
+ 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 1432 of file dlg_index.c.

1433{
1434 if (!dlg || !m)
1435 return;
1436
1437 struct IndexSharedData *shared = dlg->wdata;
1438 if (!shared)
1439 return;
1440
1441 struct MuttWindow *panel_index = window_find_child(dlg, WT_INDEX);
1442 if (!panel_index)
1443 return;
1444
1445 struct IndexPrivateData *priv = panel_index->wdata;
1446 if (!priv)
1447 return;
1448
1449 change_folder_mailbox(priv->menu, m, &priv->oldcount, shared, false);
1450}
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:532
@ WT_INDEX
A panel containing the Index Window.
Definition: mutt_window.h:96
Private state data for the Index.
Definition: private_data.h:35
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:40
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:41
int oldcount
Old count of mails 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 118 of file dlg_index.c.