1 diff -ur ../MUTT/mutt/PATCHES mutt/PATCHES
2 --- ../MUTT/mutt/PATCHES 2002-12-09 18:44:54.000000000 +0100
3 +++ mutt/PATCHES 2004-01-19 13:50:52.000000000 +0100
5 +patch-1.5.5.1.nt.xtitles.3.ab.1
6 diff -ur ../MUTT/mutt/curs_main.c mutt/curs_main.c
7 --- ../MUTT/mutt/curs_main.c 2003-09-03 19:09:09.000000000 +0200
8 +++ mutt/curs_main.c 2004-01-19 13:45:37.000000000 +0100
10 extern const char *ReleaseDate;
11 extern size_t UngetCount;
13 +#define ASCII_CTRL_G 0x07
14 +#define ASCII_CTRL_OPEN_SQUARE_BRAKET 0x1b
16 +void set_xterm_title_bar(char *title)
18 + fprintf(stderr ,"%c]2;%s%c", ASCII_CTRL_OPEN_SQUARE_BRAKET, title, ASCII_CTRL_G);
21 +void set_xterm_icon_name(char *name)
23 + fprintf(stderr, "%c]1;%s%c", ASCII_CTRL_OPEN_SQUARE_BRAKET, name, ASCII_CTRL_G);
26 void index_make_entry (char *s, size_t l, MUTTMENU *menu, int num)
28 format_flag flag = M_FORMAT_MAKEPRINT | M_FORMAT_ARROWCURSOR | M_FORMAT_INDEX;
30 mutt_paddstr (COLS, buf);
31 SETCOLOR (MT_COLOR_NORMAL);
32 menu->redraw &= ~REDRAW_STATUS;
33 + if (option(OPTXTERMSETTITLES))
35 + menu_status_line (buf, sizeof (buf), menu, NONULL (XtermTitle));
36 + set_xterm_title_bar(buf);
37 + menu_status_line (buf, sizeof (buf), menu, NONULL (XtermIcon));
38 + set_xterm_icon_name(buf);
43 diff -ur ../MUTT/mutt/globals.h mutt/globals.h
44 --- ../MUTT/mutt/globals.h 2003-07-15 13:41:32.000000000 +0200
45 +++ mutt/globals.h 2004-01-19 13:45:37.000000000 +0100
50 +WHERE char *XtermTitle;
51 +WHERE char *XtermIcon;
53 WHERE char *LastFolder;
55 diff -ur ../MUTT/mutt/init.c mutt/init.c
56 --- ../MUTT/mutt/init.c 2004-01-05 19:49:00.000000000 +0100
57 +++ mutt/init.c 2004-01-19 13:48:45.000000000 +0100
59 toggle_option (MuttVars[idx].data);
61 set_option (MuttVars[idx].data);
63 + /* sanity check for xterm */
64 + if ((mutt_strcmp (MuttVars[idx].option, "xterm_set_titles") == 0)
65 + && option (OPTXTERMSETTITLES))
67 + char *ep = getenv ("TERM");
68 + /* Make sure that the terminal can take the control codes */
69 + if (ep == NULL) unset_option (MuttVars[idx].data);
70 + else if (mutt_strncasecmp (ep, "xterm", 5) &&
71 + mutt_strncasecmp (ep, "color-xterm", 11) &&
72 + mutt_strncasecmp (ep, "eterm", 5) &&
73 + mutt_strncasecmp (ep, "kterm", 5) &&
74 + mutt_strncasecmp (ep, "nxterm", 6) &&
75 + mutt_strncasecmp (ep, "putty", 5) &&
76 + mutt_strncasecmp (ep, "screen", 6) &&
77 + mutt_strncasecmp (ep, "cygwin", 6) &&
78 + mutt_strncasecmp (ep, "rxvt", 4) )
79 + unset_option (MuttVars[idx]. data);
83 else if (DTYPE (MuttVars[idx].type) == DT_STR ||
84 DTYPE (MuttVars[idx].type) == DT_PATH ||
85 diff -ur ../MUTT/mutt/init.h mutt/init.h
86 --- ../MUTT/mutt/init.h 2004-01-05 19:49:00.000000000 +0100
87 +++ mutt/init.h 2004-01-19 13:45:37.000000000 +0100
88 @@ -2670,6 +2670,27 @@
89 ** Controls whether mutt writes out the Bcc header when preparing
90 ** messages to be sent. Exim users may wish to use this.
92 + {"xterm_icon", DT_STR, R_BOTH, UL &XtermIcon, UL "M%?n?AIL&ail?"},
95 + ** Controls the format of the icon title, as long as xterm_set_titles
96 + ** is enabled. This string is identical in formatting to the one used by
97 + ** ``$$status_format''.
99 + {"xterm_set_titles", DT_BOOL, R_BOTH, OPTXTERMSETTITLES, 0},
102 + ** Controls whether mutt sets the xterm title bar and icon name
103 + ** (as long as you're in an appropriate terminal). The default must
104 + ** be off to force in the validity checking.
106 + {"xterm_title", DT_STR, R_BOTH, UL &XtermTitle, UL "Mutt with %?m?%m messages&no messages?%?n? [%n NEW]?"},
109 + ** Controls the format of the title bar of the xterm provided that
110 + ** xterm_set_titles has been set. This string is identical in formatting
111 + ** to the one used by ``$$status_format''.
116 diff -ur ../MUTT/mutt/mutt.h mutt/mutt.h
117 --- ../MUTT/mutt/mutt.h 2004-01-05 19:49:00.000000000 +0100
118 +++ mutt/mutt.h 2004-01-19 13:45:37.000000000 +0100
121 OPTWRITEBCC, /* write out a bcc header? */
127 diff -ur ../MUTT/mutt/pager.c mutt/pager.c
128 --- ../MUTT/mutt/pager.c 2004-01-05 19:49:00.000000000 +0100
129 +++ mutt/pager.c 2004-01-19 13:45:37.000000000 +0100
134 +void set_xterm_title_bar(char *title);
135 +void set_xterm_icon_name(char *name);
139 @@ -1740,6 +1742,13 @@
140 SETCOLOR (MT_COLOR_STATUS);
141 mutt_paddstr (COLS, buffer);
142 SETCOLOR (MT_COLOR_NORMAL);
143 + if (option(OPTXTERMSETTITLES))
145 + menu_status_line (buffer, sizeof (buffer), index, NONULL (XtermTitle));
146 + set_xterm_title_bar(buffer);
147 + menu_status_line (buffer, sizeof (buffer), index, NONULL (XtermIcon));
148 + set_xterm_icon_name(buffer);