68 notmuch_database_t *db = NULL;
69 notmuch_tags_t *tags = NULL;
72#if !LIBNOTMUCH_CHECK_VERSION(5, 4, 0)
78 !(tags = notmuch_database_get_all_tags(db)))
83 while (notmuch_tags_valid(tags))
85 const char *tag = notmuch_tags_get(tags);
91 notmuch_tags_move_to_next(tags);
98 notmuch_tags_destroy(tags);
139 char *pt = buf->
data;
143 spaces = pt - buf->
data;
202 char *pt = buf->
data;
205 char *last_space = strrchr(buf->
data,
' ');
207 pt = (last_space + 1);
210 if ((pt[0] ==
'+') || (pt[0] ==
'-'))
251 if (!wdata || ((op != OP_EDITOR_COMPLETE) && (op != OP_EDITOR_COMPLETE_QUERY)))
268 if (!wdata || ((op != OP_EDITOR_COMPLETE) && (op != OP_EDITOR_COMPLETE_QUERY)))
const char * buf_rfind(const struct Buffer *buf, const char *str)
Find last instance of a substring.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
void matches_ensure_morespace(struct CompletionData *cd, int new_size)
Allocate more space for auto-completion.
bool candidate(struct CompletionData *cd, char *user, const char *src, char *dest, size_t dlen)
Helper function for completion.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void completion_data_free_match_strings(struct CompletionData *cd)
Free the Completion strings.
FunctionRetval
Possible return values for NeoMutt functions.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_ERROR
Valid function - error occurred.
@ FR_NO_ACTION
Valid function - no action performed.
void replace_part(struct EnterState *es, size_t from, const char *buf)
Search and replace on a buffer.
enum FunctionRetval complete_nm_query(struct EnterWindowData *wdata, int op)
Complete a Notmuch Query - Implements CompleteOps::complete() -.
enum FunctionRetval complete_nm_tag(struct EnterWindowData *wdata, int op)
Complete a Notmuch Tag - Implements CompleteOps::complete() -.
Convenience wrapper for the gui headers.
GUI manage the main index (list of emails)
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
void buf_mb_wcstombs(struct Buffer *dest, const wchar_t *wstr, size_t wlen)
Convert a string from wide to multibyte characters.
Convenience wrapper for the library headers.
char * mutt_str_dup(const char *str)
Copy a string, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
static void nm_complete_data_init(struct CompletionData *cd, const char *pt)
Reset the completion state for a tag lookup.
int complete_all_nm_tags(struct CompletionData *cd, const char *pt)
Pass a list of Notmuch tags to the completion code.
bool mutt_nm_query_complete(struct CompletionData *cd, struct Buffer *buf, int numtabs)
Complete to the nearest notmuch tag.
const struct CompleteOps CompleteNmTagOps
Auto-Completion of NmTags.
static int complete_all_nm_tags_fresh(struct CompletionData *cd)
Query notmuch directly for a fresh tag list.
bool mutt_nm_tag_complete(struct CompletionData *cd, struct Buffer *buf, int numtabs)
Complete to the nearest notmuch tag.
const struct CompleteOps CompleteNmQueryOps
Auto-Completion of NmQuerys.
notmuch_database_t * nm_db_do_open(const char *filename, bool writable, bool verbose)
Open a Notmuch database.
const char * nm_db_get_filename(struct Mailbox *m)
Get the filename of the Notmuch database.
void nm_db_free(notmuch_database_t *db)
Decoupled way to close a Notmuch database.
Notmuch virtual mailbox type.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
State data for auto-completion.
int match_list_len
Enough space for all of the config items.
bool free_match_strings
Should the strings in match_list be freed?
char user_typed[1024]
Initial string that starts completion.
char completed[256]
Completed string (command or variable)
int num_matched
Number of matches for completion.
const char ** match_list
Matching strings.
size_t curpos
Position of the cursor.
wchar_t * wbuf
Buffer for the string being entered.
Data to fill the Enter Window.
int tabs
Number of times the user has hit tab.
struct CompletionData * cd
Auto-completion state data.
struct Buffer * buffer
struct Buffer for the result
struct EnterState * state
Current state of text entry.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.