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 b98aaba6 for ; Sat, 18 Aug 2018 16:37:31 -0500 (EST) Date: Sat, 18 Aug 2018 16:37:31 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: support the highly surprising escape sequence \# (line X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-Id: Log Message: ----------- support the highly surprising escape sequence \# (line continuation with comment); used for example by gropdf(1) Modified Files: -------------- mandoc: roff.7 roff.c Revision Data ------------- Index: roff.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/roff.c,v retrieving revision 1.333 retrieving revision 1.334 diff -Lroff.c -Lroff.c -u -p -r1.333 -r1.334 --- roff.c +++ roff.c @@ -1205,7 +1205,14 @@ roff_res(struct roff *r, struct buf *buf r->man->next = ROFF_NEXT_SIBLING; } - /* Discard comments. */ + /* Line continuation with comment. */ + + if (stesc[1] == '#') { + *stesc = '\0'; + return ROFF_APPEND; + } + + /* Discard normal comments. */ while (stesc > start && stesc[-1] == ' ') stesc--; Index: roff.7 =================================================================== RCS file: /home/cvs/mandoc/mandoc/roff.7,v retrieving revision 1.99 retrieving revision 1.100 diff -Lroff.7 -Lroff.7 -u -p -r1.99 -r1.100 --- roff.7 +++ roff.7 @@ -1819,6 +1819,12 @@ is an unpaddable space-sized non-breakin .Ss \e\(dq The rest of the input line is treated as .Sx Comments . +.Ss \e# +Line continuation with comment. +Discard the rest of the physical input line and continue the logical +input line on the next physical input line, joining the text on +both lines together as if it were on a single input line. +This is a groff extension. .Ss \e% Hyphenation allowed at this point of the word; ignored by .Xr mandoc 1 . -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv