summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--doc/de/autogen/user/weechat_options.txt15
-rw-r--r--doc/en/autogen/user/weechat_options.txt15
-rw-r--r--doc/en/weechat_dev.en.txt4
-rw-r--r--doc/en/weechat_plugin_api.en.txt3
-rw-r--r--doc/fr/autogen/user/weechat_options.txt15
-rw-r--r--doc/fr/weechat_plugin_api.fr.txt4
-rw-r--r--doc/it/autogen/user/weechat_options.txt15
-rw-r--r--doc/it/weechat_plugin_api.it.txt4
-rw-r--r--doc/ja/autogen/user/weechat_options.txt15
-rw-r--r--po/cs.po20
-rw-r--r--po/de.po20
-rw-r--r--po/es.po20
-rw-r--r--po/fr.po43
-rw-r--r--po/hu.po20
-rw-r--r--po/it.po20
-rw-r--r--po/ja.po20
-rw-r--r--po/pl.po20
-rw-r--r--po/pt_BR.po20
-rw-r--r--po/ru.po20
-rw-r--r--po/tr.po20
-rw-r--r--po/weechat.pot20
-rw-r--r--src/core/wee-config.c56
-rw-r--r--src/core/wee-config.h4
-rw-r--r--src/gui/curses/gui-curses-bar-window.c12
-rw-r--r--src/gui/curses/gui-curses-chat.c51
-rw-r--r--src/gui/curses/gui-curses-color.c1
-rw-r--r--src/gui/curses/gui-curses-window.c118
-rw-r--r--src/gui/curses/gui-curses.h17
-rw-r--r--src/gui/gui-chat.c32
-rw-r--r--src/gui/gui-chat.h1
-rw-r--r--src/gui/gui-color.c160
-rw-r--r--src/gui/gui-color.h6
-rw-r--r--src/gui/gui-window.h2
34 files changed, 762 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index 5175d6e71..eb39c6485 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.4.2-dev, 2013-08-10
+v0.4.2-dev, 2013-08-16
This document lists all changes for each version.
@@ -14,6 +14,9 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
Version 0.4.2 (under dev!)
--------------------------
+* core: add text emphasis in messages when searching text in buffer, new
+ options: weechat.look.emphasized_attributes, weechat.color.emphasized,
+ weechat.color.emphasized_bg
* core: fix random crash on "/buffer close" with a buffer number (or a range of
buffers)
* core: optimize the removal of lines in buffers (a lot faster to clear/close
diff --git a/doc/de/autogen/user/weechat_options.txt b/doc/de/autogen/user/weechat_options.txt
index 32a43a00f..aa3e0ed0a 100644
--- a/doc/de/autogen/user/weechat_options.txt
+++ b/doc/de/autogen/user/weechat_options.txt
@@ -188,6 +188,16 @@
** Typ: Farbe
** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `cyan`)
+* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
+** Beschreibung: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** Typ: Farbe
+** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `yellow`)
+
+* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
+** Beschreibung: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** Typ: Farbe
+** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "_" für unterstrichen (Standardwert: `magenta`)
+
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** Beschreibung: `Textfarbe in der Eingabezeile bei Aktivität (z.B. beim Einfügen von Zeilen)`
** Typ: Farbe
@@ -478,6 +488,11 @@
** Typ: boolesch
** Werte: on, off (Standardwert: `off`)
+* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
+** Beschreibung: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
+** Typ: Zeichenkette
+** Werte: beliebige Zeichenkette (Standardwert: `""`)
+
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** Beschreibung: `eine durch Kommata getrennte Liste der hervorzuhebenden Wörter. Groß- und Kleinschreibung wird dabei standardmäßig nicht beachtet (um zwischen Groß-und Kleinschreibung zu unterscheiden muss am Wortanfang "(?-i)" genutzt werden). Schlagwörter können mit "*", als Joker, beginnen oder enden; Beipiel: "test,(?-i)*toto*,flash*"`
** Typ: Zeichenkette
diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt
index 699c4cdfb..0beba09d7 100644
--- a/doc/en/autogen/user/weechat_options.txt
+++ b/doc/en/autogen/user/weechat_options.txt
@@ -188,6 +188,16 @@
** type: color
** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `cyan`)
+* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
+** description: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** type: color
+** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `yellow`)
+
+* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
+** description: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** type: color
+** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "_" for underline (default value: `magenta`)
+
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** description: `text color for actions in input line`
** type: color
@@ -478,6 +488,11 @@
** type: boolean
** values: on, off (default value: `off`)
+* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
+** description: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
+** type: string
+** values: any string (default value: `""`)
+
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** description: `comma separated list of words to highlight; case insensitive comparison (use "(?-i)" at beginning of words to make them case sensitive), words may begin or end with "*" for partial match; example: "test,(?-i)*toto*,flash*"`
** type: string
diff --git a/doc/en/weechat_dev.en.txt b/doc/en/weechat_dev.en.txt
index 01f1be9e8..5f6eb0c40 100644
--- a/doc/en/weechat_dev.en.txt
+++ b/doc/en/weechat_dev.en.txt
@@ -772,6 +772,7 @@ All combinations are summarized in this table:
| @h(19) + "b" + "#" | @h(19)`b#` | input bar | Move cursor char char (used only in item "input_text")
| @h(19) + "b" + "i" | @h(19)`bi` | bars | Start item
| @h(19) + "b" + "l" (lower L) | @h(19)`bl` | bars | Start line item
+| @h(19) + "E" | @h(19)`E` | chat + bars | Emphasize text _(new in version 0.4.2)_
| @h(19) + @h(1C) | @h(19)@h(1C) | chat + bars | Reset color (keep attributes)
| @h(1A) + ATTR | @h(1A)`*` | chat + bars | Set attribute
| @h(1B) + ATTR | @h(1B)`*` | chat + bars | Remove attribute
@@ -823,6 +824,9 @@ Color codes using options (see 't_gui_color_enum', in file 'src/gui/gui-color.h'
| 37 | weechat.color.chat_prefix_buffer_inactive_buffer _(new in version 0.3.6)_
| 38 | weechat.color.chat_nick_offline _(new in version 0.3.9)_
| 39 | weechat.color.chat_nick_offline_highlight _(new in version 0.3.9)_
+| 40 | weechat.color.chat_nick_prefix _(new in version 0.4.1)_
+| 41 | weechat.color.chat_nick_suffix _(new in version 0.4.1)_
+| 42 | weechat.color.emphasis _(new in version 0.4.2)_
|========================================
WeeChat colors are:
diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt
index ed16266eb..2b88c6e14 100644
--- a/doc/en/weechat_plugin_api.en.txt
+++ b/doc/en/weechat_plugin_api.en.txt
@@ -6294,6 +6294,9 @@ Arguments:
*** '-italic': remove italic
*** 'underline': set underline
*** '-underline': remove underline
+*** 'emphasis': toggle the emphasis for text (note: this should be used only in
+ bars, because WeeChat uses text emphasis when searching text in buffer)
+ _(new in version 0.4.2)_
** bar color name:
*** 'bar_fg': foreground color for bar
*** 'bar_delim': delimiters color for bar
diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt
index a7ad448df..b5ac705e3 100644
--- a/doc/fr/autogen/user/weechat_options.txt
+++ b/doc/fr/autogen/user/weechat_options.txt
@@ -188,6 +188,16 @@
** type: couleur
** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `cyan`)
+* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
+** description: `couleur du texte pour le texte mis en valeur (par exemple lors de la recherche de texte); cette option est utilisée seulement si l'option weechat.look.emphasized_attributes est une chaîne vide (valeur par défaut)`
+** type: couleur
+** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `yellow`)
+
+* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
+** description: `couleur du fond pour le texte mis en valeur (par exemple lors de la recherche de texte); cette option est utilisée seulement si l'option weechat.look.emphasized_attributes est une chaîne vide (valeur par défaut)`
+** type: couleur
+** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné (valeur par défaut: `magenta`)
+
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** description: `couleur du texte pour les actions dans la ligne de saisie`
** type: couleur
@@ -478,6 +488,11 @@
** type: booléen
** valeurs: on, off (valeur par défaut: `off`)
+* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
+** description: `attributs pour le texte mis en valeur: un ou plusieurs caractères d'attributs ("*" pour du gras, "!" pour la vidéo inverse, "_" pour du souligné); si la chaîne est vide, les couleurs weechat.color.emphasized* sont utilisées`
+** type: chaîne
+** valeurs: toute chaîne (valeur par défaut: `""`)
+
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** description: `liste des mots pour la notification séparés par des virgules; la comparaison est insensible à la casse (utilisez "(?-i)" au début des mots pour les rendre sensibles à la casse), les mots peuvent commencer ou se terminer par "*" pour une comparaison partielle; exemple: "test,(?-i)*toto*,flash*"`
** type: chaîne
diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt
index 7e23b859d..5b64a3fac 100644
--- a/doc/fr/weechat_plugin_api.fr.txt
+++ b/doc/fr/weechat_plugin_api.fr.txt
@@ -6369,6 +6369,10 @@ Paramètres :
*** '-italic' : désactiver l'italique
*** 'underline' : activer le souligné
*** '-underline' : désactiver le souligné
+*** 'emphasis' : activer/désactiver la mise en valeur du texte (note: cela ne
+ devrait être utilisé que dans les barres, car WeeChat utilise la mise en
+ valeur du texte lors de la recherche de texte dans le tampon)
+ _(nouveau dans la version 0.4.2)_
** nom d'une couleur de barre :
*** 'bar_fg' : couleur de texte pour la barre
*** 'bar_delim' : couleur des délimiteurs pour la barre
diff --git a/doc/it/autogen/user/weechat_options.txt b/doc/it/autogen/user/weechat_options.txt
index 7fafcc71a..5c3691fca 100644
--- a/doc/it/autogen/user/weechat_options.txt
+++ b/doc/it/autogen/user/weechat_options.txt
@@ -188,6 +188,16 @@
** tipo: colore
** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `cyan`)
+* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
+** descrizione: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** tipo: colore
+** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `yellow`)
+
+* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
+** descrizione: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** tipo: colore
+** valori: un nome colore di WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numero colore del terminale o un alias; attributi consentiti prima del colore (solo per il colore del testo, non lo sfondo): "*" per il grassetto, "!" per l'inverso, "_" per la sottolineatura (valore predefinito: `magenta`)
+
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** descrizione: `colore del testo per le azioni sulla riga di input`
** tipo: colore
@@ -478,6 +488,11 @@
** tipo: bool
** valori: on, off (valore predefinito: `off`)
+* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
+** descrizione: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
+** tipo: stringa
+** valori: qualsiasi stringa (valore predefinito: `""`)
+
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** descrizione: `elenco separato da virgole di parole da notificare; confronto non sensibile alle maiuscole (usare "(?-i)" all'inizio delle parole per renderle sensibili alle maiuscole), le parole possono iniziare o terminare con "*" per la corrispondenza parziale; ad esempio: "test,(?-i)*tizio*,flash*"`
** tipo: stringa
diff --git a/doc/it/weechat_plugin_api.it.txt b/doc/it/weechat_plugin_api.it.txt
index 3d23e3b64..97b355b95 100644
--- a/doc/it/weechat_plugin_api.it.txt
+++ b/doc/it/weechat_plugin_api.it.txt
@@ -6320,6 +6320,10 @@ Argomenti:
*** '-italic': rimuove corsivo
*** 'underline': imposta sottolineato
*** '-underline': rimuove sottolineato
+// TRANSLATION MISSING
+*** 'emphasis': toggle the emphasis for text (note: this should be used only in
+ bars, because WeeChat uses text emphasis when searching text in buffer)
+ _(new in version 0.4.2)_
** nome colore della barra:
*** 'bar_fg': colore di primo piano della barra
*** 'bar_delim': colore dei delimitatori della barra
diff --git a/doc/ja/autogen/user/weechat_options.txt b/doc/ja/autogen/user/weechat_options.txt
index 64644c61b..127a26c8b 100644
--- a/doc/ja/autogen/user/weechat_options.txt
+++ b/doc/ja/autogen/user/weechat_options.txt
@@ -188,6 +188,16 @@
** タイプ: 色
** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、下線は "_"。 (デフォルト値: `cyan`)
+* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
+** 説明: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** タイプ: 色
+** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、下線は "_"。 (デフォルト値: `yellow`)
+
+* [[option_weechat.color.emphasized_bg]] *weechat.color.emphasized_bg*
+** 説明: `background color for emphasized text (for example when searching text); used only if option weechat.look.emphasized_attributes is an empty string (default value)`
+** タイプ: 色
+** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、下線は "_"。 (デフォルト値: `magenta`)
+
* [[option_weechat.color.input_actions]] *weechat.color.input_actions*
** 説明: `入力がアクションの場合のテキスト色`
** タイプ: 色
@@ -478,6 +488,11 @@
** タイプ: ブール
** 値: on, off (デフォルト値: `off`)
+* [[option_weechat.look.emphasized_attributes]] *weechat.look.emphasized_attributes*
+** 説明: `attributes for emphasized text: one or more attribute chars ("*" for bold, "!" for reverse, "_" for underline); if the string is empty, the colors weechat.color.emphasized* are used`
+** タイプ: 文字列
+** 値: 未制約文字列 (デフォルト値: `""`)
+
* [[option_weechat.look.highlight]] *weechat.look.highlight*
** 説明: `コンマ区切りのハイライトされる単語リスト; 大文字小文字の区別無し (単語の最初に "(?-i)" をつければ区別有り)、部分マッチさせるには単語の最初か最後に "*" をつける; 例: "test,(?-i)*toto*,flash*"`
** タイプ: 文字列
diff --git a/po/cs.po b/po/cs.po
index 5d15bb372..92d987db9 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2647,6 +2647,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
+msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@@ -3138,6 +3144,18 @@ msgstr "barva textu děličů času"
msgid "text color for values"
msgstr "barva textu pro hodnoty"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr "barva textu pro akce ve vstupní řádce"
diff --git a/po/de.po b/po/de.po
index a3258871e..de9f71c93 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-12 09:01+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-08-12 09:02+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -3018,6 +3018,12 @@ msgstr ""
"deaktiviert, da es zu schwerwiegenden Grafikfehlern kommen kann)"
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -3586,6 +3592,18 @@ msgstr "Farbe in der das Trennzeichen für die Uhrzeit dargestellt werden soll"
msgid "text color for values"
msgstr "Farbe für Werte"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr ""
"Textfarbe in der Eingabezeile bei Aktivität (z.B. beim Einfügen von Zeilen)"
diff --git a/po/es.po b/po/es.po
index 646781ae4..aedd070fb 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2802,6 +2802,12 @@ msgstr ""
"visualización)"
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -3325,6 +3331,18 @@ msgstr "color para los delimitadores de la hora"
msgid "text color for values"
msgstr "color para los valores"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr "color para acciones en la línea de entrada"
diff --git a/po/fr.po b/po/fr.po
index 7957b9073..1367b9209 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-12 20:43+0200\n"
-"PO-Revision-Date: 2013-08-12 20:43+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
+"PO-Revision-Date: 2013-08-16 15:18+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -2935,6 +2935,16 @@ msgstr ""
"causer de sérieux problèmes d'affichages)"
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+"attributs pour le texte mis en valeur: un ou plusieurs caractères "
+"d'attributs (\"*\" pour du gras, \"!\" pour la vidéo inverse, \"_\" pour du "
+"souligné); si la chaîne est vide, les couleurs weechat.color.emphasized* "
+"sont utilisées"
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -3482,6 +3492,24 @@ msgstr "couleur du texte pour les délimiteurs de l'heure"
msgid "text color for values"
msgstr "couleur du texte pour les valeurs"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+"couleur du texte pour le texte mis en valeur (par exemple lors de la "
+"recherche de texte); cette option est utilisée seulement si l'option weechat."
+"look.emphasized_attributes est une chaîne vide (valeur par défaut)"
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+"couleur du fond pour le texte mis en valeur (par exemple lors de la "
+"recherche de texte); cette option est utilisée seulement si l'option weechat."
+"look.emphasized_attributes est une chaîne vide (valeur par défaut)"
+
msgid "text color for actions in input line"
msgstr "couleur du texte pour les actions dans la ligne de saisie"
@@ -10500,6 +10528,17 @@ msgstr "Type"
msgid "Constants"
msgstr "Constantes"
+#~ msgid "text color for emphasized text (for example when searching text)"
+#~ msgstr ""
+#~ "couleur du texte pour le texte mis en valeur (par exemple lors d'une "
+#~ "recherche de texte)"
+
+#~ msgid ""
+#~ "background color for emphasized text (for example when searching text)"
+#~ msgstr ""
+#~ "couleur du fond pour le texte mis en valeur (par exemple lors de la "
+#~ "recherche de texte)"
+
#~ msgid "time format for date displayed when day changed"
#~ msgstr "format de date pour la date affichée quand le jour a changé"
diff --git a/po/hu.po b/po/hu.po
index 417d05471..1cba901ac 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2297,6 +2297,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
+msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@@ -2757,6 +2763,18 @@ msgstr "információs pult határolóinak színe"
msgid "text color for values"
msgstr "üzenetek színe"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
#, fuzzy
msgid "text color for actions in input line"
msgstr "kilépési nyíl színe"
diff --git a/po/it.po b/po/it.po
index 421bb1251..d5715bee4 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:41+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2851,6 +2851,12 @@ msgstr ""
"seri errori di visualizzazione)"
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -3385,6 +3391,18 @@ msgstr "colore del testo per i delimitator dell'orario"
msgid "text color for values"
msgstr "colore del testo per i valori"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr "colore del testo per le azioni sulla riga di input"
diff --git a/po/ja.po b/po/ja.po
index 36629b7b1..eb63b9690 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-08-02 08:50+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@@ -2818,6 +2818,12 @@ msgstr ""
"め、このオプションはデフォルトで無効化されている)"
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -3329,6 +3335,18 @@ msgstr "時間区切りのテキスト色"
msgid "text color for values"
msgstr "値のテキスト色"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr "入力がアクションの場合のテキスト色"
diff --git a/po/pl.po b/po/pl.po
index c259dce2c..fc2504157 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-08-02 08:50+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2875,6 +2875,12 @@ msgstr ""
"poważne błędy wyświetlania)"
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -3406,6 +3412,18 @@ msgstr "kolor separatora czasu"
msgid "text color for values"
msgstr "kolor wyświetlania wartości"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr "kolor akcji w wprowadzonej linii"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 2fda5d75a..dd1056cc5 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:42+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2722,6 +2722,12 @@ msgstr ""
"(esta opção é desabilitada por padrão porque pode causar sérios problemas de "
"visualização"
+msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@@ -3226,6 +3232,18 @@ msgstr "cor do texto para delimitadores de tempo"
msgid "text color for values"
msgstr "cor de texto para valores"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr "cor de texto para ações de linha de entrada"
diff --git a/po/ru.po b/po/ru.po
index 399a4a793..6d37feb50 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:42+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2319,6 +2319,12 @@ msgid ""
"because it can cause serious display bugs)"
msgstr ""
+msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
#, fuzzy
msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
@@ -2788,6 +2794,18 @@ msgstr "цвет разделителей информационной пане
msgid "text color for values"
msgstr "цвет чата"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
#, fuzzy
msgid "text color for actions in input line"
msgstr "цвет действий в поле ввода"
diff --git a/po/tr.po b/po/tr.po
index 8323d75f6..e0ddf1dc5 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.2-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-07-31 18:42+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2061,6 +2061,12 @@ msgid ""
msgstr ""
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -2463,6 +2469,18 @@ msgstr ""
msgid "text color for values"
msgstr "değerler için metin rengi"
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr ""
diff --git a/po/weechat.pot b/po/weechat.pot
index 5c81f7ad6..33d5d6eb8 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.1-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2013-08-11 19:52+0200\n"
+"POT-Creation-Date: 2013-08-16 15:18+0200\n"
"PO-Revision-Date: 2013-02-14 18:20+0100\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2065,6 +2065,12 @@ msgid ""
msgstr ""
msgid ""
+"attributes for emphasized text: one or more attribute chars (\"*\" for bold, "
+"\"!\" for reverse, \"_\" for underline); if the string is empty, the colors "
+"weechat.color.emphasized* are used"
+msgstr ""
+
+msgid ""
"comma separated list of words to highlight; case insensitive comparison (use "
"\"(?-i)\" at beginning of words to make them case sensitive), words may "
"begin or end with \"*\" for partial match; example: \"test,(?-i)*toto*,flash*"
@@ -2467,6 +2473,18 @@ msgstr ""
msgid "text color for values"
msgstr ""
+msgid ""
+"text color for emphasized text (for example when searching text); this "
+"option is used only if option weechat.look.emphasized_attributes is an empty "
+"string (default value)"
+msgstr ""
+
+msgid ""
+"background color for emphasized text (for example when searching text); used "
+"only if option weechat.look.emphasized_attributes is an empty string "
+"(default value)"
+msgstr ""
+
msgid "text color for actions in input line"
msgstr ""
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 126736203..8a32df9c7 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -101,6 +101,7 @@ struct t_config_option *config_look_confirm_quit;
struct t_config_option *config_look_day_change;
struct t_config_option *config_look_day_change_time_format;
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_regex;
struct t_config_option *config_look_highlight_tags;
@@ -198,6 +199,8 @@ struct t_config_option *config_color_chat_text_found_bg;
struct t_config_option *config_color_chat_time;
struct t_config_option *config_color_chat_time_delimiters;
struct t_config_option *config_color_chat_value;
+struct t_config_option *config_color_emphasized;
+struct t_config_option *config_color_emphasized_bg;
struct t_config_option *config_color_input_actions;
struct t_config_option *config_color_input_text_not_found;
struct t_config_option *config_color_separator;
@@ -262,6 +265,7 @@ int config_length_nick_prefix_suffix = 0;
int config_length_prefix_same_nick = 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_regex = NULL;
char **config_highlight_tags = NULL;
int config_num_highlight_tags = 0;
@@ -483,6 +487,34 @@ config_change_eat_newline_glitch (void *data, struct t_config_option *option)
}
/*
+ * Callback for changes on option "weechat.look.emphasized_attributes".
+ */
+
+void
+config_change_emphasized_attributes (void *data, struct t_config_option *option)
+{
+ int i;
+ const char *ptr_attr;
+
+ /* make C compiler happy */
+ (void) data;
+ (void) option;
+
+ config_emphasized_attributes = 0;
+
+ ptr_attr = CONFIG_STRING(config_look_emphasized_attributes);
+ if (ptr_attr)
+ {
+ for (i = 0; ptr_attr[i]; i++)
+ {
+ config_emphasized_attributes |= gui_color_attr_get_flag (ptr_attr[i]);
+ }
+ }
+
+ gui_window_ask_refresh (1);
+}
+
+/*
* Callback for changes on option "weechat.look.highlight_regex".
*/
@@ -2065,6 +2097,13 @@ config_weechat_init_options ()
"display bugs)"),
NULL, 0, 0, "off", NULL, 0, NULL, NULL,
&config_change_eat_newline_glitch, NULL, NULL, NULL);
+ config_look_emphasized_attributes = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "emphasized_attributes", "string",
+ N_("attributes for emphasized text: one or more attribute chars ("
+ "\"*\" for bold, \"!\" for reverse, \"_\" for underline); if the "
+ "string is empty, the colors weechat.color.emphasized* are used"),
+ NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_emphasized_attributes, NULL, NULL, NULL);
config_look_highlight = config_file_new_option (
weechat_config_file, ptr_section,
"highlight", "string",
@@ -2737,6 +2776,23 @@ config_weechat_init_options ()
N_("text color for values"),
NULL, GUI_COLOR_CHAT_VALUE, 0, "cyan", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ /* emphasis (chat/bars) */
+ config_color_emphasized = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "emphasized", "color",
+ N_("text color for emphasized text (for example when searching text); "
+ "this option is used only if option weechat.look.emphasized_attributes "
+ "is an empty string (default value)"),
+ NULL, GUI_COLOR_EMPHASIS, 0, "yellow", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_emphasized_bg = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "emphasized_bg", "color",
+ N_("background color for emphasized text (for example when searching "
+ "text); used only if option weechat.look.emphasized_attributes is an "
+ "empty string (default value)"),
+ NULL, -1, 0, "magenta", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
/* input bar */
config_color_input_actions = config_file_new_option (
weechat_config_file, ptr_section,
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 2ecb6ed73..cddfc1aa0 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -118,6 +118,7 @@ extern struct t_config_option *config_look_confirm_quit;
extern struct t_config_option *config_look_day_change;
extern struct t_config_option *config_look_day_change_time_format;
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_regex;
extern struct t_config_option *config_look_highlight_tags;
@@ -213,6 +214,8 @@ extern struct t_config_option *config_color_chat_text_found_bg;
extern struct t_config_option *config_color_chat_time;
extern struct t_config_option *config_color_chat_time_delimiters;
extern struct t_config_option *config_color_chat_value;
+extern struct t_config_option *config_color_emphasized;
+extern struct t_config_option *config_color_emphasized_bg;
extern struct t_config_option *config_color_input_actions;
extern struct t_config_option *config_color_input_text_not_found;
extern struct t_config_option *config_color_separator;
@@ -265,6 +268,7 @@ extern struct t_config_option *config_plugin_save_config_on_unload;
extern int config_length_nick_prefix_suffix;
extern int config_length_prefix_same_nick;
+extern int config_emphasized_attributes;
extern regex_t *config_highlight_regex;
extern char **config_highlight_tags;
extern int config_num_highlight_tags;
diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c
index 02a52478b..9176e8c8b 100644
--- a/src/gui/curses/gui-curses-bar-window.c
+++ b/src/gui/curses/gui-curses-bar-window.c
@@ -204,6 +204,10 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
gui_window_string_apply_color_pair ((unsigned char **)&string,
GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar);
break;
+ case GUI_COLOR_EMPHASIS_CHAR: /* emphasis */
+ string++;
+ gui_window_toggle_emphasis ();
+ break;
case GUI_COLOR_BAR_CHAR: /* bar color */
switch (string[1])
{
@@ -364,6 +368,12 @@ gui_bar_window_print_string (struct t_gui_bar_window *bar_window,
if (output)
free (output);
+ if (gui_window_current_emphasis)
+ {
+ gui_window_emphasize (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar,
+ *x, *y, size_on_screen);
+ }
+
*x += size_on_screen;
}
}
@@ -437,6 +447,8 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
index_subitem = -1;
index_line = 0;
+ gui_window_current_emphasis = 0;
+
filling = gui_bar_get_filling (bar_window->bar);
content = gui_bar_window_content_get_with_filling (bar_window, window);
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 0d753719f..e28dc92a6 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -262,6 +262,11 @@ gui_chat_string_next_char (struct t_gui_window *window, struct t_gui_line *line,
gui_window_string_apply_color_pair ((unsigned char **)&string,
(apply_style) ? GUI_WINDOW_OBJECTS(window)->win_chat : NULL);
break;
+ case GUI_COLOR_EMPHASIS_CHAR: /* emphasis */
+ string++;
+ if (apply_style)
+ gui_window_toggle_emphasis ();
+ break;
case GUI_COLOR_BAR_CHAR: /* bar color */
string++;
switch (string[0])
@@ -402,6 +407,13 @@ gui_chat_display_word_raw (struct t_gui_window *window, struct t_gui_line *line,
"%s", (output) ? output : utf_char);
if (output)
free (output);
+
+ if (gui_window_current_emphasis)
+ {
+ gui_window_emphasize (GUI_WINDOW_OBJECTS(window)->win_chat,
+ x, window->win_chat_cursor_y,
+ size_on_screen);
+ }
}
chars_displayed += size_on_screen;
}
@@ -432,10 +444,6 @@ gui_chat_display_word (struct t_gui_window *window,
char *data, *ptr_data, *end_line, saved_char, str_space[] = " ";
int chars_displayed, pos_saved_char, chars_to_display, num_displayed;
int length_align;
- attr_t attrs;
- attr_t *ptr_attrs;
- short pair;
- short *ptr_pair;
chars_displayed = 0;
@@ -481,17 +489,12 @@ gui_chat_display_word (struct t_gui_window *window,
&& CONFIG_STRING(config_look_prefix_suffix)[0]
&& line->data->date > 0)
{
- attrs = 0;
- pair = 0;
if (!simulate)
{
- ptr_attrs = &attrs;
- ptr_pair = &pair;
- wattr_get (GUI_WINDOW_OBJECTS(window)->win_chat,
- ptr_attrs, ptr_pair, NULL);
- gui_window_save_style ();
+ gui_window_save_style (GUI_WINDOW_OBJECTS(window)->win_chat);
gui_window_set_weechat_color (GUI_WINDOW_OBJECTS(window)->win_chat,
GUI_COLOR_CHAT_PREFIX_SUFFIX);
+ gui_window_current_emphasis = 0;
}
chars_displayed += gui_chat_display_word_raw (window, line,
CONFIG_STRING(config_look_prefix_suffix),
@@ -506,16 +509,7 @@ gui_chat_display_word (struct t_gui_window *window,
nick_offline);
window->win_chat_cursor_x += gui_chat_strlen_screen (str_space);
if (!simulate)
- {
- wattr_set (GUI_WINDOW_OBJECTS(window)->win_chat, attrs, pair, NULL);
- /*
- * for unknown reason, the wattr_set function sometimes
- * fails to set the color pair under FreeBSD, so we force
- * it again with wcolor_set
- */
- wcolor_set (GUI_WINDOW_OBJECTS(window)->win_chat, pair, NULL);
- gui_window_restore_style ();
- }
+ gui_window_restore_style (GUI_WINDOW_OBJECTS(window)->win_chat);
}
if (window->win_chat_cursor_y < window->coords_size)
window->coords[window->win_chat_cursor_y].data = (char *)word + (ptr_data - data);
@@ -1130,7 +1124,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
int word_start_offset, word_end_offset;
int word_length_with_spaces, word_length;
char *ptr_data, *ptr_end_offset, *next_char;
- char *ptr_style, *message_with_tags;
+ char *ptr_style, *message_with_tags, *message_with_search;
if (!line)
return 0;
@@ -1152,6 +1146,7 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
num_lines = gui_chat_display_line (window, line, 0, 1);
window->win_chat_cursor_x = x;
window->win_chat_cursor_y = y;
+ gui_window_current_emphasis = 0;
}
/* calculate marker position (maybe not used for this line!) */
@@ -1205,6 +1200,16 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
gui_chat_build_string_message_tags (line) : NULL;
ptr_data = (message_with_tags) ?
message_with_tags : line->data->message;
+ message_with_search = NULL;
+ if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
+ {
+ message_with_search = gui_color_emphasize (ptr_data,
+ window->buffer->input_buffer,
+ window->buffer->text_search_exact,
+ NULL);
+ if (message_with_search)
+ ptr_data = message_with_search;
+ }
while (ptr_data && ptr_data[0])
{
gui_chat_get_word_info (window,
@@ -1295,6 +1300,8 @@ gui_chat_display_line (struct t_gui_window *window, struct t_gui_line *line,
}
if (message_with_tags)
free (message_with_tags);
+ if (message_with_search)
+ free (message_with_search);
}
if (marker_line)
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index 77402a835..91bf38089 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -1434,6 +1434,7 @@ gui_color_init_weechat ()
gui_color_build (GUI_COLOR_CHAT_NICK_OFFLINE_HIGHLIGHT, CONFIG_COLOR(config_color_chat_nick_offline_highlight), CONFIG_COLOR(config_color_chat_nick_offline_highlight_bg));
gui_color_build (GUI_COLOR_CHAT_NICK_PREFIX, CONFIG_COLOR(config_color_chat_nick_prefix), CONFIG_COLOR(config_color_chat_bg));
gui_color_build (GUI_COLOR_CHAT_NICK_SUFFIX, CONFIG_COLOR(config_color_chat_nick_suffix), CONFIG_COLOR(config_color_chat_bg));
+ gui_color_build (GUI_COLOR_EMPHASIS, CONFIG_COLOR(config_color_emphasized), CONFIG_COLOR(config_color_emphasized_bg));
/*
* define old nick colors for compatibility on /upgrade with previous
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 6c92d34a7..13ca8434e 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -57,11 +57,16 @@
#include "gui-curses.h"
+#define GUI_WINDOW_MAX_SAVED_STYLES 32
+
+
int gui_window_current_style_fg; /* current foreground color */
int gui_window_current_style_bg; /* current background color */
-int gui_window_current_style_attr; /* current attributes (bold, ..) */
int gui_window_current_color_attr; /* attr sum of last color(s) used */
-int gui_window_saved_style[4]; /* current style saved */
+int gui_window_current_emphasis; /* 1 if text emphasis is enabled */
+struct t_gui_window_saved_style gui_window_saved_style[GUI_WINDOW_MAX_SAVED_STYLES];
+ /* circular list of saved styles */
+int gui_window_saved_style_index = 0; /* index in list of savec styles */
/*
@@ -218,12 +223,28 @@ gui_window_clrtoeol (WINDOW *window)
*/
void
-gui_window_save_style ()
+gui_window_save_style (WINDOW *window)
{
- gui_window_saved_style[0] = gui_window_current_style_fg;
- gui_window_saved_style[1] = gui_window_current_style_bg;
- gui_window_saved_style[2] = gui_window_current_style_attr;
- gui_window_saved_style[3] = gui_window_current_color_attr;
+ struct t_gui_window_saved_style *ptr_saved_style;
+ attr_t *ptr_attrs;
+ short *ptr_pair;
+
+ /* get pointer on saved style */
+ ptr_saved_style = &gui_window_saved_style[gui_window_saved_style_index];
+
+ /* save current style */
+ ptr_saved_style->style_fg = gui_window_current_style_fg;
+ ptr_saved_style->style_bg = gui_window_current_style_bg;
+ ptr_saved_style->color_attr = gui_window_current_color_attr;
+ ptr_saved_style->emphasis = gui_window_current_emphasis;
+ ptr_attrs = &ptr_saved_style->attrs;
+ ptr_pair = &ptr_saved_style->pair;
+ wattr_get (window, ptr_attrs, ptr_pair, NULL);
+
+ /* increment style index (circular list) */
+ gui_window_saved_style_index++;
+ if (gui_window_saved_style_index >= GUI_WINDOW_MAX_SAVED_STYLES)
+ gui_window_saved_style_index = 0;
}
/*
@@ -231,12 +252,30 @@ gui_window_save_style ()
*/
void
-gui_window_restore_style ()
+gui_window_restore_style (WINDOW *window)
{
- gui_window_current_style_fg = gui_window_saved_style[0];
- gui_window_current_style_bg = gui_window_saved_style[1];
- gui_window_current_style_attr = gui_window_saved_style[2];
- gui_window_current_color_attr = gui_window_saved_style[3];
+ struct t_gui_window_saved_style *ptr_saved_style;
+
+ /* decrement style index (circular list) */
+ gui_window_saved_style_index--;
+ if (gui_window_saved_style_index < 0)
+ gui_window_saved_style_index = GUI_WINDOW_MAX_SAVED_STYLES - 1;
+
+ /* get pointer on saved style */
+ ptr_saved_style = &gui_window_saved_style[gui_window_saved_style_index];
+
+ /* restore style */
+ gui_window_current_style_fg = ptr_saved_style->style_fg;
+ gui_window_current_style_bg = ptr_saved_style->style_bg;
+ gui_window_current_color_attr = ptr_saved_style->color_attr;
+ gui_window_current_emphasis = ptr_saved_style->emphasis;
+ wattr_set (window, ptr_saved_style->attrs, ptr_saved_style->pair, NULL);
+ /*
+ * for unknown reason, the wattr_set function sometimes
+ * fails to set the color pair under FreeBSD, so we force
+ * it again with wcolor_set
+ */
+ wcolor_set (window, ptr_saved_style->pair, NULL);
}
/*
@@ -248,7 +287,6 @@ gui_window_reset_style (WINDOW *window, int weechat_color)
{
gui_window_current_style_fg = -1;
gui_window_current_style_bg = -1;
- gui_window_current_style_attr = 0;
gui_window_current_color_attr = 0;
wattroff (window, A_BOLD | A_UNDERLINE | A_REVERSE);
@@ -406,11 +444,10 @@ gui_window_set_custom_color_fg (WINDOW *window, int fg)
void
gui_window_set_custom_color_bg (WINDOW *window, int bg)
{
- int current_attr, current_fg;
+ int current_fg;
if (bg >= 0)
{
- current_attr = gui_window_current_style_attr;
current_fg = gui_window_current_style_fg;
if ((bg > 0) && (bg & GUI_COLOR_EXTENDED_FLAG))
@@ -422,7 +459,6 @@ gui_window_set_custom_color_bg (WINDOW *window, int bg)
else if ((bg & GUI_COLOR_EXTENDED_MASK) < GUI_CURSES_NUM_WEECHAT_COLORS)
{
bg &= GUI_COLOR_EXTENDED_MASK;
- gui_window_set_color_style (window, current_attr);
gui_window_set_color (window, current_fg,
(gui_color_term_colors >= 16) ?
gui_weechat_colors[bg].background : gui_weechat_colors[bg].foreground);
@@ -515,6 +551,56 @@ gui_window_set_custom_color_pair (WINDOW *window, int pair)
}
/*
+ * Toggles text emphasis.
+ */
+
+void
+gui_window_toggle_emphasis ()
+{
+ gui_window_current_emphasis ^= 1;
+}
+
+/*
+ * Emphasizes some chars already displayed in a window, either using a color
+ * (from config options), or by doing an exclusive or (XOR) with attributes
+ * (like reverse video).
+ *
+ * It is used for example when searching a string in buffer.
+ */
+
+void
+gui_window_emphasize (WINDOW *window, int x, int y, int count)
+{
+ attr_t attrs, *ptr_attrs;
+ short pair, *ptr_pair;
+
+ if (config_emphasized_attributes == 0)
+ {
+ /* use color for emphasis (from config) */
+ mvwchgat (window, y, x, count,
+ gui_color[GUI_COLOR_EMPHASIS]->attributes,
+ gui_color_weechat_get_pair (GUI_COLOR_EMPHASIS), NULL);
+ }
+ else
+ {
+ /* exclusive or (XOR) with attributes */
+ ptr_attrs = &attrs;
+ ptr_pair = &pair;
+ wattr_get (window, ptr_attrs, ptr_pair, NULL);
+ if (config_emphasized_attributes & GUI_COLOR_EXTENDED_BOLD_FLAG)
+ attrs ^= A_BOLD;
+ if (config_emphasized_attributes & GUI_COLOR_EXTENDED_REVERSE_FLAG)
+ attrs ^= A_REVERSE;
+ if (config_emphasized_attributes & GUI_COLOR_EXTENDED_UNDERLINE_FLAG)
+ attrs ^= A_UNDERLINE;
+ mvwchgat (window, y, x, count, attrs, pair, NULL);
+ }
+
+ /* move the cursor after the text (mvwchgat does not move cursor) */
+ wmove (window, y, x + count);
+}
+
+/*
* Applies foreground color code in string and moves string pointer after color
* in string.
*
diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h
index 2b2860f2d..83a68b36d 100644
--- a/src/gui/curses/gui-curses.h
+++ b/src/gui/curses/gui-curses.h
@@ -45,6 +45,16 @@ struct t_gui_bar_window;
#define GUI_BAR_WINDOW_OBJECTS(bar_window) \
((struct t_gui_bar_window_curses_objects *)(bar_window->gui_objects))
+struct t_gui_window_saved_style
+{
+ int style_fg;
+ int style_bg;
+ int color_attr;
+ int emphasis;
+ attr_t attrs;
+ short pair;
+};
+
struct t_gui_window_curses_objects
{
WINDOW *win_chat; /* chat window (example: channel) */
@@ -66,6 +76,7 @@ extern int gui_color_pairs_auto_reset;
extern int gui_color_pairs_auto_reset_pending;
extern time_t gui_color_pairs_auto_reset_last;
extern int gui_color_buffer_refresh_needed;
+extern int gui_window_current_emphasis;
/* color functions */
extern int gui_color_get_pair (int fg, int bg);
@@ -88,6 +99,8 @@ extern void gui_window_read_terminal_size ();
extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer);
extern void gui_window_clear (WINDOW *window, int fg, int bg);
extern void gui_window_clrtoeol (WINDOW *window);
+extern void gui_window_save_style (WINDOW *window);
+extern void gui_window_restore_style (WINDOW *window);
extern void gui_window_reset_style (WINDOW *window, int num_color);
extern void gui_window_reset_color (WINDOW *window, int num_color);
extern void gui_window_set_color_style (WINDOW *window, int style);
@@ -98,6 +111,8 @@ extern void gui_window_set_custom_color_fg_bg (WINDOW *window, int fg, int bg);
extern void gui_window_set_custom_color_pair (WINDOW *window, int pair);
extern void gui_window_set_custom_color_fg (WINDOW *window, int fg);
extern void gui_window_set_custom_color_bg (WINDOW *window, int bg);
+extern void gui_window_toggle_emphasis ();
+extern void gui_window_emphasize (WINDOW *window, int x, int y, int count);
extern void gui_window_string_apply_color_fg (unsigned char **str,
WINDOW *window);
extern void gui_window_string_apply_color_bg (unsigned char **str,
@@ -112,8 +127,6 @@ extern void gui_window_string_apply_color_set_attr (unsigned char **str,
WINDOW *window);
extern void gui_window_string_apply_color_remove_attr (unsigned char **str,
WINDOW *window);
-extern void gui_window_apply_color (unsigned char **str, WINDOW *window,
- int apply_bar_colors);
extern void gui_window_set_title (const char *title);
#endif /* __WEECHAT_GUI_CURSES_H */
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c
index b1045f6b2..d596e1714 100644
--- a/src/gui/gui-chat.c
+++ b/src/gui/gui-chat.c
@@ -241,6 +241,8 @@ gui_chat_string_add_offset_screen (const char *string, int offset_screen)
/*
* Gets real position in string (ignoring formatting chars like
* colors/attributes).
+ *
+ * Returns real position, in bytes.
*/
int
@@ -276,6 +278,36 @@ gui_chat_string_real_pos (const char *string, int pos)
}
/*
+ * Gets real position in string (ignoring formatting chars like
+ * colors/attributes).
+ *
+ * Returns position, in number of UTF-8 chars.
+ */
+
+int
+gui_chat_string_pos (const char *string, int real_pos)
+{
+ const char *ptr_string, *limit;
+ int count;
+
+ count = 0;
+ ptr_string = string;
+ limit = ptr_string + real_pos;
+ while (ptr_string && ptr_string[0] && (ptr_string < limit))
+ {
+ ptr_string = gui_chat_string_next_char (NULL, NULL,
+ (unsigned char *)ptr_string,
+ 0, 0, 0);
+ if (ptr_string)
+ {
+ ptr_string = utf8_next_char (ptr_string);
+ count++;
+ }
+ }
+ return count;
+}
+
+/*
* Returns info about next word: beginning, end, length.
*
* Note: the word_{start|end}_offset are in bytes, but word_length(_with_spaces)
diff --git a/src/gui/gui-chat.h b/src/gui/gui-chat.h
index cd77d77d0..80ec2c622 100644
--- a/src/gui/gui-chat.h
+++ b/src/gui/gui-chat.h
@@ -71,6 +71,7 @@ extern char *gui_chat_string_add_offset (const char *string, int offset);
extern char *gui_chat_string_add_offset_screen (const char *string,
int offset_screen);
extern int gui_chat_string_real_pos (const char *string, int pos);
+extern int gui_chat_string_pos (const char *string, int real_pos);
extern void gui_chat_get_word_info (struct t_gui_window *window,
const char *data, int *word_start_offset,
int *word_end_offset,
diff --git a/src/gui/gui-color.c b/src/gui/gui-color.c
index 184d13cdf..d9e4d3e8e 100644
--- a/src/gui/gui-color.c
+++ b/src/gui/gui-color.c
@@ -40,6 +40,7 @@
#include "../core/wee-utf8.h"
#include "../plugins/plugin.h"
#include "gui-color.h"
+#include "gui-chat.h"
#include "gui-window.h"
@@ -171,6 +172,13 @@ gui_color_get_custom (const char *color_name)
GUI_COLOR_COLOR_CHAR,
GUI_COLOR_RESET_CHAR);
}
+ else if (string_strcasecmp (color_name, "emphasis") == 0)
+ {
+ snprintf (color[index_color], sizeof (color[index_color]),
+ "%c%c",
+ GUI_COLOR_COLOR_CHAR,
+ GUI_COLOR_EMPHASIS_CHAR);
+ }
else if (string_strcasecmp (color_name, "bold") == 0)
{
snprintf (color[index_color], sizeof (color[index_color]),
@@ -518,6 +526,9 @@ gui_color_decode (const char *string, const char *replacement)
&& (isdigit (ptr_string[5])))
ptr_string += 6;
break;
+ case GUI_COLOR_EMPHASIS_CHAR:
+ ptr_string++;
+ break;
case GUI_COLOR_BAR_CHAR:
ptr_string++;
switch (ptr_string[0])
@@ -583,6 +594,155 @@ gui_color_decode (const char *string, const char *replacement)
}
/*
+ * Emphasizes a string or regular expression in a string (which can contain
+ * colors).
+ *
+ * Argument "case_sensitive" is used only for "search", if the "regex" is NULL.
+ *
+ * Returns string with the search string/regex emphasized, NULL if error.
+ *
+ * Note: result must be freed after use.
+ */
+
+char *
+gui_color_emphasize (const char *string,
+ const char *search, int case_sensitive,
+ regex_t *regex)
+{
+ regmatch_t regex_match;
+ char *result, *result2, *string_no_color, *pos;
+ const char *ptr_string, *ptr_no_color, *color_emphasis;
+ int rc, length_search, length_emphasis, length_result;
+ int pos1, pos2, real_pos1, real_pos2, count_emphasis;
+
+ if (!string && !regex)
+ return NULL;
+
+ color_emphasis = gui_color_get_custom ("emphasis");
+ if (!color_emphasis)
+ return NULL;
+ length_emphasis = strlen (color_emphasis);
+
+ /*
+ * allocate space for 8 emphasized strings (8 before + 8 after = 16);
+ * more space will be allocated later (if there are more than 8 emphasized
+ * strings)
+ */
+ length_result = strlen (string) + (length_emphasis * 2 * 8) + 1;
+ result = malloc (length_result);
+ if (!result)
+ return NULL;
+ result[0] = '\0';
+
+ /*
+ * build a string without color codes to search in this one (then with the
+ * position of text found, we will retrieve position in original string,
+ * which can contain color codes)
+ */
+ string_no_color = gui_color_decode (string, NULL);
+ if (!string_no_color)
+ {
+ free (result);
+ return NULL;
+ }
+
+ length_search = (search) ? strlen (search) : 0;
+
+ ptr_string = string;
+ ptr_no_color = string_no_color;
+
+ count_emphasis = 0;
+
+ while (ptr_no_color && ptr_no_color[0])
+ {
+ if (regex)
+ {
+ /* search next match using the regex */
+ rc = regexec (regex, ptr_no_color, 1, &regex_match, 0);
+
+ /*
+ * no match found: exit the loop (if rm_no == 0, it is an empty
+ * match at beginning of string: we consider there is no match, to
+ * prevent an infinite loop)
+ */
+ if ((rc != 0) || (regex_match.rm_so < 0) || (regex_match.rm_eo <= 0))
+ {
+ strcat (result, ptr_string);
+ break;
+ }
+ pos1 = regex_match.rm_so;
+ pos2 = regex_match.rm_eo;
+ }
+ else
+ {
+ /* search next match in the string */
+ if (case_sensitive)
+ pos = strstr (ptr_no_color, search);
+ else
+ pos = string_strcasestr (ptr_no_color, search);
+ if (!pos)
+ {
+ strcat (result, ptr_string);
+ break;
+ }
+ pos1 = pos - ptr_no_color;
+ pos2 = pos1 + length_search;
+ if (pos2 <= 0)
+ {
+ strcat (result, ptr_string);
+ break;
+ }
+ }
+
+ /*
+ * find the position of match in the original string (which can contain
+ * color codes)
+ */
+ real_pos1 = gui_chat_string_real_pos (ptr_string,
+ gui_chat_string_pos (ptr_no_color, pos1));
+ real_pos2 = gui_chat_string_real_pos (ptr_string,
+ gui_chat_string_pos (ptr_no_color, pos2));
+
+ /*
+ * concatenate following strings to the result:
+ * - beginning of string (before match)
+ * - emphasis color code
+ * - the matching string
+ * - emphasis color code
+ */
+ if (real_pos1 > 0)
+ strncat (result, ptr_string, real_pos1);
+ strcat (result, color_emphasis);
+ strncat (result, ptr_string + real_pos1, real_pos2 - real_pos1);
+ strcat (result, color_emphasis);
+
+ /* restart next loop after the matching string */
+ ptr_string += real_pos2;
+ ptr_no_color += pos2;
+
+ /* check if we should allocate more space for emphasis color codes */
+ count_emphasis++;
+ if (count_emphasis == 8)
+ {
+ /* allocate more space for emphasis color codes */
+ length_result += (length_emphasis * 2 * 8);
+ result2 = realloc (result, length_result);
+ if (!result2)
+ {
+ free (result);
+ return NULL;
+ }
+ result = result2;
+ count_emphasis = 0;
+ }
+ }
+
+ free (string_no_color);
+
+ return result;
+}
+
+/*
* Frees a color.
*/
diff --git a/src/gui/gui-color.h b/src/gui/gui-color.h
index 91e56fe60..e480c72e2 100644
--- a/src/gui/gui-color.h
+++ b/src/gui/gui-color.h
@@ -20,6 +20,8 @@
#ifndef __WEECHAT_GUI_COLOR_H
#define __WEECHAT_GUI_COLOR_H 1
+#include <regex.h>
+
/*
* Color from configuration options.
* When changing some colors below:
@@ -78,6 +80,7 @@ enum t_gui_color_enum
GUI_COLOR_CHAT_NICK_OFFLINE_HIGHLIGHT,
GUI_COLOR_CHAT_NICK_PREFIX,
GUI_COLOR_CHAT_NICK_SUFFIX,
+ GUI_COLOR_EMPHASIS,
/* number of colors */
GUI_COLOR_NUM_COLORS,
@@ -112,6 +115,7 @@ enum t_gui_color_enum
#define GUI_COLOR_EXTENDED_ITALIC_CHAR '/'
#define GUI_COLOR_EXTENDED_UNDERLINE_CHAR '_'
#define GUI_COLOR_EXTENDED_KEEPATTR_CHAR '|'
+#define GUI_COLOR_EMPHASIS_CHAR 'E'
/* color codes specific to bars */
#define GUI_COLOR_BAR_CHAR 'b'
@@ -165,6 +169,8 @@ extern int gui_color_attr_get_flag (char c);
extern void gui_color_attr_build_string (int color, char *str_attr);
extern const char *gui_color_get_custom (const char *color_name);
extern char *gui_color_decode (const char *string, const char *replacement);
+extern char *gui_color_emphasize (const char *string, const char *search,
+ int case_sensitive, regex_t *regex);
extern void gui_color_free (struct t_gui_color *color);
extern void gui_color_palette_alloc_structs ();
extern int gui_color_palette_get_alias (const char *alias);
diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h
index 4296b7b6d..bfcbcc154 100644
--- a/src/gui/gui-window.h
+++ b/src/gui/gui-window.h
@@ -201,8 +201,6 @@ extern int gui_window_get_height ();
extern int gui_window_objects_init (struct t_gui_window *window);
extern void gui_window_objects_free (struct t_gui_window *window,
int free_separators);
-extern void gui_window_save_style ();
-extern void gui_window_restore_style ();
extern void gui_window_calculate_pos_size (struct t_gui_window *window);
extern void gui_window_switch_to_buffer (struct t_gui_window *window,
struct t_gui_buffer *buffer,