--- irssi-0.8.15/src/fe-common/core/fe-messages.c +++ irssi-b/src/fe-common/core/fe-messages.c @@ -64,8 +64,12 @@ if (*bgn == '*') type = 2; /* bold */ - else if (*bgn == '_') + else if (*bgn == '_') type = 31; /* underlined */ + /* XXX: irssi does not support 'true' italics at this time. */ + else if (settings_get_bool("emphasis_underline_slashes") && + (*bgn == '/')) + type = 31; /* italics */ else continue; @@ -76,7 +80,8 @@ if ((end = strchr(bgn+1, *bgn)) == NULL) continue; if (!ishighalnum(end[-1]) || ishighalnum(end[1]) || - end[1] == type || end[1] == '*' || end[1] == '_') + end[1] == type || end[1] == '*' || end[1] == '_' || + end[1] == '/') continue; if (IS_CHANNEL(item)) { @@ -643,6 +648,7 @@ settings_add_bool("lookandfeel", "emphasis", TRUE); settings_add_bool("lookandfeel", "emphasis_replace", FALSE); settings_add_bool("lookandfeel", "emphasis_multiword", FALSE); + settings_add_bool("lookandfeel", "emphasis_underline_slashes", FALSE); settings_add_bool("lookandfeel", "show_nickmode", TRUE); settings_add_bool("lookandfeel", "show_nickmode_empty", TRUE); settings_add_bool("lookandfeel", "print_active_channel", FALSE); --- irssi-0.8.15/src/fe-common/core/formats.c +++ irssi-b/src/fe-common/core/formats.c @@ -118,6 +118,10 @@ g_string_append_c(out, 4); g_string_append_c(out, FORMAT_STYLE_UNDERLINE); break; + case 'I': + /* italics on/off */ + g_string_append_c(out, 4); + g_string_append_c(out, FORMAT_STYLE_ITALIC); case '9': case '_': /* bold on/off */ @@ -1050,6 +1054,7 @@ if (!hide_text_style) flags ^= GUI_PRINT_FLAG_REVERSE; break; + case 29: /* italics */ case 31: /* underline */ if (!hide_text_style) --- irssi-0.8.15/src/fe-common/core/formats.h +++ irssi-b/src/fe-common/core/formats.h @@ -7,9 +7,10 @@ #define GUI_PRINT_FLAG_BOLD 0x0001 #define GUI_PRINT_FLAG_REVERSE 0x0002 #define GUI_PRINT_FLAG_UNDERLINE 0x0004 -#define GUI_PRINT_FLAG_BLINK 0x0008 -#define GUI_PRINT_FLAG_MIRC_COLOR 0x0010 -#define GUI_PRINT_FLAG_INDENT 0x0020 +#define GUI_PRINT_FLAG_ITALIC 0x0008 +#define GUI_PRINT_FLAG_BLINK 0x0010 +#define GUI_PRINT_FLAG_MIRC_COLOR 0x0020 +#define GUI_PRINT_FLAG_INDENT 0x0040 #define GUI_PRINT_FLAG_NEWLINE 0x0080 #define GUI_PRINT_FLAG_CLRTOEOL 0x0100 #define GUI_PRINT_FLAG_MONOSPACE 0x0200 @@ -126,8 +127,9 @@ #define FORMAT_STYLE_BLINK (0x01 + FORMAT_STYLE_SPECIAL) #define FORMAT_STYLE_UNDERLINE (0x02 + FORMAT_STYLE_SPECIAL) #define FORMAT_STYLE_BOLD (0x03 + FORMAT_STYLE_SPECIAL) -#define FORMAT_STYLE_REVERSE (0x04 + FORMAT_STYLE_SPECIAL) -#define FORMAT_STYLE_INDENT (0x05 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_ITALIC (0x04 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_REVERSE (0x05 + FORMAT_STYLE_SPECIAL) +#define FORMAT_STYLE_INDENT (0x06 + FORMAT_STYLE_SPECIAL) #define FORMAT_STYLE_DEFAULTS (0x07 + FORMAT_STYLE_SPECIAL) #define FORMAT_STYLE_CLRTOEOL (0x08 + FORMAT_STYLE_SPECIAL) #define FORMAT_STYLE_MONOSPACE (0x09 + FORMAT_STYLE_SPECIAL) --- irssi-0.8.15/src/fe-text/gui-printtext.c +++ irssi-b/src/fe-text/gui-printtext.c @@ -157,6 +157,7 @@ if (flags & GUI_PRINT_FLAG_REVERSE) *attr |= ATTR_REVERSE; if (flags & GUI_PRINT_FLAG_BOLD) *attr |= ATTR_BOLD; if (flags & GUI_PRINT_FLAG_UNDERLINE) *attr |= ATTR_UNDERLINE; + if (flags & GUI_PRINT_FLAG_ITALIC) *attr |= ATTR_UNDERLINE; if (flags & GUI_PRINT_FLAG_BLINK) *attr |= ATTR_BLINK; }