63 if ((
nm_get_all_tags(m_cur, NULL, &tag_count_1) != 0) || (tag_count_1 == 0))
68 if ((
nm_get_all_tags(m_cur, nm_tags, &tag_count_2) != 0) || (tag_count_1 != tag_count_2))
75 for (
int i = 0; i < tag_count_1; i++)
103 char *pt = buf->
data;
107 spaces = pt - buf->
data;
166 char *pt = buf->
data;
169 char *last_space = strrchr(buf->
data,
' ');
171 pt = (last_space + 1);
174 if ((pt[0] ==
'+') || (pt[0] ==
'-'))
215 if (!wdata || ((op != OP_EDITOR_COMPLETE) && (op != OP_EDITOR_COMPLETE_QUERY)))
232 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.
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.
#define MUTT_MEM_CALLOC(n, type)
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)
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.
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.
void nm_db_longrun_done(struct Mailbox *m)
Finish a long transaction.
void nm_db_longrun_init(struct Mailbox *m, bool writable)
Start a long transaction.
Notmuch virtual mailbox type.
int nm_get_all_tags(struct Mailbox *m, const char **tag_list, int *tag_count)
Fill a list with all notmuch tags.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
enum FunctionRetval(* complete)(struct EnterWindowData *wdata, int op)
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.