char *incproc = NMHBINDIR"/inc";
/*
-** This is the default program invoked by a "list" response
-** at the "What now?" prompt. It is also used by the draft
-** folder facility in comp/dist/forw/repl to display the
-** draft message.
+** This is the default program invoked by a "list" or "display" response
+** at the "What now?" prompt. It will be given the absolute pathname of
+** the message to show. The string ``show -file'' is most likely what you
+** want to be you lproc.
*/
-char *lproc = "more";
+char *lproc = "show -file";
/*
** This is the path for the Bell equivalent mail program.
.RE
.PP
.BR lproc :
-more
+show -file
.RS 5
This program is used to list the contents of a message in response
to the
.B list
-directive at the \*(lqWhat now?\*(rq prompt. It is
-also used by the draft folder facility in
-.BR comp ,
-.BR dist ,
-.BR forw ,
and
-.B repl
-to display the draft message.
+.B display
+directive at the \*(lqWhat now?\*(rq prompt.
+The absolute pathname of the message to list will be appended to
+the command line given.
.RE
.PP
.BR mailproc :
.I fileproc
is valid.
.PP
-For the
-.B display
-and
-.B list
-responses, any valid argument to
-the
-.I lproc
-is valid. If any non\-switch arguments are present, then
-the pathname of the draft will be excluded from the argument list given
-to the
-.I lproc
-(this is useful for listing another
-.B nmh
-message).
-.PP
See
.BR mh\-profile (5)
for further information about how editors
readconfig.c ruserpass.c seq_add.c seq_bits.c \
seq_del.c seq_getnum.c seq_list.c seq_nameok.c \
seq_print.c seq_read.c seq_save.c seq_setcur.c \
- seq_setprev.c seq_setunseen.c showfile.c signals.c \
+ seq_setprev.c seq_setunseen.c signals.c \
smatch.c snprintb.c strcasecmp.c \
strindex.c trimcpy.c uprf.c vfgets.c fmt_def.c \
m_msgdef.c mf.c utils.c m_mktemp.c
+++ /dev/null
-/*
-** showfile.c -- invoke the `lproc' command
-**
-** This code is Copyright (c) 2002, by the authors of nmh. See the
-** COPYRIGHT file in the root directory of the nmh distribution for
-** complete copyright information.
-*/
-
-#include <h/mh.h>
-
-
-int
-showfile(char **arg, char *file)
-{
- pid_t pid;
- int isdraft, vecp;
- char *vec[MAXARGS];
-
- context_save(); /* save the context file */
- fflush(stdout);
-
- /*
- ** If you have your lproc listed as "mhl",
- ** then really invoked the mhlproc instead
- ** (which is usually mhl anyway).
- */
- if (strcmp(mhbasename(lproc), "mhl")==0)
- lproc = mhlproc;
-
- switch (pid = fork()) {
- case -1:
- /* fork error */
- advise("fork", "unable to");
- return 1;
-
- case 0:
- /* child */
- vecp = 0;
- vec[vecp++] = mhbasename(lproc);
- isdraft = 1;
- if (arg) {
- while (*arg) {
- if (**arg != '-')
- isdraft = 0;
- vec[vecp++] = *arg++;
- }
- }
- if (isdraft) {
- if (strcmp(vec[0], "show")==0)
- vec[vecp++] = "-file";
- vec[vecp++] = file;
- }
- vec[vecp] = NULL;
-
- execvp(lproc, vec);
- fprintf(stderr, "unable to exec ");
- perror(lproc);
- _exit(-1);
-
- default:
- /* parent */
- return (pidwait(pid, -1) & 0377 ? 1 : 0);
- }
-
- return 1; /* NOT REACHED */
-}
#define SHOWMIMESW 8
{ "showmimeproc program", 0 },
#define FILESW 9
- { "file file", -4 }, /* interface from showfile */
+ { "file file", -4 }, /* interface from lproc (whatnow) */
#define VERSIONSW 10
{ "version", 0 },
#define HELPSW 11
#define REFILEOPT 1
{ "refile [<switches>] +folder", 0 },
#define DISPSW 2
- { "display [<switches>]", 0 },
+ { "display", 0 },
#define LISTSW 3
- { "list [<switches>]", 0 },
+ { "list", 0 },
#define SENDSW 4
{ "send [<switches>]", 0 },
#define PUSHSW 5
switch (smatch(*argp, aleqs)) {
case DISPSW:
/* display the msg being replied to or distributed */
- if (msgnam)
- showfile(++argp, msgnam);
- else
+ if (msgnam) {
+ snprintf(buf, sizeof buf, "%s '%s'",
+ lproc, msgnam);
+ system(buf);
+ } else {
advise(NULL, "no alternate message to display");
+ }
break;
case EDITSW:
case LISTSW:
/* display the draft file */
- showfile(++argp, drft);
+ snprintf(buf, sizeof buf, "%s '%s'", lproc, drft);
+ system(buf);
break;
case QUITSW: