From d52d214448fa5db7167ee89b532f299af02aa10c Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 15 Dec 2013 13:45:40 +0100 Subject: core: add buffer property "highlight_tags_restrict", rename option irc.look.highlight_tags to irc.look.highlight_tags_restrict The buffer property "highlight_tags" is renamed to "highlight_tags_restrict". New behavior for buffer property "highlight_tags": force highlight on tags. Option irc.look.highlight_tags is renamed to irc.look.highlight_tags_restrict. --- src/plugins/irc/irc-channel.c | 8 ++++---- src/plugins/irc/irc-config.c | 33 ++++++++++++++++++--------------- src/plugins/irc/irc-config.h | 2 +- src/plugins/irc/irc-server.c | 8 ++++---- 4 files changed, 27 insertions(+), 24 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index f30696881..28a51e724 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -253,11 +253,11 @@ irc_channel_new (struct t_irc_server *server, int channel_type, (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? weechat_config_string (irc_config_look_highlight_channel) : weechat_config_string (irc_config_look_highlight_pv)); - if (weechat_config_string (irc_config_look_highlight_tags) - && weechat_config_string (irc_config_look_highlight_tags)[0]) + if (weechat_config_string (irc_config_look_highlight_tags_restrict) + && weechat_config_string (irc_config_look_highlight_tags_restrict)[0]) { - weechat_buffer_set (new_buffer, "highlight_tags", - weechat_config_string (irc_config_look_highlight_tags)); + weechat_buffer_set (new_buffer, "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } } diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 49d06b575..6b3b1f818 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -69,7 +69,7 @@ struct t_config_option *irc_config_look_display_pv_back; struct t_config_option *irc_config_look_highlight_server; struct t_config_option *irc_config_look_highlight_channel; struct t_config_option *irc_config_look_highlight_pv; -struct t_config_option *irc_config_look_highlight_tags; +struct t_config_option *irc_config_look_highlight_tags_restrict; struct t_config_option *irc_config_look_item_away_message; struct t_config_option *irc_config_look_item_channel_modes_hide_key; struct t_config_option *irc_config_look_item_display_server; @@ -488,12 +488,12 @@ irc_config_change_look_item_nick_prefix (void *data, } /* - * Callback for changes on option "irc.look.highlight_tags". + * Callback for changes on option "irc.look.highlight_tags_restrict". */ void -irc_config_change_look_highlight_tags (void *data, - struct t_config_option *option) +irc_config_change_look_highlight_tags_restrict (void *data, + struct t_config_option *option) { struct t_irc_server *ptr_server; struct t_irc_channel *ptr_channel; @@ -507,16 +507,16 @@ irc_config_change_look_highlight_tags (void *data, { if (ptr_server->buffer) { - weechat_buffer_set (ptr_server->buffer, "highlight_tags", - weechat_config_string (irc_config_look_highlight_tags)); + weechat_buffer_set (ptr_server->buffer, "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { if (ptr_channel->buffer) { - weechat_buffer_set (ptr_channel->buffer, "highlight_tags", - weechat_config_string (irc_config_look_highlight_tags)); + weechat_buffer_set (ptr_channel->buffer, "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } } } @@ -2343,14 +2343,17 @@ irc_config_init () "disables default highlight on nick, examples: \"$nick\", " "\"(?-i)$nick\""), NULL, 0, 0, "$nick", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); - irc_config_look_highlight_tags = weechat_config_new_option ( - irc_config_file, ptr_section, - "highlight_tags", "string", - N_("comma separated list of tags for messages that may produce " - "highlight (usually any message from another user, not server " - "messages,..)"), + irc_config_look_highlight_tags_restrict = weechat_config_new_option ( + irc_config_file, ptr_section, + "highlight_tags_restrict", "string", + N_("restrict highlights to these tags on irc buffers (to have " + "highlight on user messages but not server messages); tags " + "must be separated by a comma and \"+\" can be used to make a " + "logical \"and\" between tags; tags can start or end with \"*\" " + "to match more than one tag; an empty value allows highlight on any " + "tag"), NULL, 0, 0, "irc_privmsg,irc_notice", NULL, 0, NULL, NULL, - &irc_config_change_look_highlight_tags, NULL, NULL, NULL); + &irc_config_change_look_highlight_tags_restrict, NULL, NULL, NULL); irc_config_look_item_away_message = weechat_config_new_option ( irc_config_file, ptr_section, "item_away_message", "boolean", diff --git a/src/plugins/irc/irc-config.h b/src/plugins/irc/irc-config.h index 6a0759455..0a5e13e0d 100644 --- a/src/plugins/irc/irc-config.h +++ b/src/plugins/irc/irc-config.h @@ -117,7 +117,7 @@ extern struct t_config_option *irc_config_look_display_pv_back; extern struct t_config_option *irc_config_look_highlight_server; extern struct t_config_option *irc_config_look_highlight_channel; extern struct t_config_option *irc_config_look_highlight_pv; -extern struct t_config_option *irc_config_look_highlight_tags; +extern struct t_config_option *irc_config_look_highlight_tags_restrict; extern struct t_config_option *irc_config_look_item_away_message; extern struct t_config_option *irc_config_look_item_channel_modes_hide_key; extern struct t_config_option *irc_config_look_item_display_server; diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index 0f5055c80..0fb4815ff 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -3460,11 +3460,11 @@ irc_server_create_buffer (struct t_irc_server *server) /* set highlights settings on server buffer */ weechat_buffer_set (server->buffer, "highlight_words_add", weechat_config_string (irc_config_look_highlight_server)); - if (weechat_config_string (irc_config_look_highlight_tags) - && weechat_config_string (irc_config_look_highlight_tags)[0]) + if (weechat_config_string (irc_config_look_highlight_tags_restrict) + && weechat_config_string (irc_config_look_highlight_tags_restrict)[0]) { - weechat_buffer_set (server->buffer, "highlight_tags", - weechat_config_string (irc_config_look_highlight_tags)); + weechat_buffer_set (server->buffer, "highlight_tags_restrict", + weechat_config_string (irc_config_look_highlight_tags_restrict)); } irc_server_set_buffer_title (server); -- cgit v1.2.3