* mdocml: Suppress printing blank eof pages in -Tps.
@ 2010-07-04 19:57 kristaps
0 siblings, 0 replies; only message in thread
From: kristaps @ 2010-07-04 19:57 UTC (permalink / raw)
To: source
Log Message:
-----------
Suppress printing blank eof pages in -Tps. Delay printing of Page:
until actual text is ready to be displayed.
Modified Files:
--------------
mdocml:
term_ps.c
Revision Data
-------------
Index: term_ps.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ps.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -Lterm_ps.c -Lterm_ps.c -u -p -r1.29 -r1.30
--- term_ps.c
+++ term_ps.c
@@ -580,12 +580,14 @@ ps_end(struct termp *p)
* well as just one.
*/
- assert(0 == p->engine.ps.flags);
- assert('\0' == p->engine.ps.last);
- assert(p->engine.ps.psmarg && p->engine.ps.psmarg[0]);
- printf("%s", p->engine.ps.psmarg);
- p->engine.ps.pages++;
- printf("showpage\n");
+ if ( ! (PS_NEWPAGE & p->engine.ps.flags)) {
+ assert(0 == p->engine.ps.flags);
+ assert('\0' == p->engine.ps.last);
+ assert(p->engine.ps.psmarg && p->engine.ps.psmarg[0]);
+ printf("%s", p->engine.ps.psmarg);
+ p->engine.ps.pages++;
+ printf("showpage\n");
+ }
printf("%%%%Trailer\n");
printf("%%%%Pages: %zu\n", p->engine.ps.pages);
@@ -674,6 +676,11 @@ ps_pletter(struct termp *p, int c)
* now at the current cursor.
*/
+ if (PS_NEWPAGE & p->engine.ps.flags)
+ printf("%%%%Page: %zu %zu\n",
+ p->engine.ps.pages + 1,
+ p->engine.ps.pages + 1);
+
if ( ! (PS_INLINE & p->engine.ps.flags)) {
ps_printf(p, "%zu %zu moveto\n(",
AFM2PNT(p, p->engine.ps.pscol),
@@ -870,9 +877,6 @@ ps_endline(struct termp *p)
printf("%s", p->engine.ps.psmarg);
printf("showpage\n");
p->engine.ps.pages++;
- printf("%%%%Page: %zu %zu\n",
- p->engine.ps.pages + 1,
- p->engine.ps.pages + 1);
p->engine.ps.psrow = p->engine.ps.top;
assert( ! (PS_NEWPAGE & p->engine.ps.flags));
p->engine.ps.flags |= PS_NEWPAGE;
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-04 19:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-04 19:57 mdocml: Suppress printing blank eof pages in -Tps kristaps
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).