From e11983f44e59d8de236affa5b0d0d3067c192e24 Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Fri, 10 Feb 2012 16:18:22 +0100 Subject: [PATCH] Removed the -bell option from mhl. --- man/mh-chart.man1 | 1 - man/mhl.man1 | 15 +++-------- uip/mhl.c | 74 +++++++++++++++++------------------------------------ 3 files changed, 27 insertions(+), 63 deletions(-) diff --git a/man/mh-chart.man1 b/man/mh-chart.man1 index c425bdc..1dbf20f 100644 --- a/man/mh-chart.man1 +++ b/man/mh-chart.man1 @@ -254,7 +254,6 @@ is equivalent to .HP 5 .B mhl -.RB [ \-bell " | " \-nobell ] .RB [ \-clear " | " \-noclear ] .RB [ \-folder .IR +folder ] diff --git a/man/mhl.man1 b/man/mhl.man1 index e453bab..de44448 100644 --- a/man/mhl.man1 +++ b/man/mhl.man1 @@ -8,7 +8,6 @@ mhl \- produce formatted listings of nmh messages .HP 5 .na .B mhl -.RB [ \-bell " | " \-nobell ] .RB [ \-clear " | " \-noclear ] .RB [ \-folder .IR +folder ] @@ -47,17 +46,12 @@ prompting for the next message (if there is one), and a (usually CTRL-\\) will terminate the program (without core dump). .PP The -.B \-bell -option tells -.B mhl -to ring the terminal's bell at the -end of each page, while the .B \-clear option tells .B mhl to clear the screen at the end of each page (or output a formfeed after each message). -Both of these switches (and their inverse counterparts) take effect only +This switches (and its inverse counterpart) take effect only if the profile entry .I moreproc is defined but empty, and @@ -207,7 +201,7 @@ follow a component, they apply only to that component, otherwise, their affect is global. Since the whole format is parsed before any output processing, the last global switch setting for a variable applies to the whole message if that variable is used in a global context (i.e., -bell, clearscreen, width, length). +clearscreen, width, length). .PP .RS 5 .nf @@ -226,8 +220,6 @@ uppercase flag output text of this component in all nouppercase flag don't uppercase clearscreen flag/G clear the screen prior to each page noclearscreen flag/G don't clearscreen -bell flag/G ring the bell at the end of each page -nobell flag/G don't bell component string/L name to use instead of \*(lqcomponent\*(rq for this component nocomponent flag don't output \*(lqcomponent: \*(rq for this @@ -341,7 +333,6 @@ show(1), ap(8), dp(8) .SH DEFAULTS .nf -.RB ` \-bell ' .RB ` \-noclear ' .RB ` \-length 40 ' .RB ` \-width 80 ' @@ -358,7 +349,7 @@ tool, the switch does only take file names, but no format strings with a prepended equal sign `='. .PP -There should be some way to pass `bell' and `clear' information to the +There should be some way to pass `clear' information to the front\-end. .PP The \*(lqnonewline\*(rq option interacts badly with \*(lqcompress\*(rq diff --git a/uip/mhl.c b/uip/mhl.c index 98e58d0..ef5f860 100644 --- a/uip/mhl.c +++ b/uip/mhl.c @@ -41,41 +41,37 @@ #define QUOTE '\\' static struct swit mhlswitches[] = { -#define BELLSW 0 - { "bell", 0 }, -#define NBELLSW 1 - { "nobell", 0 }, -#define CLRSW 2 +#define CLRSW 0 { "clear", 0 }, -#define NCLRSW 3 +#define NCLRSW 1 { "noclear", 0 }, -#define FOLDSW 4 +#define FOLDSW 2 { "folder +folder", 0 }, -#define FORMSW 5 +#define FORMSW 3 { "form formfile", 0 }, -#define PROGSW 6 +#define PROGSW 4 { "moreproc program", 0 }, -#define LENSW 7 +#define LENSW 5 { "length lines", 0 }, -#define WIDTHSW 8 +#define WIDTHSW 6 { "width columns", 0 }, -#define SLEEPSW 9 +#define SLEEPSW 7 { "sleep seconds", 0 }, -#define VERSIONSW 10 +#define VERSIONSW 8 { "version", 0 }, -#define HELPSW 11 +#define HELPSW 9 { "help", 0 }, -#define FORW1SW 12 +#define FORW1SW 10 { "forward", -7 }, -#define FORW2SW 13 +#define FORW2SW 11 { "forwall", -7 }, -#define DGSTSW 14 +#define DGSTSW 12 { "digest list", -6 }, -#define VOLUMSW 15 +#define VOLUMSW 13 { "volume number", -6 }, -#define ISSUESW 16 +#define ISSUESW 14 { "issue number", -5 }, -#define NBODYSW 17 +#define NBODYSW 15 { "nobody", -6 }, { NULL, 0 } }; @@ -90,13 +86,12 @@ static struct swit mhlswitches[] = { #define LEFTADJUST 0x000080 /* left justify multiple lines */ #define COMPRESS 0x000100 /* compress text */ #define ADDRFMT 0x000200 /* contains addresses */ -#define BELL 0x000400 /* sound bell at EOP */ -#define DATEFMT 0x000800 /* contains dates */ -#define FORMAT 0x001000 /* parse address/date/RFC-2047 field */ -#define INIT 0x002000 /* initialize component */ -#define SPLIT 0x004000 /* split headers (don't concatenate) */ -#define NONEWLINE 0x008000 /* don't write trailing newline */ -#define LBITS "\020\01NOCOMPONENT\02UPPERCASE\03CENTER\04CLEARTEXT\05EXTRA\06HDROUTPUT\07CLEARSCR\010LEFTADJUST\011COMPRESS\012ADDRFMT\013BELL\014DATEFMT\015FORMAT\016INIT\017SPLIT\020NONEWLINE" +#define DATEFMT 0x000400 /* contains dates */ +#define FORMAT 0x000800 /* parse address/date/RFC-2047 field */ +#define INIT 0x001000 /* initialize component */ +#define SPLIT 0x002000 /* split headers (don't concatenate) */ +#define NONEWLINE 0x004000 /* don't write trailing newline */ +#define LBITS "\020\01NOCOMPONENT\02UPPERCASE\03CENTER\04CLEARTEXT\05EXTRA\06HDROUTPUT\07CLEARSCR\010LEFTADJUST\011COMPRESS\012ADDRFMT\013DATEFMT\014FORMAT\015INIT\016SPLIT\017NONEWLINE" #define GFLAGS (NOCOMPONENT | UPPERCASE | CENTER | LEFTADJUST | COMPRESS | SPLIT) struct mcomp { @@ -120,7 +115,7 @@ static struct mcomp *fmthd = NULL; static struct mcomp *fmttl = NULL; static struct mcomp global = { - NULL, NULL, "", NULL, NULL, 0, -1, 80, -1, 40, BELL, 0 + NULL, NULL, "", NULL, NULL, 0, -1, 80, -1, 40, 0, 0 }; static struct mcomp holder = { @@ -172,8 +167,6 @@ static struct triple triples[] = { { "split", SPLIT, 0 }, { "nosplit", 0, SPLIT }, { "addrfield", ADDRFMT, DATEFMT }, - { "bell", BELL, 0 }, - { "nobell", 0, BELL }, { "datefield", DATEFMT, ADDRFMT }, { "newline", 0, NONEWLINE }, { "nonewline", NONEWLINE, 0 }, @@ -181,7 +174,6 @@ static struct triple triples[] = { }; -static int bellflg = 0; static int clearflg = 0; static int dobody = 1; static int forwflg = 0; @@ -312,13 +304,6 @@ main(int argc, char **argv) print_version(invo_name); done(1); - case BELLSW: - bellflg = 1; - continue; - case NBELLSW: - bellflg = -1; - continue; - case CLRSW: clearflg = 1; continue; @@ -505,7 +490,7 @@ mhl_format(char *file, int length, int width) global.c_cwidth = -1; if ((i = sc_length()) > 5) global.c_length = i - 1; - global.c_flags = BELL; /* BELL is default */ + global.c_flags = 0; *(ip = ignores) = NULL; while (vfgets(fp, &ap) == OK) { @@ -604,15 +589,6 @@ out: global.c_flags &= ~CLEARSCR; } - switch (bellflg) { /* command line may override format file */ - case 1: - global.c_flags |= BELL; - break; - case -1: - global.c_flags &= ~BELL; - break; - } - if (length) global.c_length = length; if (width) @@ -1305,8 +1281,6 @@ putch(char ch) row++; if (row != global.c_length) break; - if (global.c_flags & BELL) - putchar('\007'); fflush(stdout); buf[0] = 0; read(fileno(stdout), buf, sizeof(buf)); -- 1.7.10.4