NeoMutt  2023-03-22
Teaching an old dog new tricks
functions.h File Reference

Index functions. More...

#include <stdbool.h>
+ Include dependency graph for functions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  IndexFunction
 A NeoMutt function. More...


typedef int(* index_function_t) (struct IndexSharedData *shared, struct IndexPrivateData *priv, int op)


int index_function_dispatcher (struct MuttWindow *win, int op)
 Perform an Index function - Implements function_dispatcher_t -. More...
bool index_next_undeleted (struct MuttWindow *win_index)
 Select the next undeleted Email (if possible) More...


struct IndexFunction IndexFunctions []
 All the NeoMutt functions that the Index supports. More...

Detailed Description

Index functions.

  • Richard Russon

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

Definition in file functions.h.

Typedef Documentation

◆ index_function_t

typedef int(* index_function_t) (struct IndexSharedData *shared, struct IndexPrivateData *priv, int op)

Definition at line 43 of file functions.h.

Function Documentation

◆ index_next_undeleted()

bool index_next_undeleted ( struct MuttWindow win_index)

Select the next undeleted Email (if possible)

win_indexIndex Window
Return values
trueSelection succeeded

Definition at line 157 of file functions.c.

159 struct MuttWindow *dlg = dialog_find(win_index);
160 if (!dlg)
161 return false;
163 struct Menu *menu = win_index->wdata;
164 struct IndexSharedData *shared = dlg->wdata;
165 if (!shared)
166 return false;
168 struct IndexPrivateData *priv = win_index->parent->wdata;
169 const bool uncollapse = mutt_using_threads() && !window_is_focused(priv->win_index);
171 int index = ci_next_undeleted(shared->mailbox, menu_get_index(menu), uncollapse);
172 if ((index < 0) || (index >= shared->mailbox->vcount))
173 {
174 // Selection failed
176 return false;
177 }
179 menu_set_index(menu, index);
180 return true;
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition: dialog.c:83
int ci_next_undeleted(struct Mailbox *m, int msgno, bool uncollapse)
Find the next undeleted email.
Definition: dlg_index.c:240
Email has changed.
Definition: lib.h:66
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:154
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition: menu.c:168
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition: notify.c:171
#define mutt_using_threads()
Definition: mutt_thread.h:100
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
Definition: mutt_window.c:628
Index data has changed, NotifyIndex, IndexSharedData.
Definition: notify_type.h:48
Private state data for the Index.
Definition: private_data.h:35
struct MuttWindow * win_index
Window for the Index.
Definition: private_data.h:44
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:42
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:43
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
int vcount
The number of virtual messages.
Definition: mailbox.h:99
Definition: lib.h:70
void * wdata
Private data.
Definition: mutt_window.h:145
struct MuttWindow * parent
Parent Window.
Definition: mutt_window.h:135
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ IndexFunctions

struct IndexFunction IndexFunctions[]

All the NeoMutt functions that the Index supports.

Definition at line 2877 of file functions.c.