120 regfree(&rcol->
regex);
154 struct RegexColorList *rcl =
MUTT_MEM_CALLOC(1,
struct RegexColorList);
245 struct Buffer *err,
bool is_index,
int match)
335 bool is_index =
false;
void attr_color_clear(struct AttrColor *ac)
Free the contents of an AttrColor.
void attr_color_overwrite(struct AttrColor *ac_old, const struct AttrColor *ac_new)
Update an AttrColor in-place.
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
void get_colorid_name(unsigned int cid, struct Buffer *buf)
Get the name of a Colour ID.
Color private Module data.
static enum CommandResult add_pattern(struct RegexColorList *rcl, const char *s, struct AttrColor *ac_val, struct Buffer *err, bool is_index, int match)
Associate a colour to a pattern.
struct RegexColorList * regex_colors_get_list(enum ColorId cid)
Return the RegexColorList for a Colour ID.
int regex_colors_parse_status_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int match, struct Buffer *err)
Parse a Regex 'color status' command.
bool regex_colors_parse_color_list(enum ColorId cid, const char *pat, struct AttrColor *ac, int *rc, struct Buffer *err)
Parse a Regex 'color' command.
void regex_colors_init(void)
Initialise the Regex colours.
void regex_colors_reset(void)
Reset the Regex colours.
void regex_color_free(struct RegexColor **ptr)
Free a Regex colour.
bool regex_colors_parse_uncolor(enum ColorId cid, const char *pat)
Parse a Regex 'uncolor' command.
void regex_colors_cleanup(void)
Cleanup the Regex colours.
struct RegexColor * regex_color_new(void)
Create a new RegexColor.
void regex_color_list_clear(struct RegexColorList *rcl)
Free the contents of a RegexColorList.
struct RegexColorList * regex_color_list_new(void)
Create a new RegexColorList.
void regex_color_clear(struct RegexColor *rcol)
Free the contents of a Regex colour.
Color and attribute parsing.
ColorId
List of all coloured objects.
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
@ MT_COLOR_HEADER
Message headers (takes a pattern)
@ MT_COLOR_STATUS
Status bar (takes a pattern)
@ MT_COLOR_INDEX_SIZE
Index: size field.
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
@ MT_COLOR_BODY
Pager: highlight body of message (takes a pattern)
@ MT_COLOR_INDEX_DATE
Index: date field.
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
@ MT_COLOR_ATTACH_HEADERS
MIME attachment test (takes a pattern)
@ MT_COLOR_INDEX_LABEL
Index: label field.
@ MT_COLOR_INDEX
Index: default colour.
@ MT_COLOR_INDEX_NUMBER
Index: index number.
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
CommandResult
Error codes for command_t parse functions.
@ MUTT_CMD_SUCCESS
Success: Command worked.
@ MUTT_CMD_ERROR
Error: Can't help the user.
struct PatternList * mutt_pattern_comp(struct MailboxView *mv, const char *s, PatternCompFlags flags, struct Buffer *err)
Create a Pattern.
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
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.
static int color_debug(enum LogLevel level, const char *format,...)
#define mutt_debug(LEVEL,...)
GUI manage the main index (list of emails)
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
@ LL_NOTIFY
Log of notifications.
bool mutt_mb_is_lower(const char *s)
Does a multi-byte string contain only lowercase characters?
#define FREE(x)
Free memory and set the pointer to NULL.
#define MUTT_MEM_CALLOC(n, type)
@ MODULE_ID_COLOR
ModuleColor, Color
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
@ NT_COLOR_RESET
Color has been reset/removed.
@ NT_COLOR_SET
Color has been set.
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Match patterns to emails.
#define MUTT_PC_FULL_MSG
Enable body and header matching.
void mutt_check_simple(struct Buffer *s, const char *simple)
Convert a simple search into a real request.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
#define STAILQ_REMOVE_HEAD(head, field)
#define STAILQ_REMOVE(head, elm, type, field)
#define STAILQ_INIT(head)
#define STAILQ_REMOVE_AFTER(head, elm, field)
#define STAILQ_FOREACH(var, head, field)
#define STAILQ_INSERT_TAIL(head, elm, field)
#define STAILQ_EMPTY(head)
#define STAILQ_FOREACH_SAFE(var, head, field, tvar)
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
A curses colour and its attributes.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
Color private Module data.
struct RegexColorList index_collapsed_list
List of colours applied to a collapsed thread in the index.
struct RegexColorList index_subject_list
List of colours applied to the subject in the index.
struct RegexColorList attach_list
List of colours applied to the attachment headers.
struct RegexColorList body_list
List of colours applied to the email body.
struct RegexColorList index_flags_list
List of colours applied to the flags in the index.
struct RegexColorList index_label_list
List of colours applied to the label in the index.
struct RegexColorList index_tags_list
List of colours applied to the tags in the index.
struct RegexColorList index_size_list
List of colours applied to the size in the index.
struct RegexColorList index_list
List of default colours applied to the index.
struct Notify * colors_notify
Notifications: ColorId, EventColor.
struct RegexColorList index_author_list
List of colours applied to the author in the index.
struct RegexColorList header_list
List of colours applied to the email headers.
struct RegexColorList index_date_list
List of colours applied to the date in the index.
struct RegexColorList index_number_list
List of colours applied to the message number in the index.
struct RegexColorList status_list
List of colours applied to the status bar.
struct RegexColorList index_tag_list
List of colours applied to tags in the index.
An Event that happened to a Colour.
enum ColorId cid
Colour ID that has changed.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
A regular expression and a color to highlight a line.
regex_t regex
Compiled regex.
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
struct AttrColor attr_color
Colour and attributes to apply.
char * pattern
Pattern to match.
bool stop_matching
Used by the pager for body patterns, to prevent the color from being retried once it fails.
int match
Substring to match, 0 for old behaviour.