NeoMutt  2025-12-11-435-g4ac674
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
module.c File Reference

Definition of the Notmuch Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "config/lib.h"
#include "core/lib.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool notmuch_config_define_variables (struct NeoMutt *n, struct ConfigSet *cs)
 Define the Config Variables - Implements Module::config_define_variables()
 
static bool notmuch_commands_register (struct NeoMutt *n, struct CommandArray *ca)
 Register NeoMutt Commands - Implements Module::commands_register()
 

Variables

struct ConfigDef NotmuchVars []
 Config definitions for the Notmuch library.
 
const struct Command NmCommands []
 Notmuch Commands.
 
const struct Module ModuleNotmuch
 Module for the Notmuch library.
 

Detailed Description

Definition of the Notmuch Module.

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 module.c.

Function Documentation

◆ notmuch_config_define_variables()

static bool notmuch_config_define_variables ( struct NeoMutt * n,
struct ConfigSet * cs )
static

Define the Config Variables - Implements Module::config_define_variables()

Definition at line 42 of file module.c.

43{
44 bool rc = false;
45
46#if defined(USE_NOTMUCH)
48#endif
49
50 return rc;
51}
bool cs_register_variables(const struct ConfigSet *cs, struct ConfigDef vars[])
Register a set of config items.
Definition set.c:290
struct ConfigDef NotmuchVars[]
Config definitions for the Notmuch library.
Definition config.c:105
+ Here is the call graph for this function:

◆ notmuch_commands_register()

static bool notmuch_commands_register ( struct NeoMutt * n,
struct CommandArray * ca )
static

Register NeoMutt Commands - Implements Module::commands_register()

Definition at line 56 of file module.c.

57{
58 return commands_register(ca, NmCommands);
59}
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
const struct Command NmCommands[]
Notmuch Commands.
Definition notmuch.c:91
+ Here is the call graph for this function:

Variable Documentation

◆ NotmuchVars

struct ConfigDef NotmuchVars[]
extern

Config definitions for the Notmuch library.

Definition at line 105 of file config.c.

105 {
106 // clang-format off
107 { "nm_config_file", DT_PATH|D_PATH_FILE, IP "auto", 0, NULL,
108 "(notmuch) Configuration file for notmuch. Use 'auto' to detect configuration."
109 },
110 { "nm_config_profile", DT_STRING, 0, 0, NULL,
111 "(notmuch) Configuration profile for notmuch."
112 },
113 { "nm_db_limit", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
114 "(notmuch) Default limit for Notmuch queries"
115 },
116 { "nm_default_url", DT_STRING, 0, 0, nm_default_url_validator,
117 "(notmuch) Path to the Notmuch database"
118 },
119 { "nm_exclude_tags", DT_STRING, 0, 0, NULL,
120 "(notmuch) Exclude messages with these tags"
121 },
122 { "nm_flagged_tag", DT_STRING, IP "flagged", 0, NULL,
123 "(notmuch) Tag to use for flagged messages"
124 },
125 { "nm_open_timeout", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 5, 0, NULL,
126 "(notmuch) Database timeout"
127 },
128 { "nm_query_type", DT_STRING, IP "messages", 0, NULL,
129 "(notmuch) Default query type: 'threads' or 'messages'"
130 },
131 { "nm_query_window_current_position", DT_NUMBER, 0, 0, NULL,
132 "(notmuch) Position of current search window"
133 },
134 { "nm_query_window_current_search", DT_STRING, 0, 0, NULL,
135 "(notmuch) Current search parameters"
136 },
137 { "nm_query_window_duration", DT_NUMBER|D_INTEGER_NOT_NEGATIVE, 0, 0, NULL,
138 "(notmuch) Time duration of the current search window"
139 },
140 { "nm_query_window_enable", DT_BOOL, false, 0, NULL,
141 "(notmuch) Enable query windows"
142 },
143 { "nm_query_window_or_terms", DT_STRING, 0, 0, NULL,
144 "(notmuch) Additional notmuch search terms for messages to be shown regardless of date"
145 },
146 { "nm_query_window_timebase", DT_STRING, IP "week", 0, nm_query_window_timebase_validator,
147 "(notmuch) Units for the time duration"
148 },
149 { "nm_record_tags", DT_STRING, 0, 0, NULL,
150 "(notmuch) Tags to apply to the 'record' mailbox (sent mail)"
151 },
152 { "nm_replied_tag", DT_STRING, IP "replied", 0, NULL,
153 "(notmuch) Tag to use for replied messages"
154 },
155 { "nm_unread_tag", DT_STRING, IP "unread", 0, NULL,
156 "(notmuch) Tag to use for unread messages"
157 },
158 { "virtual_spool_file", DT_BOOL, false, 0, NULL,
159 "(notmuch) Use the first virtual mailbox as a spool file"
160 },
161
162 { "vfolder_format", D_INTERNAL_DEPRECATED|DT_STRING, 0, IP "2018-11-01" },
163
164 { "nm_default_uri", DT_SYNONYM, IP "nm_default_url", IP "2021-02-11" },
165 { "virtual_spoolfile", DT_SYNONYM, IP "virtual_spool_file", IP "2025-12-08" },
166 { NULL },
167 // clang-format on
168};
#define IP
Definition set.h:54
static int nm_default_url_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "nm_default_url" config variable - Implements ConfigDef::validator() -.
Definition config.c:58
static int nm_query_window_timebase_validator(const struct ConfigDef *cdef, intptr_t value, struct Buffer *err)
Validate the "nm_query_window_timebase" config variable - Implements ConfigDef::validator() -.
Definition config.c:84
#define D_INTERNAL_DEPRECATED
Config item shouldn't be used any more.
Definition types.h:88
#define D_PATH_FILE
Path is a file.
Definition types.h:104
@ DT_NUMBER
a number
Definition types.h:38
@ DT_BOOL
boolean option
Definition types.h:32
@ DT_SYNONYM
synonym for another variable
Definition types.h:45
@ DT_STRING
a string
Definition types.h:44
@ DT_PATH
a path to a file/directory
Definition types.h:39
#define D_INTEGER_NOT_NEGATIVE
Negative numbers are not allowed.
Definition types.h:101

◆ NmCommands

const struct Command NmCommands[]
extern

Notmuch Commands.

Definition at line 91 of file notmuch.c.

91 {
92 // clang-format off
93 // Deprecated
94 { "unvirtual-mailboxes", CMD_NONE, NULL, "unmailboxes", NULL, NULL, CF_SYNONYM },
95 { "virtual-mailboxes", CMD_NONE, NULL, "named-mailboxes", NULL, NULL, CF_SYNONYM },
96
97 { NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NO_FLAGS },
98 // clang-format on
99};
#define CF_SYNONYM
Command is a synonym for another command.
Definition command.h:49
#define CF_NO_FLAGS
No flags are set.
Definition command.h:48
@ CMD_NONE
No Command.
Definition command.h:59

◆ ModuleNotmuch

const struct Module ModuleNotmuch
Initial value:
= {
"notmuch",
NULL,
NULL,
NULL,
NULL,
NULL,
}
@ MODULE_ID_NOTMUCH
ModuleNotmuch, Notmuch
Definition module_api.h:82
static bool notmuch_config_define_variables(struct NeoMutt *n, struct ConfigSet *cs)
Define the Config Variables - Implements Module::config_define_variables()
Definition module.c:42
static bool notmuch_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:56

Module for the Notmuch library.

Definition at line 64 of file module.c.

64 {
66 "notmuch",
67 NULL, // init
68 NULL, // config_define_types
71 NULL, // gui_init
72 NULL, // gui_cleanup
73 NULL, // cleanup
74};