score.c send.c sendlib.c signal.c sort.c \
status.c system.c thread.c charset.c history.c lib.c \
muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c md5c.c \
- url.c ascii.c mutt_idna.c sidebar.c hcache.c crypt-mod.c crypt-mod.h
+ url.c ascii.c mutt_idna.c sidebar.c hcache.c crypt-mod.c crypt-mod.h \
+ xterm.c
muttng_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(LIBPOP) $(LIBNNTP) \
-Llib -lsane $(MUTTLIBS) $(INTLLIBS) $(LIBICONV)
2005-24-07:
+ The $xterm_leave option has been added.
+
The '^' shortcut pointing to the current folder is no longer
only available in muttng as it has been integrated into mutt, too.
#include "buffy.h"
#include "mx.h"
#include "sidebar.h"
+#include "xterm.h"
#ifdef USE_POP
#include "pop.h"
extern const char *ReleaseDate;
extern size_t UngetCount;
-static void set_xterm_title_bar (char *title)
-{
- fputs ("\033]2;", stdout);
- fputs (title, stdout);
- fputs ("\007", stdout);
- fflush (stdout);
-}
-
-static void set_xterm_icon_name (char *name)
-{
- fputs ("\033]1;", stdout);
- fputs (name, stdout);
- fputs ("\007", stdout);
- fflush (stdout);
-}
-
void index_make_entry (char *s, size_t l, MUTTMENU * menu, int num)
{
format_flag flag =
menu->redraw &= ~REDRAW_STATUS;
if (option (OPTXTERMSETTITLES)) {
menu_status_line (buf, sizeof (buf), menu, NONULL (XtermTitle));
- set_xterm_title_bar (buf);
+ mutt_xterm_set_title (buf);
menu_status_line (buf, sizeof (buf), menu, NONULL (XtermIcon));
- set_xterm_icon_name (buf);
+ mutt_xterm_set_icon (buf);
}
}
This variable, when _\bs_\be_\bt, makes the thread tree narrower, allowing deeper
threads to fit on the screen.
- _\b6_\b._\b3_\b._\b1_\b4_\b3 _\bn_\bn_\bt_\bp_\b__\ba_\bs_\bk_\b__\bf_\bo_\bl_\bl_\bo_\bw_\b__\bu_\bp
+ _\b6_\b._\b3_\b._\b1_\b4_\b3 _\bn_\bn_\bt_\bp_\b__\ba_\bs_\bk_\b__\bf_\bo_\bl_\bl_\bo_\bw_\bu_\bp_\b__\bt_\bo
Type: boolean
Default: 'M%?n?AIL&ail?'
Controls the format of the X11 icon title, as long as _\b$_\bx_\bt_\be_\br_\bm_\b__\bs_\be_\bt_\b__\bt_\bi_\bt_\bl_\be_\bs (sec-
- tion 6.3.336 , page 146) is _\bs_\be_\bt. This string is identical in formatting to the
+ tion 6.3.337 , page 146) is _\bs_\be_\bt. This string is identical in formatting to the
one used by ``_\b$_\bs_\bt_\ba_\bt_\bu_\bs_\b__\bf_\bo_\br_\bm_\ba_\bt (section 6.3.302 , page 137)''.
- _\b6_\b._\b3_\b._\b3_\b3_\b6 _\bx_\bt_\be_\br_\bm_\b__\bs_\be_\bt_\b__\bt_\bi_\bt_\bl_\be_\bs
+ _\b6_\b._\b3_\b._\b3_\b3_\b6 _\bx_\bt_\be_\br_\bm_\b__\bl_\be_\ba_\bv_\be
+
+ Type: string
+
+ Default: ''
+
+ If _\b$_\bx_\bt_\be_\br_\bm_\b__\bs_\be_\bt_\b__\bt_\bi_\bt_\bl_\be_\bs (section 6.3.337 , page 146) is _\bs_\be_\bt, this string will be
+ used to set the title when leaving mutt-ng. For terminal-based programs,
+ there's no easy and portable way to read the current title so mutt-ng cannot
+ read it upon startup and restore it when exiting.
+
+ Based on the xterm FAQ, the following might work: set xterm_leave = '`test
+
+ The Mutt-ng E-Mail Client 148
+
+ x_\bD_\bI_\bS_\bP_\bL_\bA_\bY (section , page ) != x && xprop -id _\bW_\bI_\bN_\bD_\bO_\bW_\bI_\bD (section , page ) | grep
+ WM_NAME | cut -d ''' -f 2`'
+
+ _\b6_\b._\b3_\b._\b3_\b3_\b7 _\bx_\bt_\be_\br_\bm_\b__\bs_\be_\bt_\b__\bt_\bi_\bt_\bl_\be_\bs
Type: boolean
you're in an appropriate terminal). The default must be _\bu_\bn_\bs_\be_\bt to force in the
validity checking.
- _\b6_\b._\b3_\b._\b3_\b3_\b7 _\bx_\bt_\be_\br_\bm_\b__\bt_\bi_\bt_\bl_\be
-
- The Mutt-ng E-Mail Client 148
+ _\b6_\b._\b3_\b._\b3_\b3_\b8 _\bx_\bt_\be_\br_\bm_\b__\bt_\bi_\bt_\bl_\be
Type: string
Default: 'Mutt-ng with %?m?%m messages&no messages?%?n? [%n New]?'
Controls the format of the title bar of the xterm provided that
- _\b$_\bx_\bt_\be_\br_\bm_\b__\bs_\be_\bt_\b__\bt_\bi_\bt_\bl_\be_\bs (section 6.3.336 , page 146) has been _\bs_\be_\bt. This string is
+ _\b$_\bx_\bt_\be_\br_\bm_\b__\bs_\be_\bt_\b__\bt_\bi_\bt_\bl_\be_\bs (section 6.3.337 , page 146) has been _\bs_\be_\bt. This string is
identical in formatting to the one used by ``_\b$_\bs_\bt_\ba_\bt_\bu_\bs_\b__\bf_\bo_\br_\bm_\ba_\bt (section 6.3.302 ,
page 137)''.
tings for this menu will affect the default bindings for all menus (except as
noted).
+ The Mutt-ng E-Mail Client 149
+
bottom-page L move to the bottom of the page
current-bottom not bound move current entry to bottom of page
current-middle not bound move current entry to middle of page
tag-prefix ; apply next command to tagged entries
tag-prefix-cond not bound apply next function ONLY to tagged messages
top-page H move to the top of the page
-
- The Mutt-ng E-Mail Client 149
-
what-key not bound display the keycode for a key press
_\b6_\b._\b4_\b._\b2 _\bi_\bn_\bd_\be_\bx
WHERE char *Username;
WHERE char *Visual;
WHERE char *XtermTitle;
+WHERE char *XtermLeave;
WHERE char *XtermIcon;
WHERE char *CurrentFolder;
** (as long as you're in an appropriate terminal). The default must
** be \fIunset\fP to force in the validity checking.
*/
+ {"xterm_leave", DT_STR, R_BOTH, UL &XtermLeave, UL "" },
+ /*
+ ** .pp
+ ** If $$xterm_set_titles is \fIset\fP, this string will be used to
+ ** set the title when leaving mutt-ng. For terminal-based programs,
+ ** there's no easy and portable way to read the current title so mutt-ng
+ ** cannot read it upon startup and restore it when exiting.
+ **
+ ** .pp
+ ** Based on the xterm FAQ, the following might work:
+ **
+ ** .pp
+ ** \fTset xterm_leave = "`test x$DISPLAY != x && xprop -id $WINDOWID | grep WM_NAME | cut -d '"' -f 2`"\fT
+ */
{"xterm_title", DT_STR, R_BOTH, UL &XtermTitle, UL "Mutt-ng with %?m?%m messages&no messages?%?n? [%n New]?"},
/*
** .pp
#include "url.h"
#include "mutt_crypt.h"
#include "mutt_idna.h"
+#include "xterm.h"
#include "lib/mem.h"
#include "lib/intl.h"
int version = 0;
int i;
int explicit_folder = 0;
- long sek;
extern char *optarg;
extern int optind;
/* initialize random number for tmp file creation */
- time (&sek);
- srand (sek);
+ srand ((unsigned int) time (NULL));
/* sanity check against stupid administrators */
M_READONLY : 0, NULL))
|| !explicit_folder) {
mutt_index_menu ();
+ if (option (OPTXTERMSETTITLES))
+ mutt_xterm_set_title (NONULL (XtermLeave));
if (Context)
FREE (&Context);
}
--- /dev/null
+/*
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#include <stdio.h>
+#include "xterm.h"
+#include "lib/str.h"
+
+void mutt_xterm_set_title (char *title) {
+ fputs ("\033]2;", stdout);
+ fputs (NONULL (title), stdout);
+ fputs ("\007", stdout);
+ fflush (stdout);
+}
+
+void mutt_xterm_set_icon (char *name) {
+ fputs ("\033]1;", stdout);
+ fputs (NONULL (name), stdout);
+ fputs ("\007", stdout);
+ fflush (stdout);
+}
--- /dev/null
+/*
+ * This file is part of mutt-ng, see http://www.muttng.org/.
+ * It's licensed under the GNU General Public License,
+ * please see the file GPL in the top level source directory.
+ */
+#ifndef MUTT_XTERM_H
+#define MUTT_XTERM_H
+
+/* sets the current xterm's title */
+void mutt_xterm_set_title (char *title);
+
+/* sets the current xterm's icon */
+void mutt_xterm_set_icon (char *name);
+
+#endif /* !MUTT_XTERM_H */