My goal is to have show/mhshow generate a single stream of bytes to be
piped through a pager. Content not convertable to text shall not be displayed
directly. This is my idea currently.
.IR content ]
\&...
.RB [ \-serialonly " | " \-noserialonly ]
.IR content ]
\&...
.RB [ \-serialonly " | " \-noserialonly ]
-.RB [ \-pause " | " \-nopause ]
.RB [ \-form
.IR formfile ]
.RB [ \-rcache
.RB [ \-form
.IR formfile ]
.RB [ \-rcache
.IR content ]
\&...
.RB [ \-serialonly " | " \-noserialonly ]
.IR content ]
\&...
.RB [ \-serialonly " | " \-noserialonly ]
-.RB [ \-pause " | " \-nopause ]
.RB [ \-form
.IR formfile ]
.RB [ \-rcache
.RB [ \-form
.IR formfile ]
.RB [ \-rcache
%f Insert filename containing content
%F %e, %f, and stdin is terminal not content
%l display listing prior to displaying content
%f Insert filename containing content
%F %e, %f, and stdin is terminal not content
%l display listing prior to displaying content
-%p %l, and ask for confirmation
%s Insert content subtype
%d Insert content description
%% Insert the character %
%s Insert content subtype
%d Insert content description
%% Insert the character %
expands to be the filename containing the content, the e-escape has no
expansion as far as the shell is concerned.
.PP
expands to be the filename containing the content, the e-escape has no
expansion as far as the shell is concerned.
.PP
-When the p-escape prompts for confirmation, typing INTR (usually
-control-C) will tell
-.B mhshow
-not to display that content.
-The p-escape can be disabled by specifying the switch
-.BR \-nopause .
Further, when
.B mhshow
is display a content, typing QUIT (usually
Further, when
.B mhshow
is display a content, typing QUIT (usually
-mhshow-show-text/plain: %pmoreproc '%F'
-mhshow-show-message/rfc822: %pshow -file '%F'
+mhshow-show-text/plain: %lmoreproc '%F'
+mhshow-show-message/rfc822: %lshow -file '%F'
.RB ` msgs "' defaults to cur"
.RB ` \-nocheck '
.RB ` \-form mhl.headers '
.RB ` msgs "' defaults to cur"
.RB ` \-nocheck '
.RB ` \-form mhl.headers '
.RB ` \-rcache ask '
.RB ` \-realsize '
.RB ` \-noserialonly '
.RB ` \-rcache ask '
.RB ` \-realsize '
.RB ` \-noserialonly '
I am a stupid spammer.
EOF
I am a stupid spammer.
EOF
-mhshow -nopause $msgnum > $actual 2>&1
+mhshow $msgnum > $actual 2>&1
part text/plain 34
This is a test; this is the body.
EOF
part text/plain 34
This is a test; this is the body.
EOF
-mhshow -nopause $msgnum > $actual 2>&1
+mhshow $msgnum > $actual 2>&1
diff -u $expected $actual
diff -u $expected $actual
=l
=\b ^H (backspace) character, probably erased = in diff output
EOF
=l
=\b ^H (backspace) character, probably erased = in diff output
EOF
-mhshow -nopause $msgnum > $actual 2>&1
+mhshow $msgnum > $actual 2>&1
diff -u $expected $actual
diff -u $expected $actual
{ "check", 0 },
#define NCHECKSW 1
{ "nocheck", 0 },
{ "check", 0 },
#define NCHECKSW 1
{ "nocheck", 0 },
-#define PAUSESW 2
- { "pause", 0 },
-#define NPAUSESW 3
- { "nopause", 0 },
-#define SERIALSW 4
-#define FILESW 8 /* interface from show */
+#define FILESW 6 /* interface from show */
extern char *cache_private;
/* mhshowsbr.c */
extern char *cache_private;
/* mhshowsbr.c */
extern int serialsw;
extern char *progsw;
extern int nolist;
extern int serialsw;
extern char *progsw;
extern int nolist;
- case PAUSESW:
- pausesw = 1;
- continue;
- case NPAUSESW:
- pausesw = 0;
- continue;
-
case SERIALSW:
serialsw = 1;
continue;
case SERIALSW:
serialsw = 1;
continue;
if ((cp = getenv("MM_NOASK")) && strcmp(cp, "1")==0) {
nolist = 1;
if ((cp = getenv("MM_NOASK")) && strcmp(cp, "1")==0) {
nolist = 1;
int serialsw = 0;
int nolist = 0;
int serialsw = 0;
int nolist = 0;
-static sigjmp_buf intrenv;
-
/* termsbr.c */
int SOprintf(char *, ...);
/* termsbr.c */
int SOprintf(char *, ...);
static void DisplayMsgHeader(CT, char *);
static int show_switch(CT, int, int);
static int show_content(CT, int, int);
static void DisplayMsgHeader(CT, char *);
static int show_switch(CT, int, int);
static int show_content(CT, int, int);
-static int show_content_aux2(CT, int, int, char *, char *,
- int, int, int, int, int);
+static int show_content_aux2(CT, int, int, char *, char *, int, int, int, int);
static int show_text(CT, int, int);
static int show_multi(CT, int, int);
static int show_multi_internal(CT, int, int);
static int show_text(CT, int, int);
static int show_multi(CT, int, int);
static int show_multi_internal(CT, int, int);
static int show_message_rfc822(CT, int, int);
static int show_partial(CT, int, int);
static int show_external(CT, int, int);
static int show_message_rfc822(CT, int, int);
static int show_partial(CT, int, int);
static int show_external(CT, int, int);
-static RETSIGTYPE intrser(int);
show_content_aux(CT ct, int serial, int alternate, char *cp, char *cracked)
{
int fd, len, buflen, quoted;
show_content_aux(CT ct, int serial, int alternate, char *cp, char *cracked)
{
int fd, len, buflen, quoted;
- int xstdin, xlist, xpause, xtty;
+ int xstdin, xlist, xtty;
char *bp, *pp, *file, buffer[BUFSIZ];
CI ci = &ct->c_ctinfo;
char *bp, *pp, *file, buffer[BUFSIZ];
CI ci = &ct->c_ctinfo;
return (alternate ? DONE : OK);
xlist = 0;
return (alternate ? DONE : OK);
xlist = 0;
- /* %l, and pause prior to displaying content */
- xpause = pausesw;
- /* and fall... */
-
case 'l':
/*
** display listing prior to displaying content
case 'l':
/*
** display listing prior to displaying content
got_command:
return show_content_aux2(ct, serial, alternate, cracked, buffer,
got_command:
return show_content_aux2(ct, serial, alternate, cracked, buffer,
- fd, xlist, xpause, xstdin, xtty);
+ fd, xlist, xstdin, xtty);
static int
show_content_aux2(CT ct, int serial, int alternate, char *cracked,
static int
show_content_aux2(CT ct, int serial, int alternate, char *cracked,
- char *buffer, int fd, int xlist, int xpause, int xstdin, int xtty)
+ char *buffer, int fd, int xlist, int xstdin, int xtty)
if (ct->c_type == CT_MULTIPART)
list_content(ct, -1, 1, 0, 0);
else
list_switch(ct, -1, 1, 0, 0);
if (ct->c_type == CT_MULTIPART)
list_content(ct, -1, 1, 0, 0);
else
list_switch(ct, -1, 1, 0, 0);
-
- if (xpause && SOprintf("Press <return> to show content..."))
- printf("Press <return> to show content...");
-
- if (xpause) {
- int intr;
- SIGNAL_HANDLER istat;
-
- istat = SIGNAL(SIGINT, intrser);
- if ((intr = sigsetjmp(intrenv, 1)) == OK) {
- fflush(stdout);
- prompt[0] = 0;
- read(fileno(stdout), prompt, sizeof(prompt));
- }
- SIGNAL(SIGINT, istat);
- if (intr != OK || prompt[0] == 'n') {
- (*ct->c_ceclosefnx) (ct);
- return (alternate ? DONE : NOTOK);
- }
- if (prompt[0] == 'q') done(OK);
- }
}
snprintf(exec, sizeof(exec), "exec %s", buffer);
}
snprintf(exec, sizeof(exec), "exec %s", buffer);
show_multi_aux(CT ct, int serial, int alternate, char *cp)
{
int len, buflen, quoted;
show_multi_aux(CT ct, int serial, int alternate, char *cp)
{
int len, buflen, quoted;
- int xlist, xpause, xtty;
char *bp, *pp, *file, buffer[BUFSIZ];
struct multipart *m = (struct multipart *) ct->c_ctparams;
struct part *part;
char *bp, *pp, *file, buffer[BUFSIZ];
struct multipart *m = (struct multipart *) ct->c_ctparams;
struct part *part;
xtty = 0;
/* get buffer ready to go */
xtty = 0;
/* get buffer ready to go */
- /* %l, and pause prior to displaying content */
- xpause = pausesw;
- /* and fall... */
-
case 'l':
/*
** display listing prior to displaying content
case 'l':
/*
** display listing prior to displaying content
}
return show_content_aux2(ct, serial, alternate, NULL, buffer,
}
return show_content_aux2(ct, serial, alternate, NULL, buffer,
- NOTOK, xlist, xpause, 0, xtty);
+ NOTOK, xlist, 0, xtty);
-
-
-static RETSIGTYPE
-intrser(int i)
-{
-#ifndef RELIABLE_SIGNALS
- SIGNAL(SIGINT, intrser);
-#endif
-
- putchar('\n');
- siglongjmp(intrenv, DONE);
-}