From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id 29b077bc; for ; Wed, 31 Dec 2014 11:53:10 -0500 (EST) Date: Wed, 31 Dec 2014 11:53:10 -0500 (EST) Message-Id: <10412463885170170339.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: When showing more than one formatted manual page, insert X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- When showing more than one formatted manual page, insert horizontal lines between pages. Suggested by Theo Buehler . Even in UTF-8 output mode, do not use fancy line drawing characters such that you can easily use /^--- to skip to the next manual in your pager. Modified Files: -------------- mdocml: main.c main.h term_ascii.c Revision Data ------------- Index: main.h =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.h,v retrieving revision 1.19 retrieving revision 1.20 diff -Lmain.h -Lmain.h -u -p -r1.19 -r1.20 --- main.h +++ main.h @@ -1,6 +1,7 @@ /* $Id$ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons + * Copyright (c) 2014 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -45,6 +46,7 @@ void *locale_alloc(const struct mchars void *utf8_alloc(const struct mchars *, char *); void *ascii_alloc(const struct mchars *, char *); void ascii_free(void *); +void ascii_sepline(void *); void *pdf_alloc(const struct mchars *, char *); void *ps_alloc(const struct mchars *, char *); Index: term_ascii.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/term_ascii.c,v retrieving revision 1.41 retrieving revision 1.42 diff -Lterm_ascii.c -Lterm_ascii.c -u -p -r1.41 -r1.42 --- term_ascii.c +++ term_ascii.c @@ -174,6 +174,20 @@ ascii_setwidth(struct termp *p, int iop, p->rmargin = p->maxrmargin = p->defrmargin; } +void +ascii_sepline(void *arg) +{ + struct termp *p; + size_t i; + + p = (struct termp *)arg; + putchar('\n'); + for (i = 0; i < p->defrmargin; i++) + putchar('-'); + putchar('\n'); + putchar('\n'); +} + static size_t ascii_width(const struct termp *p, int c) { Index: main.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.c,v retrieving revision 1.209 retrieving revision 1.210 diff -Lmain.c -Lmain.c -u -p -r1.209 -r1.210 --- main.c +++ main.c @@ -447,7 +447,9 @@ main(int argc, char *argv[]) if (MANDOCLEVEL_OK != rc && curp.wstop) break; - argc--; + + if (--argc && curp.outtype <= OUTT_UTF8) + ascii_sepline(curp.outdata); } if (curp.outfree) @@ -634,6 +636,8 @@ passthrough(const char *file, int fd, in size_t len, off; ssize_t nw; int print; + + fflush(stdout); if ((stream = fdopen(fd, "r")) == NULL) { close(fd); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv