diff options
51 files changed, 848 insertions, 100 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index b07111936..817251b1d 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -20,6 +20,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] New features:: + * core: add option weechat.look.highlight_disable_regex and buffer property "highlight_disable_regex" (issue #1798) * api: rename function string_build_with_split_string to string_rebuild_split_string, add arguments "index_start" and "index_end" * api: add info "uptime_current" diff --git a/doc/de/includes/autogen_api_hdata.de.adoc b/doc/de/includes/autogen_api_hdata.de.adoc index 6e66e0acd..3a352d85d 100644 --- a/doc/de/includes/autogen_api_hdata.de.adoc +++ b/doc/de/includes/autogen_api_hdata.de.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/de/includes/autogen_user_options.de.adoc b/doc/de/includes/autogen_user_options.de.adoc index 376e712f2..1115b26d2 100644 --- a/doc/de/includes/autogen_user_options.de.adoc +++ b/doc/de/includes/autogen_user_options.de.adoc @@ -750,6 +750,12 @@ ** Werte: beliebige Zeichenkette ** Standardwert: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** Beschreibung: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"] +** Typ: Zeichenkette +** Werte: beliebige Zeichenkette +** Standardwert: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** Beschreibung: pass:none[Suchmuster (erweiterter regulärer POSIX Ausdruck) welches genutzt werden soll, um zu überprüfen ob eine Nachricht ein Highlight enthält oder nicht. Mindestens eine Zeichenkette muss dabei auf das Suchmuster passen (alphanumerisch, "-", "_" oder "|"). Das Suchmuster unterscheidet dabei nicht zwischen Groß-und Kleinschreibung (um zwischen Groß-und Kleinschreibung zu unterscheiden muss am Wortanfang "(?-i)" genutzt werden). Beispiele: "flashcode|flashy", "(?-i)FlashCode|flashy"] ** Typ: Zeichenkette diff --git a/doc/de/weechat_user.de.adoc b/doc/de/weechat_user.de.adoc index 2c6e8f783..9f6c501e7 100644 --- a/doc/de/weechat_user.de.adoc +++ b/doc/de/weechat_user.de.adoc @@ -2208,6 +2208,37 @@ und um eine Hilfe zu erhalten wie man es nutzt: `+/help buffer_autoset+`. [[highlights]] === Highlights +// TRANSLATION MISSING +[[highlights_disable]] +==== Disable highlights + +You can disable highlights with option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(regular expression). + +When a highlight is disabled with this option, the other highlight options are +ignored. + +For example to disable any highlight on messages with a word beginning +with "flash" between chevrons: + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +This can also be set with the buffer property "highlight_disable_regex". + +Same example, specific to the current buffer: + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +Die Buffer-Eigenschaft "highlight_disable_regex" ist keine permanente Einstellung und wird nicht +in der Konfigurationsdatei gesichert. + Um diese Einstellung persistent zu machen benötigt man +das Skript _buffer_autoset.py_: Um das Skript zu installieren `+/script install buffer_autoset.py+` +und um eine Hilfe zu erhalten wie man es nutzt: `+/help buffer_autoset+`. + [[highlights_words]] ==== Worte als Highlights hinzufügen @@ -2221,7 +2252,7 @@ neben dem eigenen Nick auch die Wörter "Wort1","Wort2" und alle Wörter die mit "Test" beginnen zu highlighten: ---- -/set weechat.look.highlight Wort1,Wort2,Test* +/set weechat.look.highlight "Wort1,Wort2,Test*" ---- Wird eine spezielle Regel benötigt, dann können reguläre Ausdrücke @@ -2231,7 +2262,7 @@ um zum Beispiel die Wörter "flashcode", "flashcöde" und "flashy" zu highlighten: ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- Die Trennzeichen die Wörter umschließen können angepasst werden, mit der diff --git a/doc/en/includes/autogen_api_hdata.en.adoc b/doc/en/includes/autogen_api_hdata.en.adoc index 84ca7684d..a98fed949 100644 --- a/doc/en/includes/autogen_api_hdata.en.adoc +++ b/doc/en/includes/autogen_api_hdata.en.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/en/includes/autogen_user_options.en.adoc b/doc/en/includes/autogen_user_options.en.adoc index 33b30465b..8e2298087 100644 --- a/doc/en/includes/autogen_user_options.en.adoc +++ b/doc/en/includes/autogen_user_options.en.adoc @@ -750,6 +750,12 @@ ** values: any string ** default value: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** description: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"] +** type: string +** values: any string +** default value: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** description: pass:none[POSIX extended regular expression used to check if a message has highlight or not, at least one match in string must be surrounded by delimiters (chars different from: alphanumeric, "-", "_" and "|"), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "flashcode|flashy", "(?-i)FlashCode|flashy"] ** type: string diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index bdf50e3c7..d30cf783a 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -13219,6 +13219,7 @@ Arguments: ** _input_: input text ** _text_search_input_: input saved before text search ** _highlight_words_: list of words to highlight +** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight ** _highlight_regex_: POSIX extended regular expression for highlight ** _highlight_tags_restrict_: restrict highlights to messages with these tags ** _highlight_tags_: force highlight on messages with these tags @@ -13270,6 +13271,7 @@ Arguments: * _property_: property name: ** _plugin_: pointer to plugin which created this buffer (NULL for WeeChat main buffer) +** _highlight_disable_regex_compiled_: regular expression _highlight_disable_regex_ compiled ** _highlight_regex_compiled_: regular expression _highlight_regex_ compiled Return value: @@ -13407,6 +13409,9 @@ Properties: | highlight_words_del | | comma separated list of words | Comma separated list of words to remove from highlighted words on buffer. +| highlight_disable_regex | | any string +| POSIX extended regular expression for disabling highlight. + | highlight_regex | | any string | POSIX extended regular expression for highlight. diff --git a/doc/en/weechat_relay_protocol.en.adoc b/doc/en/weechat_relay_protocol.en.adoc index 8e0749247..2724b2f2a 100644 --- a/doc/en/weechat_relay_protocol.en.adoc +++ b/doc/en/weechat_relay_protocol.en.adoc @@ -691,6 +691,8 @@ inl: text_search_found: 0 text_search_input: None highlight_words: None + highlight_disable_regex: None + highlight_disable_regex_compiled: '0x0' highlight_regex: None highlight_regex_compiled: '0x0' highlight_tags_restrict: None diff --git a/doc/en/weechat_user.en.adoc b/doc/en/weechat_user.en.adoc index e57c889ca..183035c58 100644 --- a/doc/en/weechat_user.en.adoc +++ b/doc/en/weechat_user.en.adoc @@ -2179,6 +2179,36 @@ with `+/script install buffer_autoset.py+` and get help with [[highlights]] === Highlights +[[highlights_disable]] +==== Disable highlights + +You can disable highlights with option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(regular expression). + +When a highlight is disabled with this option, the other highlight options are +ignored. + +For example to disable any highlight on messages with a word beginning +with "flash" between chevrons: + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +This can also be set with the buffer property "highlight_disable_regex". + +Same example, specific to the current buffer: + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +The buffer property "highlight_disable_regex" is not saved in configuration. + +You can easily save it with the script _buffer_autoset.py_: you can install it +with `+/script install buffer_autoset.py+` and get help with +`+/help buffer_autoset+`. + [[highlights_words]] ==== Add words to highlight @@ -2191,7 +2221,7 @@ You can add other words to highlight with the option highlight your nick and "word1", "word2" and all words beginning with "test": ---- -/set weechat.look.highlight word1,word2,test* +/set weechat.look.highlight "word1,word2,test*" ---- If you need a more specific rule for the word, you can use regular expressions @@ -2199,7 +2229,7 @@ with the option <<option_weechat.look.highlight_regex,weechat.look.highlight_reg for example to highlight words "flashcode", "flashcöde" and "flashy": ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- The delimiters around words to highlight can be customized with the option diff --git a/doc/fr/includes/autogen_api_hdata.fr.adoc b/doc/fr/includes/autogen_api_hdata.fr.adoc index 9862dc062..859454a35 100644 --- a/doc/fr/includes/autogen_api_hdata.fr.adoc +++ b/doc/fr/includes/autogen_api_hdata.fr.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/fr/includes/autogen_user_options.fr.adoc b/doc/fr/includes/autogen_user_options.fr.adoc index 73c3b6a8c..dcefa235f 100644 --- a/doc/fr/includes/autogen_user_options.fr.adoc +++ b/doc/fr/includes/autogen_user_options.fr.adoc @@ -750,6 +750,12 @@ ** valeurs: toute chaîne ** valeur par défaut: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** description: pass:none[expression régulière POSIX étendue utilisée pour empêcher un highlight sur un message : cette option a une priorité plus élevée sur les autres options de highlight (si la chaîne est trouvée dans le message, le highlight est désactivé et les autres options sont ignorées), l'expression régulière est insensible à la casse (utilisez "(?-i)" au début pour la rendre sensible à la casse), exemples : "<flash.*>", "(?-i)<Flash.*>"] +** type: chaîne +** valeurs: toute chaîne +** valeur par défaut: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** description: pass:none[expression régulière POSIX étendue utilisée pour vérifier si un message a un "highlight" ou non, au moins une correspondance dans la chaîne doit être entourée de délimiteurs (caractères différents de : alphanumérique, "-", "_" et "|"), l'expression régulière est insensible à la casse (utilisez "(?-i)" au début pour la rendre sensible à la casse), exemples : "flashcode|flashy", "(?-i)FlashCode|flashy"] ** type: chaîne diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index 18c3c989d..9c16ea295 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -13502,6 +13502,8 @@ Paramètres : ** _input_ : texte saisi ** _text_search_input_ : texte saisi sauvegardé avant la recherche de texte ** _highlight_words_ : liste des mots pour le highlight +** _highlight_disable_regex_ : expression régulière POSIX étendue pour désactiver + le highlight ** _highlight_regex_ : expression régulière POSIX étendue pour le highlight ** _highlight_tags_restrict_ : restreindre les highlights aux messages comportant ces étiquettes @@ -13555,6 +13557,7 @@ Paramètres : * _property_ : nom de la propriété : ** _plugin_ : pointeur vers l'extension qui a créé le tampon (NULL pour le tampon principal WeeChat) +** _highlight_disable_regex_compiled_ : expression régulière _highlight_disable_regex_ compilée ** _highlight_regex_compiled_ : expression régulière _highlight_regex_ compilée Valeur de retour : @@ -13700,6 +13703,9 @@ Propriétés : | Liste de mots à supprimer de la liste des mots à mettre en valeur dans ce tampon. +| highlight_disable_regex | | any string +| Expression régulière POSIX étendue pour désactiver le highlight. + | highlight_regex | | toute chaîne | Expression régulière POSIX étendue pour le highlight. diff --git a/doc/fr/weechat_relay_protocol.fr.adoc b/doc/fr/weechat_relay_protocol.fr.adoc index 7595cf368..002bafc71 100644 --- a/doc/fr/weechat_relay_protocol.fr.adoc +++ b/doc/fr/weechat_relay_protocol.fr.adoc @@ -704,6 +704,8 @@ inl: text_search_found: 0 text_search_input: None highlight_words: None + highlight_disable_regex: None + highlight_disable_regex_compiled: '0x0' highlight_regex: None highlight_regex_compiled: '0x0' highlight_tags_restrict: None diff --git a/doc/fr/weechat_user.fr.adoc b/doc/fr/weechat_user.fr.adoc index 470deac5b..758ec1f80 100644 --- a/doc/fr/weechat_user.fr.adoc +++ b/doc/fr/weechat_user.fr.adoc @@ -2240,6 +2240,38 @@ avec `+/help buffer_autoset+`. [[highlights]] === Highlights +// TRANSLATION MISSING +[[highlights_disable]] +==== Désactiver les highlights + +Vous pouvez désactiver les highlights avec l'option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(expression régulière). + +Lorsqu'un highlight est désactivé avec cette option, les autres options de +highlight sont ignorées. + +Par exemple pour désactiver tout highlight sur les messages avec un mot +commençant par "flash" entre chevrons : + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +Ceci peut aussi être défini avec la propriété de tampon "highlight_disable_regex". + +Même exemple, spécifique au tampon courant : + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +La propriété de tampon "highlight_disable_regex" n'est pas sauvegardée dans la +configuration. + +Vous pouvez facilement la sauvegarder avec le script _buffer_autoset.py_ : vous +pouvez l'installer avec `+/script install buffer_autoset.py+` et obtenir de l'aide +avec `+/help buffer_autoset+`. + [[highlights_words]] ==== Ajouter des mots pour le « highlight » @@ -2252,7 +2284,7 @@ Vous pouvez ajouter d'autres mots à mettre en valeur avec l'option en valeur votre pseudo, "mot1", "mot2" et tous les mots commençants par "test" : ---- -/set weechat.look.highlight mot1,mot2,test* +/set weechat.look.highlight "mot1,mot2,test*" ---- Si vous avez besoin d'une règle plus spécifique pour un mot, vous pouvez utiliser @@ -2261,7 +2293,7 @@ des expressions régulières avec l'option par exemple pour mettre en valeur les mots "flashcode", "flashcöde" et "flashy" : ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- Les délimiteurs autour des mots à mettre en valeur peuvent être paramétrés avec diff --git a/doc/it/includes/autogen_api_hdata.it.adoc b/doc/it/includes/autogen_api_hdata.it.adoc index c7511454e..e2722ee5a 100644 --- a/doc/it/includes/autogen_api_hdata.it.adoc +++ b/doc/it/includes/autogen_api_hdata.it.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/it/includes/autogen_user_options.it.adoc b/doc/it/includes/autogen_user_options.it.adoc index 9457d0656..c5ae369d7 100644 --- a/doc/it/includes/autogen_user_options.it.adoc +++ b/doc/it/includes/autogen_user_options.it.adoc @@ -750,6 +750,12 @@ ** valori: qualsiasi stringa ** valore predefinito: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** descrizione: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"] +** tipo: stringa +** valori: qualsiasi stringa +** valore predefinito: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** descrizione: pass:none[POSIX extended regular expression used to check if a message has highlight or not, at least one match in string must be surrounded by delimiters (chars different from: alphanumeric, "-", "_" and "|"), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "flashcode|flashy", "(?-i)FlashCode|flashy"] ** tipo: stringa diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index 391e47165..5f939470c 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -13785,6 +13785,8 @@ Argomenti: ** _text_search_input_: input salvato prima della ricerca nel testo ** _highlight_words_: elenco di parole da evidenziare // TRANSLATION MISSING +** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight +// TRANSLATION MISSING ** _highlight_regex_: POSIX extended regular expression for highlight // TRANSLATION MISSING ** _highlight_tags_restrict_: restrict highlights to messages with these tags @@ -13838,6 +13840,7 @@ Argomenti: * _property_: nome proprietà: ** _plugin_: puntatore al plugin che ha creato questo buffer (NULL per il buffer principale di WeeChat) +** _highlight_disable_regex_compiled_: espressione regolare _highlight_disable_regex_ compilata ** _highlight_regex_compiled_: espressione regolare _highlight_regex_ compilata Valore restituito: @@ -13996,6 +13999,10 @@ Properties: parole evidenziate nel buffer. // TRANSLATION MISSING +| highlight_disable_regex | | any string +| POSIX extended regular expression for disabling highlight. + +// TRANSLATION MISSING | highlight_regex | | qualsiasi stringa | POSIX extended regular expression for highlight. diff --git a/doc/it/weechat_user.it.adoc b/doc/it/weechat_user.it.adoc index 9911d28b3..35a983465 100644 --- a/doc/it/weechat_user.it.adoc +++ b/doc/it/weechat_user.it.adoc @@ -2393,6 +2393,37 @@ with `+/script install buffer_autoset.py+` and get help with `+/help buffer_auto [[highlights]] === Highlights +// TRANSLATION MISSING +[[highlights_disable]] +==== Disable highlights + +You can disable highlights with option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(regular expression). + +When a highlight is disabled with this option, the other highlight options are +ignored. + +For example to disable any highlight on messages with a word beginning +with "flash" between chevrons: + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +This can also be set with the buffer property "highlight_disable_regex". + +Same example, specific to the current buffer: + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +The buffer property "highlight_disable_regex" is not saved in configuration. + +You can easily save it with the script _buffer_autoset.py_: you can install it +with `+/script install buffer_autoset.py+` and get help with +`+/help buffer_autoset+`. + [[highlights_words]] ==== Add words to highlight @@ -2405,7 +2436,7 @@ You can add other words to highlight with the option highlight your nick and "word1", "word2" and all words beginning with "test": ---- -/set weechat.look.highlight word1,word2,test* +/set weechat.look.highlight "word1,word2,test*" ---- If you need a more specific rule for the word, you can use regular expressions @@ -2413,7 +2444,7 @@ with the option <<option_weechat.look.highlight_regex,weechat.look.highlight_reg for example to highlight words "flashcode", "flashcöde" and "flashy": ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- The delimiters around words to highlight can be customized with the option diff --git a/doc/ja/includes/autogen_api_hdata.ja.adoc b/doc/ja/includes/autogen_api_hdata.ja.adoc index eb474f2ed..7bc9ced4f 100644 --- a/doc/ja/includes/autogen_api_hdata.ja.adoc +++ b/doc/ja/includes/autogen_api_hdata.ja.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/ja/includes/autogen_user_options.ja.adoc b/doc/ja/includes/autogen_user_options.ja.adoc index a962d6ef8..6e4dc27dd 100644 --- a/doc/ja/includes/autogen_user_options.ja.adoc +++ b/doc/ja/includes/autogen_user_options.ja.adoc @@ -750,6 +750,12 @@ ** 値: 未制約文字列 ** デフォルト値: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** 説明: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"] +** タイプ: 文字列 +** 値: 未制約文字列 +** デフォルト値: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** 説明: pass:none[メッセージ中のハイライトの有無を判断する POSIX 拡張正規表現、マッチ部分は必ず区切り文字 (アルファベット、"-"、"_"、"|" 以外の文字) で囲まれていなければいけない、正規表現は大文字小文字を区別しない (最初に "(?-i)" がある場合は区別する)、例: "flashcode|flashy"、"(?-i)FlashCode|flashy"] ** タイプ: 文字列 diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index c3e8c2837..7759e2cc0 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -13291,6 +13291,8 @@ const char *weechat_buffer_get_string (struct t_gui_buffer *buffer, ** _input_: 入力テキスト ** _text_search_input_: テキスト検索前に保存した入力テキスト ** _highlight_words_: ハイライトする単語のリスト +// TRANSLATION MISSING +** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight ** _highlight_regex_: ハイライト用の POSIX 拡張正規表現 ** _highlight_tags_restrict_: これらのタグを付けられたメッセージだけにハイライトを制限する ** _highlight_tags_: これらのタグを付けられたメッセージを強制的にハイライトする @@ -13342,6 +13344,7 @@ void *weechat_buffer_pointer (struct t_gui_buffer *buffer, * _property_: プロパティ名: ** _plugin_: このバッファを作ったプラグインへのポインタ (WeeChat メインバッファの場合は NULL) +** _highlight_disable_regex_compiled_: コンパイル済みの正規表現 _highlight_disable_regex_ ** _highlight_regex_compiled_: コンパイル済みの正規表現 _highlight_regex_ 戻り値: @@ -13479,6 +13482,10 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, | highlight_words_del | | 単語のコンマ区切りリスト | 指定したバッファ内でハイライトする単語から削除する単語のコンマ区切りリスト +// TRANSLATION MISSING +| highlight_disable_regex | | any string +| POSIX extended regular expression for disabling highlight. + | highlight_regex | | 任意の文字列 | ハイライトする POSIX 拡張正規表現 diff --git a/doc/ja/weechat_relay_protocol.ja.adoc b/doc/ja/weechat_relay_protocol.ja.adoc index acf70635b..c55818fd3 100644 --- a/doc/ja/weechat_relay_protocol.ja.adoc +++ b/doc/ja/weechat_relay_protocol.ja.adoc @@ -710,6 +710,8 @@ inl: text_search_found: 0 text_search_input: None highlight_words: None + highlight_disable_regex: None + highlight_disable_regex_compiled: '0x0' highlight_regex: None highlight_regex_compiled: '0x0' highlight_tags_restrict: None diff --git a/doc/ja/weechat_user.ja.adoc b/doc/ja/weechat_user.ja.adoc index 9d66da2b8..cfcb3514a 100644 --- a/doc/ja/weechat_user.ja.adoc +++ b/doc/ja/weechat_user.ja.adoc @@ -2293,6 +2293,36 @@ irc サーバ "libera" に含まれる全てのバッファに対して設定す [[highlights]] === ハイライト +// TRANSLATION MISSING +[[highlights_disable]] +==== Disable highlights + +You can disable highlights with option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(regular expression). + +When a highlight is disabled with this option, the other highlight options are +ignored. + +For example to disable any highlight on messages with a word beginning +with "flash" between chevrons: + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +This can also be set with the buffer property "highlight_disable_regex". + +Same example, specific to the current buffer: + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +バッファプロパティ "highlight_disable_regex" は設定ファイルに保存されません。 + +これを保存するには _buffer_autoset.py_ スクリプトを使ってください: このスクリプトをインストールするには +`+/script install buffer_autoset.py+` コマンドを使い、ヘルプを見るには `+/help buffer_autoset+` コマンドを使ってください。 + [[highlights_words]] ==== ハイライトする単語の追加 @@ -2305,7 +2335,7 @@ irc サーバ "libera" に含まれる全てのバッファに対して設定す から始まる任意の単語をハイライトするには以下のように設定します: ---- -/set weechat.look.highlight word1,word2,test* +/set weechat.look.highlight "word1,word2,test*" ---- 単語に対してさらに具体的なルールを設定する必要がある場合、<<option_weechat.look.highlight_regex,weechat.look.highlight_regex>> @@ -2313,7 +2343,7 @@ irc サーバ "libera" に含まれる全てのバッファに対して設定す という単語をハイライトするには以下のように設定します: ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- ハイライトする単語の区切りは <<option_weechat.look.word_chars_highlight,weechat.look.word_chars_highlight>> diff --git a/doc/pl/includes/autogen_api_hdata.pl.adoc b/doc/pl/includes/autogen_api_hdata.pl.adoc index 877937004..efd3dc432 100644 --- a/doc/pl/includes/autogen_api_hdata.pl.adoc +++ b/doc/pl/includes/autogen_api_hdata.pl.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/pl/includes/autogen_user_options.pl.adoc b/doc/pl/includes/autogen_user_options.pl.adoc index a830cad65..b19ef023d 100644 --- a/doc/pl/includes/autogen_user_options.pl.adoc +++ b/doc/pl/includes/autogen_user_options.pl.adoc @@ -750,6 +750,12 @@ ** wartości: dowolny ciąg ** domyślna wartość: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** opis: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"] +** typ: ciąg +** wartości: dowolny ciąg +** domyślna wartość: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** opis: pass:none[Rozszerzone wyrażenie regularne POSIX używane do sprawdzenia, czy wiadomość posiada podświetlenie czy nie, przynajmniej jedno dopasowanie w ciąg musi być otoczone separatorami (znaki inne niż: alfanumeryczne, "-", "_" lub "|"), wielkość znaków nie ma wpływu na wyrażenie (użyj "(?-i)" na początku, aby wielkość znaków miała znaczenie), przykłady: "flashcode|flashy", "(?-i)FlashCode|flashy"] ** typ: ciąg diff --git a/doc/pl/weechat_user.pl.adoc b/doc/pl/weechat_user.pl.adoc index 8d9e3b419..a7e97914f 100644 --- a/doc/pl/weechat_user.pl.adoc +++ b/doc/pl/weechat_user.pl.adoc @@ -2208,6 +2208,36 @@ Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalowa [[highlights]] === Podświetlenia +// TRANSLATION MISSING +[[highlights_disable]] +==== Disable highlights + +You can disable highlights with option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(regular expression). + +When a highlight is disabled with this option, the other highlight options are +ignored. + +For example to disable any highlight on messages with a word beginning +with "flash" between chevrons: + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +This can also be set with the buffer property "highlight_disable_regex". + +Same example, specific to the current buffer: + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +Właściwość bufora "highlight_disable_regex" nie jest zapisywana w konfiguracji. + +Można ją zapisać za pomocą skryptu _buffer_autoset.py_: można go zaintalować za pomocą +`+/script install buffer_autoset.py+`, informacje o używaniu `+/help buffer_autoset+`. + [[highlights_words]] ==== Dodawanie słów do podświetleń @@ -2219,7 +2249,7 @@ Możesz dodawać inne słowa do podświetlen używając opcji podświetlać Twój nick oraz słowa "słowo1", "słowo2" oraz wszystko co zaczyna się od "test": ---- -/set weechat.look.highlight słowo1,słowo2,test* +/set weechat.look.highlight "słowo1,słowo2,test*" ---- Jeżeli potrzebujesz bardziej przecyzyjnej reguły, możesz użyć wyrażenia reglarnego @@ -2227,7 +2257,7 @@ używając opcji <<option_weechat.look.highlight_regex,weechat.look.highlight_re na przydład do podświetlania słów "flashcode", "flashcöde" i "flashy": ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- Separatory do okoła podświetlanych słów można zmienić za pomocą opcji diff --git a/doc/sr/includes/autogen_api_hdata.sr.adoc b/doc/sr/includes/autogen_api_hdata.sr.adoc index 79a99e521..2a5e3d47f 100644 --- a/doc/sr/includes/autogen_api_hdata.sr.adoc +++ b/doc/sr/includes/autogen_api_hdata.sr.adoc @@ -631,6 +631,8 @@ _text_search_input_ (string) + _highlight_words_ (string) + _highlight_regex_ (string) + _highlight_regex_compiled_ (pointer) + +_highlight_disable_regex_ (string) + +_highlight_disable_regex_compiled_ (pointer) + _highlight_tags_restrict_ (string) + _highlight_tags_restrict_count_ (integer) + _highlight_tags_restrict_array_ (pointer, array_size: "highlight_tags_restrict_count") + diff --git a/doc/sr/includes/autogen_user_options.sr.adoc b/doc/sr/includes/autogen_user_options.sr.adoc index e8c4c23c8..78dca49ba 100644 --- a/doc/sr/includes/autogen_user_options.sr.adoc +++ b/doc/sr/includes/autogen_user_options.sr.adoc @@ -750,6 +750,12 @@ ** вредности: било који стринг ** подразумевана вредност: `+""+` +* [[option_weechat.look.highlight_disable_regex]] *weechat.look.highlight_disable_regex* +** опис: pass:none[POSIX extended regular expression used to prevent any highlight from a message: this option has higher priority over other highlight options (if the string is found in the message, the highlight is disabled and the other options are ignored), regular expression is case insensitive (use "(?-i)" at beginning to make it case sensitive), examples: "<flash.*>", "(?-i)<Flash.*>"] +** тип: стринг +** вредности: било који стринг +** подразумевана вредност: `+""+` + * [[option_weechat.look.highlight_regex]] *weechat.look.highlight_regex* ** опис: pass:none[POSIX проширени регуларни израз који се користи за проверу да ли порука садржи истицање или не, барем једно подударање мора бити окружено граничницима (карактери који се разликују од: алфанумерика, „-”, „_” и „|”), регуларни израз не прави разлику у величини слова (употребите „(?-i)” не почетку ако желите да се величина слова узима у обзир), примери: „flashcode|flashy”, „(?-i)FlashCode|flashy”] ** тип: стринг diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index 57881c885..903da2019 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -12736,6 +12736,8 @@ const char *weechat_buffer_get_string (struct t_gui_buffer *buffer, ** _input_: текст уноса ** _text_search_input_: сачувани унос пре претраге текста ** _highlight_words_: листа речи које се истичу +// TRANSLATION MISSING +** _highlight_disable_regex_: POSIX extended regular expression for disabling highlight ** _highlight_regex_: POSIX проширени регуларни израз за истицање ** _highlight_tags_restrict_: ограничава истицање само на поруке са наведеним ознакама ** _highlight_tags_: истицање се форсира за поруке са наведеним ознакама @@ -12785,6 +12787,7 @@ void *weechat_buffer_pointer (struct t_gui_buffer *buffer, * _buffer_: показивач на бафер * _property_: име особине: ** _plugin_: показивач на додатак који је креирао овај бафер (NULL за главни бафер програма WeeChat) +** _highlight_disable_regex_compiled_: компајлиран регуларни израз _highlight_disable_regex_ ** _highlight_regex_compiled_: компајлиран регуларни израз _highlight_regex_ Повратна вредност: @@ -12923,6 +12926,10 @@ void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, | highlight_words_del | | листа речи раздвојених запетама | Лист речи раздвојених запетама које треба да се уклоне из речи које се истичу у овом баферу. +// TRANSLATION MISSING +| highlight_disable_regex | | any string +| POSIX extended regular expression for disabling highlight. + | highlight_regex | | било који стринг | POSIX проширени регуларни израз за истицање. diff --git a/doc/sr/weechat_relay_protocol.sr.adoc b/doc/sr/weechat_relay_protocol.sr.adoc index 8fbeef200..ca9703a74 100644 --- a/doc/sr/weechat_relay_protocol.sr.adoc +++ b/doc/sr/weechat_relay_protocol.sr.adoc @@ -640,6 +640,8 @@ inl: text_search_found: 0 text_search_input: None highlight_words: None + highlight_disable_regex: None + highlight_disable_regex_compiled: '0x0' highlight_regex: None highlight_regex_compiled: '0x0' highlight_tags_restrict: None diff --git a/doc/sr/weechat_user.sr.adoc b/doc/sr/weechat_user.sr.adoc index 1986a050d..2c4716cb5 100644 --- a/doc/sr/weechat_user.sr.adoc +++ b/doc/sr/weechat_user.sr.adoc @@ -2061,6 +2061,35 @@ include::includes/autogen_user_options.sr.adoc[tag=charset_options] [[highlights]] === Истицања +// TRANSLATION MISSING +[[highlights_disable]] +==== Disable highlights + +You can disable highlights with option +<<option_weechat.look.highlight_disable_regex,weechat.look.highlight_disable_regex>> +(regular expression). + +When a highlight is disabled with this option, the other highlight options are +ignored. + +For example to disable any highlight on messages with a word beginning +with "flash" between chevrons: + +---- +/set weechat.look.highlight_regex "<flash.*>" +---- + +This can also be set with the buffer property "highlight_disable_regex". + +Same example, specific to the current buffer: + +---- +/buffer set highlight_disable_regex <flash.*> +---- + +[NOTE] +Особина бафера „highlight_disable_regex” се не чува у конфигурацији. + +Лако можете да је сачувате скриптом _buffer_autoset.py_: инсталирате је командом `+/script install buffer_autoset.py+`, а помоћ добијате са `+/help buffer_autoset+`. + [[highlights_words]] ==== Додавање речи које се истичу @@ -2069,13 +2098,13 @@ include::includes/autogen_user_options.sr.adoc[tag=charset_options] Остале речи моожете да додате опцијом <<option_weechat.look.highlight,weechat.look.highlight>>, на пример ако желите да се истиче ваш надимак и „реч1”, „реч2”, као и све речи које почињу са „test”: ---- -/set weechat.look.highlight реч1,реч2,test* +/set weechat.look.highlight "реч1,реч2,test*" ---- Ако вам је потребно одређеније правило за реч, можете да употребите регуларне изразе опцијом <<option_weechat.look.highlight_regex,weechat.look.highlight_regex>>, на пример да истакнете речи „flashcode”, „flashcöde” и „flashy”: ---- -/set weechat.look.highlight_regex flashc[oö]de|flashy +/set weechat.look.highlight_regex "flashc[oö]de|flashy" ---- Граничници око речи које се истичу могу да се прилагоде опцијом <<option_weechat.look.word_chars_highlight,weechat.look.word_chars_highlight>>. @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-06-18 16:11+0200\n" "Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3344,6 +3344,29 @@ msgstr "" "čárkou oddělený seznam slov pro zvýraznění (neporovnává se velikost písmen, " "slova mohou začínat nebo končit \"*\" pro částečnou schodu)" +#, fuzzy +#| msgid "" +#| "POSIX extended regular expression used to check if a message has " +#| "highlight or not, at least one match in string must be surrounded by " +#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), " +#| "regular expression is case insensitive (use \"(?-i)\" at beginning to " +#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|" +#| "flashy\"" +msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"POSIX rozšířené regulární výrazy používané k kontrole jestli má být zpráva " +"zvýrazněna nebo ne, alespoň jedno nalezení v řetězci musí být obklopeno " +"oddělovači (jiné znaky než: alfanumerické, \"-\", \"_\" a \"|\"), regulární " +"výraz není citlivý na velikost znaků (zkus \"(?-i)\" na začátku k přepnutí " +"na rozeznávání dle velikosti), například: \"flashcode|flashy\", \"(?-" +"i)FlashCode|flashy\"" + msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " @@ -25,7 +25,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-06-20 13:39+0200\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <kde-i18n-de@kde.org>\n" @@ -4245,6 +4245,30 @@ msgstr "" "werden). Schlagwörter können mit \"*\", als Joker, beginnen oder enden; " "Beispiel: \"test,(?-i)*toto*,flash*\"" +#, fuzzy +#| msgid "" +#| "POSIX extended regular expression used to check if a message has " +#| "highlight or not, at least one match in string must be surrounded by " +#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), " +#| "regular expression is case insensitive (use \"(?-i)\" at beginning to " +#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|" +#| "flashy\"" +msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"Suchmuster (erweiterter regulärer POSIX Ausdruck) welches genutzt werden " +"soll, um zu überprüfen ob eine Nachricht ein Highlight enthält oder nicht. " +"Mindestens eine Zeichenkette muss dabei auf das Suchmuster passen " +"(alphanumerisch, \"-\", \"_\" oder \"|\"). Das Suchmuster unterscheidet " +"dabei nicht zwischen Groß-und Kleinschreibung (um zwischen Groß-und " +"Kleinschreibung zu unterscheiden muss am Wortanfang \"(?-i)\" genutzt " +"werden). Beispiele: \"flashcode|flashy\", \"(?-i)FlashCode|flashy\"" + msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-06-18 16:11+0200\n" "Last-Translator: Santiago Forero <santiago@forero.xyz>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3848,6 +3848,21 @@ msgstr "" #, fuzzy msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"expresión regular usada para ver si un mensaje tiene un resalte o no, al " +"menos una coincidencia en el texto debe estar rodeado por letras " +"(alfanumérico, \"-\", \"_\" o \"|\"), la expresión regular es insensible a " +"las mayúsculas (usa \"(?-i)\" al principio para cambiarlo), ejemplos: " +"\"FlashCode|flashy\", \"(?-i)Flascode|flashy\"" + +#, fuzzy +msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " "different from: alphanumeric, \"-\", \"_\" and \"|\"), regular expression is " @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" -"PO-Revision-Date: 2022-07-10 12:32+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" +"PO-Revision-Date: 2022-07-24 22:19+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -4133,6 +4133,21 @@ msgstr "" "i)*toto*,flash*\"" msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"expression régulière POSIX étendue utilisée pour empêcher un highlight sur " +"un message : cette option a une priorité plus élevée sur les autres options " +"de highlight (si la chaîne est trouvée dans le message, le highlight est " +"désactivé et les autres options sont ignorées), l'expression régulière est " +"insensible à la casse (utilisez \"(?-i)\" au début pour la rendre sensible à " +"la casse), exemples : \"<flash.*>\", \"(?-i)<Flash.*>\"" + +msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " "different from: alphanumeric, \"-\", \"_\" and \"|\"), regular expression is " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-04-24 10:20+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2987,6 +2987,15 @@ msgstr "" "összehasonlítás, a szavak végére/elejére \"*\"-ot illesztve részleges keresés" msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" + +msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " "different from: alphanumeric, \"-\", \"_\" and \"|\"), regular expression is " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-04-24 10:20+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3541,6 +3541,22 @@ msgstr "" #, fuzzy msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"espressione regolare usata per verificare se un messaggio contiene una " +"notifica oppure no, almeno una corrispondenza nella stringa deve essere " +"racchiusa da caratteri :(alfanumerici, \"-\", \"_\" or \"|\"), l'espressione " +"regolare non è sensibile alle maiuscole (usare \"(?-i)\" all'inizio per " +"renderla sensibile alle maiuscole), ad esempio: \"flashcode|flashy\", \"(?-" +"i)Flashcode|flashy\"" + +#, fuzzy +msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " "different from: alphanumeric, \"-\", \"_\" and \"|\"), regular expression is " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-06-18 16:12+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/master/" @@ -3976,6 +3976,27 @@ msgstr "" "に \"(?-i)\" をつければ区別有り)、部分マッチさせるには単語の最初か最後に " "\"*\" をつける; 例: \"test,(?-i)*toto*,flash*\"" +#, fuzzy +#| msgid "" +#| "POSIX extended regular expression used to check if a message has " +#| "highlight or not, at least one match in string must be surrounded by " +#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), " +#| "regular expression is case insensitive (use \"(?-i)\" at beginning to " +#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|" +#| "flashy\"" +msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"メッセージ中のハイライトの有無を判断する POSIX 拡張正規表現、マッチ部分は必ず" +"区切り文字 (アルファベット、\"-\"、\"_\"、\"|\" 以外の文字) で囲まれていなけ" +"ればいけない、正規表現は大文字小文字を区別しない (最初に \"(?-i)\" がある場合" +"は区別する)、例: \"flashcode|flashy\"、\"(?-i)FlashCode|flashy\"" + msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-06-18 16:12+0200\n" "Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n" "Language-Team: Polish <kde-i18n-doc@kde.org>\n" @@ -4200,6 +4200,29 @@ msgstr "" "znaków miała znaczenie), słowa mogą zaczynać się od \"*\" dla częściowego " "dopasowania; przykład: \"test,(?-i)*toto*,flash*\"" +#, fuzzy +#| msgid "" +#| "POSIX extended regular expression used to check if a message has " +#| "highlight or not, at least one match in string must be surrounded by " +#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), " +#| "regular expression is case insensitive (use \"(?-i)\" at beginning to " +#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|" +#| "flashy\"" +msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"Rozszerzone wyrażenie regularne POSIX używane do sprawdzenia, czy wiadomość " +"posiada podświetlenie czy nie, przynajmniej jedno dopasowanie w ciąg musi " +"być otoczone separatorami (znaki inne niż: alfanumeryczne, \"-\", \"_\" lub " +"\"|\"), wielkość znaków nie ma wpływu na wyrażenie (użyj \"(?-i)\" na " +"początku, aby wielkość znaków miała znaczenie), przykłady: \"flashcode|" +"flashy\", \"(?-i)FlashCode|flashy\"" + msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-06-18 16:12+0200\n" "Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n" "Language-Team: Portuguese <>\n" @@ -3980,6 +3980,29 @@ msgstr "" "distinguir), as palavras podem começar ou terminar por \"*\" para " "corresponder parcialmente; exemplo: \"teste,(?-i)*toto*,flash*\"" +#, fuzzy +#| msgid "" +#| "POSIX extended regular expression used to check if a message has " +#| "highlight or not, at least one match in string must be surrounded by " +#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), " +#| "regular expression is case insensitive (use \"(?-i)\" at beginning to " +#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|" +#| "flashy\"" +msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"expressão regular POSIX estendida utilizada para verificar se a mensagem tem " +"um realce ou não, pelo menos uma correspondência deve estar entre " +"delimitadores (carateres diferentes de: alfanumérico, \"-\", \"_\" e \"|\"), " +"a expressão regular distingue maiúsculas e minúsculas (use \"(?-i)\" no " +"início para distinguir), exemplos: \"flashcode|flashy\", \"(?-i)FlashCode|" +"flash\"" + msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " diff --git a/po/pt_BR.po b/po/pt_BR.po index cb039a3bd..ee00e9702 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-04-24 10:20+0200\n" "Last-Translator: Érico Nogueira <ericonr@disroot.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3586,6 +3586,20 @@ msgstr "" #, fuzzy msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"expressão regular usada para verificar se a mensagem tem destaque ou não, " +"pelo menos uma correspondência na string precisa ser envolta por caracteres " +"de palavra (alfanumérico, \"-\", \"_\" ou \"|\"), expressões regulares levam " +"em conta maiúscula/minúscula, exemplo: \"FlashCode|flashy\"" + +#, fuzzy +msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " "different from: alphanumeric, \"-\", \"_\" and \"|\"), regular expression is " @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-04-24 10:20+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -3012,6 +3012,15 @@ msgstr "" "могут начинаться или кончаться \"*\" для неполного соответствия)" msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" + +msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " "different from: alphanumeric, \"-\", \"_\" and \"|\"), regular expression is " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-07-06 08:29+0400\n" "Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4051,6 +4051,29 @@ msgstr "" "слова узима у обзир), речи могу да почну или да се заврше са „*” чиме се " "добија делимично подударање; пример: „test,(?-i)*toto*,flash*”" +#, fuzzy +#| msgid "" +#| "POSIX extended regular expression used to check if a message has " +#| "highlight or not, at least one match in string must be surrounded by " +#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), " +#| "regular expression is case insensitive (use \"(?-i)\" at beginning to " +#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|" +#| "flashy\"" +msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"POSIX проширени регуларни израз који се користи за проверу да ли порука " +"садржи истицање или не, барем једно подударање мора бити окружено " +"граничницима (карактери који се разликују од: алфанумерика, „-”, „_” и „|”), " +"регуларни израз не прави разлику у величини слова (употребите „(?-i)” не " +"почетку ако желите да се величина слова узима у обзир), примери: „flashcode|" +"flashy”, „(?-i)FlashCode|flashy”" + msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2022-06-18 16:13+0200\n" "Last-Translator: Emir SARI <emir_sari@icloud.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4126,6 +4126,29 @@ msgstr "" "kullanın), kısmi eşleşme için sözcükler \"*\" ile başlayabilir; örnek: " "\"test,(?-i)*toto*,flash*\"" +#, fuzzy +#| msgid "" +#| "POSIX extended regular expression used to check if a message has " +#| "highlight or not, at least one match in string must be surrounded by " +#| "delimiters (chars different from: alphanumeric, \"-\", \"_\" and \"|\"), " +#| "regular expression is case insensitive (use \"(?-i)\" at beginning to " +#| "make it case sensitive), examples: \"flashcode|flashy\", \"(?-i)FlashCode|" +#| "flashy\"" +msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" +"bir iletinin vurgulaması olup olmadığını denetlemek için POSIX genişletilmiş " +"düzenli ifadeleri kullanılır, en azından dizideki bir eşleşme " +"sınırlandırıcılarla çevrilmiş olmalıdır (şunlardan farklı karakterler: abece " +"ve sayılar, \"-\", \"_\" ve \"|\"), düzenli ifadeler BÜYÜK/küçük harf " +"duyarsızdır (duyarlı yapmak için sözcüklerin başında \"(?-i)\" kullanın), " +"örnekler: \"flaşkodu|flaşlı\", \"(?-i)FlaşKodu|Flaşlı\"" + msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " diff --git a/po/weechat.pot b/po/weechat.pot index 8376820f3..457b32bd3 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-07-10 12:31+0200\n" +"POT-Creation-Date: 2022-07-24 22:18+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -2736,6 +2736,15 @@ msgid "" msgstr "" msgid "" +"POSIX extended regular expression used to prevent any highlight from a " +"message: this option has higher priority over other highlight options (if " +"the string is found in the message, the highlight is disabled and the other " +"options are ignored), regular expression is case insensitive (use \"(?-i)\" " +"at beginning to make it case sensitive), examples: \"<flash.*>\", \"(?-" +"i)<Flash.*>\"" +msgstr "" + +msgid "" "POSIX extended regular expression used to check if a message has highlight " "or not, at least one match in string must be surrounded by delimiters (chars " "different from: alphanumeric, \"-\", \"_\" and \"|\"), regular expression is " diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 071cbfe91..8b1cdb556 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -121,6 +121,7 @@ struct t_config_option *config_look_day_change_message_2dates; struct t_config_option *config_look_eat_newline_glitch; struct t_config_option *config_look_emphasized_attributes; struct t_config_option *config_look_highlight; +struct t_config_option *config_look_highlight_disable_regex; struct t_config_option *config_look_highlight_regex; struct t_config_option *config_look_highlight_tags; struct t_config_option *config_look_hotlist_add_conditions; @@ -321,6 +322,7 @@ int config_length_prefix_same_nick_middle = 0; struct t_hook *config_day_change_timer = NULL; int config_day_change_old_day = -1; int config_emphasized_attributes = 0; +regex_t *config_highlight_disable_regex = NULL; regex_t *config_highlight_regex = NULL; char ***config_highlight_tags = NULL; int config_num_highlight_tags = 0; @@ -913,6 +915,43 @@ config_change_emphasized_attributes (const void *pointer, void *data, } /* + * Callback for changes on option "weechat.look.highlight_disable_regex". + */ + +void +config_change_highlight_disable_regex (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + if (config_highlight_disable_regex) + { + regfree (config_highlight_disable_regex); + free (config_highlight_disable_regex); + config_highlight_disable_regex = NULL; + } + + if (CONFIG_STRING(config_look_highlight_disable_regex) + && CONFIG_STRING(config_look_highlight_disable_regex)[0]) + { + config_highlight_disable_regex = malloc (sizeof (*config_highlight_disable_regex)); + if (config_highlight_disable_regex) + { + if (string_regcomp (config_highlight_disable_regex, + CONFIG_STRING(config_look_highlight_disable_regex), + REG_EXTENDED | REG_ICASE) != 0) + { + free (config_highlight_disable_regex); + config_highlight_disable_regex = NULL; + } + } + } +} + +/* * Callback for changes on option "weechat.look.highlight_regex". */ @@ -3035,6 +3074,20 @@ config_weechat_init_options () "example: \"test,(?-i)*toto*,flash*\""), NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_highlight_disable_regex = config_file_new_option ( + weechat_config_file, ptr_section, + "highlight_disable_regex", "string", + N_("POSIX extended regular expression used to prevent any highlight " + "from a message: this option has higher priority over other " + "highlight options (if the string is found in the message, the " + "highlight is disabled and the other options are ignored), " + "regular expression is case insensitive (use \"(?-i)\" at beginning " + "to make it case sensitive), examples: " + "\"<flash.*>\", \"(?-i)<Flash.*>\""), + NULL, 0, 0, "", NULL, 0, + NULL, NULL, NULL, + &config_change_highlight_disable_regex, NULL, NULL, + NULL, NULL, NULL); config_look_highlight_regex = config_file_new_option ( weechat_config_file, ptr_section, "highlight_regex", "string", @@ -4876,6 +4929,8 @@ config_weechat_init () &config_day_change_timer_cb, NULL, NULL); } + if (!config_highlight_disable_regex) + config_change_highlight_disable_regex (NULL, NULL, NULL); if (!config_highlight_regex) config_change_highlight_regex (NULL, NULL, NULL); if (!config_highlight_tags) @@ -4937,6 +4992,13 @@ config_weechat_free () { config_file_free (weechat_config_file); + if (config_highlight_disable_regex) + { + regfree (config_highlight_disable_regex); + free (config_highlight_disable_regex); + config_highlight_disable_regex = NULL; + } + if (config_highlight_regex) { regfree (config_highlight_regex); diff --git a/src/core/wee-config.h b/src/core/wee-config.h index 0feec6c42..38017e294 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -173,6 +173,7 @@ extern struct t_config_option *config_look_day_change_message_2dates; extern struct t_config_option *config_look_eat_newline_glitch; extern struct t_config_option *config_look_emphasized_attributes; extern struct t_config_option *config_look_highlight; +extern struct t_config_option *config_look_highlight_disable_regex; extern struct t_config_option *config_look_highlight_regex; extern struct t_config_option *config_look_highlight_tags; extern struct t_config_option *config_look_hotlist_add_conditions; @@ -357,6 +358,7 @@ extern int config_length_nick_prefix_suffix; extern int config_length_prefix_same_nick; extern int config_length_prefix_same_nick_middle; extern int config_emphasized_attributes; +extern regex_t *config_highlight_disable_regex; extern regex_t *config_highlight_regex; extern char ***config_highlight_tags; extern int config_num_highlight_tags; diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index 48c859416..404c98797 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -557,6 +557,8 @@ upgrade_weechat_read_buffer (struct t_infolist *infolist) /* highlight options */ gui_buffer_set_highlight_words ( ptr_buffer, infolist_string (infolist, "highlight_words")); + gui_buffer_set_highlight_disable_regex ( + ptr_buffer, infolist_string (infolist, "highlight_disable_regex")); gui_buffer_set_highlight_regex ( ptr_buffer, infolist_string (infolist, "highlight_regex")); if (infolist_search_var (infolist, diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c index 889b86a6b..4fbe8ee0e 100644 --- a/src/gui/gui-buffer.c +++ b/src/gui/gui-buffer.c @@ -106,12 +106,14 @@ char *gui_buffer_properties_get_integer[] = }; char *gui_buffer_properties_get_string[] = { "plugin", "name", "full_name", "old_full_name", "short_name", "title", - "input", "text_search_input", "highlight_words", "highlight_regex", - "highlight_tags_restrict", "highlight_tags", "hotlist_max_level_nicks", + "input", "text_search_input", "highlight_words", "highlight_disable_regex", + "highlight_regex", "highlight_tags_restrict", "highlight_tags", + "hotlist_max_level_nicks", NULL }; char *gui_buffer_properties_get_pointer[] = -{ "plugin", "text_search_regex_compiled", "highlight_regex_compiled", +{ "plugin", "text_search_regex_compiled", "highlight_disable_regex_compiled", + "highlight_regex_compiled", NULL }; char *gui_buffer_properties_set[] = @@ -119,10 +121,11 @@ char *gui_buffer_properties_set[] = "clear", "filter", "number", "name", "short_name", "type", "notify", "title", "time_for_each_line", "nicklist", "nicklist_case_sensitive", "nicklist_display_groups", "highlight_words", "highlight_words_add", - "highlight_words_del", "highlight_regex", "highlight_tags_restrict", - "highlight_tags", "hotlist_max_level_nicks", "hotlist_max_level_nicks_add", - "hotlist_max_level_nicks_del", "input", "input_pos", - "input_get_unknown_commands", "input_get_empty", "input_multiline", + "highlight_words_del", "highlight_disable_regex", "highlight_regex", + "highlight_tags_restrict", "highlight_tags", "hotlist_max_level_nicks", + "hotlist_max_level_nicks_add", "hotlist_max_level_nicks_del", + "input", "input_pos", "input_get_unknown_commands", "input_get_empty", + "input_multiline", NULL }; @@ -800,6 +803,8 @@ gui_buffer_new_props (struct t_weechat_plugin *plugin, /* highlight */ new_buffer->highlight_words = NULL; + new_buffer->highlight_disable_regex = NULL; + new_buffer->highlight_disable_regex_compiled = NULL; new_buffer->highlight_regex = NULL; new_buffer->highlight_regex_compiled = NULL; new_buffer->highlight_tags_restrict = NULL; @@ -1310,6 +1315,8 @@ gui_buffer_get_string (struct t_gui_buffer *buffer, const char *property) return buffer->text_search_input; else if (string_strcasecmp (property, "highlight_words") == 0) return buffer->highlight_words; + else if (string_strcasecmp (property, "highlight_disable_regex") == 0) + return buffer->highlight_disable_regex; else if (string_strcasecmp (property, "highlight_regex") == 0) return buffer->highlight_regex; else if (string_strcasecmp (property, "highlight_tags_restrict") == 0) @@ -1343,6 +1350,8 @@ gui_buffer_get_pointer (struct t_gui_buffer *buffer, const char *property) return buffer->plugin; else if (string_strcasecmp (property, "text_search_regex_compiled") == 0) return buffer->text_search_regex_compiled; + else if (string_strcasecmp (property, "highlight_disable_regex_compiled") == 0) + return buffer->highlight_disable_regex_compiled; else if (string_strcasecmp (property, "highlight_regex_compiled") == 0) return buffer->highlight_regex_compiled; @@ -1738,12 +1747,56 @@ gui_buffer_remove_highlight_words (struct t_gui_buffer *buffer, } /* + * Sets highlight disable regex for a buffer. + */ + +void +gui_buffer_set_highlight_disable_regex (struct t_gui_buffer *buffer, + const char *new_regex) +{ + if (!buffer) + return; + + if (buffer->highlight_disable_regex) + { + free (buffer->highlight_disable_regex); + buffer->highlight_disable_regex = NULL; + } + if (buffer->highlight_disable_regex_compiled) + { + regfree (buffer->highlight_disable_regex_compiled); + free (buffer->highlight_disable_regex_compiled); + buffer->highlight_disable_regex_compiled = NULL; + } + + if (new_regex && new_regex[0]) + { + buffer->highlight_disable_regex = strdup (new_regex); + if (buffer->highlight_disable_regex) + { + buffer->highlight_disable_regex_compiled = + malloc (sizeof (*buffer->highlight_disable_regex_compiled)); + if (buffer->highlight_disable_regex_compiled) + { + if (string_regcomp (buffer->highlight_disable_regex_compiled, + buffer->highlight_disable_regex, + REG_EXTENDED | REG_ICASE) != 0) + { + free (buffer->highlight_disable_regex_compiled); + buffer->highlight_disable_regex_compiled = NULL; + } + } + } + } +} + +/* * Sets highlight regex for a buffer. */ void gui_buffer_set_highlight_regex (struct t_gui_buffer *buffer, - const char *new_highlight_regex) + const char *new_regex) { if (!buffer) return; @@ -1760,9 +1813,9 @@ gui_buffer_set_highlight_regex (struct t_gui_buffer *buffer, buffer->highlight_regex_compiled = NULL; } - if (new_highlight_regex && new_highlight_regex[0]) + if (new_regex && new_regex[0]) { - buffer->highlight_regex = strdup (new_highlight_regex); + buffer->highlight_regex = strdup (new_regex); if (buffer->highlight_regex) { buffer->highlight_regex_compiled = @@ -2234,6 +2287,10 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property, { gui_buffer_remove_highlight_words (buffer, value); } + else if (string_strcasecmp (property, "highlight_disable_regex") == 0) + { + gui_buffer_set_highlight_disable_regex (buffer, value); + } else if (string_strcasecmp (property, "highlight_regex") == 0) { gui_buffer_set_highlight_regex (buffer, value); @@ -3034,6 +3091,13 @@ gui_buffer_close (struct t_gui_buffer *buffer) } if (buffer->highlight_words) free (buffer->highlight_words); + if (buffer->highlight_disable_regex) + free (buffer->highlight_disable_regex); + if (buffer->highlight_disable_regex_compiled) + { + regfree (buffer->highlight_disable_regex_compiled); + free (buffer->highlight_disable_regex_compiled); + } if (buffer->highlight_regex) free (buffer->highlight_regex); if (buffer->highlight_regex_compiled) @@ -4430,6 +4494,8 @@ gui_buffer_hdata_buffer_cb (const void *pointer, void *data, HDATA_VAR(struct t_gui_buffer, text_search_found, INTEGER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, text_search_input, STRING, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, highlight_words, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_gui_buffer, highlight_disable_regex, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_gui_buffer, highlight_disable_regex_compiled, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, highlight_regex, STRING, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, highlight_regex_compiled, POINTER, 0, NULL, NULL); HDATA_VAR(struct t_gui_buffer, highlight_tags_restrict, STRING, 0, NULL, NULL); @@ -4642,6 +4708,10 @@ gui_buffer_add_to_infolist (struct t_infolist *infolist, return 0; if (!infolist_new_var_string (ptr_item, "highlight_words", buffer->highlight_words)) return 0; + if (!infolist_new_var_string (ptr_item, "highlight_disable_regex", buffer->highlight_disable_regex)) + return 0; + if (!infolist_new_var_pointer (ptr_item, "highlight_disable_regex_compiled", buffer->highlight_disable_regex_compiled)) + return 0; if (!infolist_new_var_string (ptr_item, "highlight_regex", buffer->highlight_regex)) return 0; if (!infolist_new_var_pointer (ptr_item, "highlight_regex_compiled", buffer->highlight_regex_compiled)) @@ -4851,27 +4921,29 @@ gui_buffer_print_log () num, ptr_undo, ptr_undo->data, ptr_undo->pos); num++; } - log_printf (" completion. . . . . . . : 0x%lx", ptr_buffer->completion); + log_printf (" completion. . . . . . . . . . . : 0x%lx", ptr_buffer->completion); log_printf (" history . . . . . . . . : 0x%lx", ptr_buffer->history); log_printf (" last_history. . . . . . : 0x%lx", ptr_buffer->last_history); log_printf (" ptr_history . . . . . . : 0x%lx", ptr_buffer->ptr_history); log_printf (" num_history . . . . . . : %d", ptr_buffer->num_history); - log_printf (" text_search . . . . . . : %d", ptr_buffer->text_search); - log_printf (" text_search_exact . . . : %d", ptr_buffer->text_search_exact); - log_printf (" text_search_regex . . . : %d", ptr_buffer->text_search_regex); - log_printf (" text_search_regex_compiled: 0x%lx", ptr_buffer->text_search_regex_compiled); - log_printf (" text_search_where . . . : %d", ptr_buffer->text_search_where); - log_printf (" text_search_found . . . : %d", ptr_buffer->text_search_found); - log_printf (" text_search_input . . . : '%s'", ptr_buffer->text_search_input); - log_printf (" highlight_words . . . . : '%s'", ptr_buffer->highlight_words); - log_printf (" highlight_regex . . . . : '%s'", ptr_buffer->highlight_regex); - log_printf (" highlight_regex_compiled: 0x%lx", ptr_buffer->highlight_regex_compiled); - log_printf (" highlight_tags_restrict. . . : '%s'", ptr_buffer->highlight_tags_restrict); - log_printf (" highlight_tags_restrict_count: %d", ptr_buffer->highlight_tags_restrict_count); - log_printf (" highlight_tags_restrict_array: 0x%lx", ptr_buffer->highlight_tags_restrict_array); - log_printf (" highlight_tags. . . . . : '%s'", ptr_buffer->highlight_tags); - log_printf (" highlight_tags_count. . : %d", ptr_buffer->highlight_tags_count); - log_printf (" highlight_tags_array. . : 0x%lx", ptr_buffer->highlight_tags_array); + log_printf (" text_search . . . . . . . . . . : %d", ptr_buffer->text_search); + log_printf (" text_search_exact . . . . . . . : %d", ptr_buffer->text_search_exact); + log_printf (" text_search_regex . . . . . . . : %d", ptr_buffer->text_search_regex); + log_printf (" text_search_regex_compiled. . . : 0x%lx", ptr_buffer->text_search_regex_compiled); + log_printf (" text_search_where . . . . . . . : %d", ptr_buffer->text_search_where); + log_printf (" text_search_found . . . . . . . : %d", ptr_buffer->text_search_found); + log_printf (" text_search_input . . . . . . . : '%s'", ptr_buffer->text_search_input); + log_printf (" highlight_words . . . . . . . . : '%s'", ptr_buffer->highlight_words); + log_printf (" highlight_disable_regex . . . . : '%s'", ptr_buffer->highlight_disable_regex); + log_printf (" highlight_disable_regex_compiled: 0x%lx", ptr_buffer->highlight_disable_regex_compiled); + log_printf (" highlight_regex . . . . . . . . : '%s'", ptr_buffer->highlight_regex); + log_printf (" highlight_regex_compiled. . . . : 0x%lx", ptr_buffer->highlight_regex_compiled); + log_printf (" highlight_tags_restrict . . . . : '%s'", ptr_buffer->highlight_tags_restrict); + log_printf (" highlight_tags_restrict_count . : %d", ptr_buffer->highlight_tags_restrict_count); + log_printf (" highlight_tags_restrict_array . : 0x%lx", ptr_buffer->highlight_tags_restrict_array); + log_printf (" highlight_tags. . . . . . . . . : '%s'", ptr_buffer->highlight_tags); + log_printf (" highlight_tags_count. . . . . . : %d", ptr_buffer->highlight_tags_count); + log_printf (" highlight_tags_array. . . . . . : 0x%lx", ptr_buffer->highlight_tags_array); log_printf (" hotlist . . . . . . . . : 0x%lx", ptr_buffer->hotlist); log_printf (" hotlist_removed . . . . : 0x%lx", ptr_buffer->hotlist_removed); log_printf (" keys. . . . . . . . . . : 0x%lx", ptr_buffer->keys); diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h index c9f4ccbb6..336e6a316 100644 --- a/src/gui/gui-buffer.h +++ b/src/gui/gui-buffer.h @@ -199,6 +199,8 @@ struct t_gui_buffer char *highlight_words; /* list of words to highlight */ char *highlight_regex; /* regex for highlight */ regex_t *highlight_regex_compiled; /* compiled regex */ + char *highlight_disable_regex; /* regex for disabling highlight */ + regex_t *highlight_disable_regex_compiled; /* compiled regex */ char *highlight_tags_restrict; /* restrict highlight to these tags */ int highlight_tags_restrict_count; /* number of restricted tags */ char ***highlight_tags_restrict_array; /* array with restricted tags */ @@ -316,8 +318,10 @@ extern void gui_buffer_set_title (struct t_gui_buffer *buffer, const char *new_title); extern void gui_buffer_set_highlight_words (struct t_gui_buffer *buffer, const char *new_highlight_words); +extern void gui_buffer_set_highlight_disable_regex (struct t_gui_buffer *buffer, + const char *new_regex); extern void gui_buffer_set_highlight_regex (struct t_gui_buffer *buffer, - const char *new_highlight_regex); + const char *new_regex); extern void gui_buffer_set_highlight_tags_restrict (struct t_gui_buffer *buffer, const char *new_tags); extern void gui_buffer_set_highlight_tags (struct t_gui_buffer *buffer, diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index cc91bed06..7a0e6fe47 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -27,6 +27,7 @@ #include <stddef.h> #include <string.h> #include <time.h> +#include <regex.h> #include "../core/weechat.h" #include "../core/wee-config.h" @@ -861,9 +862,18 @@ gui_line_get_nick_tag (struct t_gui_line *line) int gui_line_has_highlight (struct t_gui_line *line) { - int rc, i, no_highlight, action, length; + int rc, rc_regex, i, no_highlight, action, length; char *msg_no_color, *ptr_msg_no_color, *highlight_words; const char *ptr_nick; + regmatch_t regex_match; + + rc = 0; + + /* remove color codes from line message */ + msg_no_color = gui_color_decode (line->data->message, NULL); + if (!msg_no_color) + return 0; + ptr_msg_no_color = msg_no_color; /* * highlights are disabled on this buffer? (special value "-" means that @@ -871,7 +881,10 @@ gui_line_has_highlight (struct t_gui_line *line) */ if (line->data->buffer->highlight_words && (strcmp (line->data->buffer->highlight_words, "-") == 0)) - return 0; + { + rc = 0; + goto end; + } /* * check if highlight is disabled for line; also check if the line is an @@ -898,7 +911,61 @@ gui_line_has_highlight (struct t_gui_line *line) } } if (no_highlight) - return 0; + { + rc = 0; + goto end; + } + + /* + * if the line is an action message and that we know the nick, we skip + * the nick if it is at beginning of message (to not highlight an action + * from another user if his nick is in our highlight settings) + */ + if (action && ptr_nick) + { + length = strlen (ptr_nick); + if (strncmp (ptr_msg_no_color, ptr_nick, length) == 0) + { + /* skip nick at beginning (for example: "FlashCode") */ + ptr_msg_no_color += length; + } + else if (ptr_msg_no_color[0] + && (strncmp (ptr_msg_no_color + 1, ptr_nick, length) == 0)) + { + /* skip prefix and nick at beginning (for example: "@FlashCode") */ + ptr_msg_no_color += length + 1; + } + } + + /* + * check if highlight is disabled by a regex + * (with global option "weechat.look.highlight_disable_regex") + */ + if (config_highlight_disable_regex) + { + rc_regex = regexec (config_highlight_disable_regex, + ptr_msg_no_color, 1, ®ex_match, 0); + if ((rc_regex == 0) && (regex_match.rm_so >= 0) && (regex_match.rm_eo > 0)) + { + rc = 0; + goto end; + } + } + + /* + * check if highlight is disabled by a regex + * (with buffer property "highlight_disable_regex") + */ + if (line->data->buffer->highlight_disable_regex_compiled) + { + rc_regex = regexec (line->data->buffer->highlight_disable_regex_compiled, + ptr_msg_no_color, 1, ®ex_match, 0); + if ((rc_regex == 0) && (regex_match.rm_so >= 0) && (regex_match.rm_eo > 0)) + { + rc = 0; + goto end; + } + } /* * check if highlight is forced by a tag @@ -909,7 +976,8 @@ gui_line_has_highlight (struct t_gui_line *line) config_num_highlight_tags, config_highlight_tags)) { - return 1; + rc = 1; + goto end; } /* @@ -921,7 +989,8 @@ gui_line_has_highlight (struct t_gui_line *line) line->data->buffer->highlight_tags_count, line->data->buffer->highlight_tags_array)) { - return 1; + rc = 1; + goto end; } /* @@ -933,33 +1002,9 @@ gui_line_has_highlight (struct t_gui_line *line) if (!gui_line_match_tags (line->data, line->data->buffer->highlight_tags_restrict_count, line->data->buffer->highlight_tags_restrict_array)) - return 0; - } - - /* remove color codes from line message */ - msg_no_color = gui_color_decode (line->data->message, NULL); - if (!msg_no_color) - return 0; - ptr_msg_no_color = msg_no_color; - - /* - * if the line is an action message and that we know the nick, we skip - * the nick if it is at beginning of message (to not highlight an action - * from another user if his nick is in our highlight settings) - */ - if (action && ptr_nick) - { - length = strlen (ptr_nick); - if (strncmp (ptr_msg_no_color, ptr_nick, length) == 0) - { - /* skip nick at beginning (for example: "FlashCode") */ - ptr_msg_no_color += length; - } - else if (ptr_msg_no_color[0] - && (strncmp (ptr_msg_no_color + 1, ptr_nick, length) == 0)) { - /* skip prefix and nick at beginning (for example: "@FlashCode") */ - ptr_msg_no_color += length + 1; + rc = 0; + goto end; } } @@ -974,30 +1019,34 @@ gui_line_has_highlight (struct t_gui_line *line) highlight_words : line->data->buffer->highlight_words); if (highlight_words) free (highlight_words); + if (rc) + goto end; - if (!rc) - { - highlight_words = gui_buffer_string_replace_local_var (line->data->buffer, - CONFIG_STRING(config_look_highlight)); - rc = string_has_highlight (ptr_msg_no_color, - (highlight_words) ? - highlight_words : CONFIG_STRING(config_look_highlight)); - if (highlight_words) - free (highlight_words); - } + highlight_words = gui_buffer_string_replace_local_var (line->data->buffer, + CONFIG_STRING(config_look_highlight)); + rc = string_has_highlight (ptr_msg_no_color, + (highlight_words) ? + highlight_words : CONFIG_STRING(config_look_highlight)); + if (highlight_words) + free (highlight_words); + if (rc) + goto end; - if (!rc && config_highlight_regex) + if (config_highlight_regex) { rc = string_has_highlight_regex_compiled (ptr_msg_no_color, config_highlight_regex); } + if (rc) + goto end; - if (!rc && line->data->buffer->highlight_regex_compiled) + if (line->data->buffer->highlight_regex_compiled) { rc = string_has_highlight_regex_compiled (ptr_msg_no_color, line->data->buffer->highlight_regex_compiled); } +end: free (msg_no_color); return rc; |