source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mandoc: support the highly surprising escape sequence \# (line
@ 2018-08-18 21:37 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2018-08-18 21:37 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-18 21:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-18 21:37 mandoc: support the highly surprising escape sequence \# (line schwarze

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).