NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
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...
 

Typedefs

typedef int(* index_function_t) (struct IndexSharedData *shared, struct IndexPrivateData *priv, const struct KeyEvent *event)
 

Functions

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

Variables

struct MenuDefinitionMdIndex
 Index Menu Definition.
 

Detailed Description

Index functions.

Authors
  • 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 http://www.gnu.org/licenses/.

Definition in file functions.h.

Typedef Documentation

◆ index_function_t

typedef int(* index_function_t) (struct IndexSharedData *shared, struct IndexPrivateData *priv, const struct KeyEvent *event)

Definition at line 50 of file functions.h.

Function Documentation

◆ index_next_undeleted()

bool index_next_undeleted ( struct MuttWindow * win_index)

Select the next undeleted Email (if possible)

Parameters
win_indexIndex Window
Return values
trueSelection succeeded

Definition at line 394 of file functions.c.

395{
396 struct MuttWindow *dlg = dialog_find(win_index);
397 if (!dlg)
398 return false;
399
400 struct Menu *menu = win_index->wdata;
401 struct IndexSharedData *shared = dlg->wdata;
402 if (!shared)
403 return false;
404
405 struct IndexPrivateData *priv = win_index->parent->wdata;
406 const bool uncollapse = mutt_using_threads() && !window_is_focused(priv->win_index);
407
408 int index = find_next_undeleted(shared->mailbox_view, menu_get_index(menu), uncollapse);
409 if ((index < 0) || (index >= shared->mailbox->vcount))
410 {
411 // Selection failed
413 return false;
414 }
415
416 menu_set_index(menu, index);
417 return true;
418}
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
int find_next_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the next undeleted email.
Definition dlg_index.c:238
#define mutt_using_threads()
Definition thread.h:113
#define NT_INDEX_EMAIL
Email has changed.
Definition lib.h:76
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:164
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:178
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition notify.c:173
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
@ NT_INDEX
Index data has changed, NotifyIndex, IndexSharedData.
Definition notify_type.h:48
Private state data for the Index.
struct MuttWindow * win_index
Window for the Index.
struct IndexSharedData * shared
Shared Index data.
struct Menu * menu
Menu controlling the index.
Data shared between Index, Pager and Sidebar.
Definition shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition shared_data.h:41
struct MailboxView * mailbox_view
Current Mailbox view.
Definition shared_data.h:40
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition shared_data.h:44
int vcount
The number of virtual messages.
Definition mailbox.h:98
Definition lib.h:80
void * wdata
Private data.
struct MuttWindow * parent
Parent Window.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MdIndex

struct MenuDefinition* MdIndex
extern

Index Menu Definition.

Definition at line 80 of file functions.c.