source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: support the highly surprising escape sequence \# (line
Date: Sat, 18 Aug 2018 16:37:31 -0500 (EST)	[thread overview]
Message-ID: <c89f12cb7ab5816c@fantadrom.bsd.lv> (raw)

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

                 reply	other threads:[~2018-08-18 21:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c89f12cb7ab5816c@fantadrom.bsd.lv \
    --to=schwarze@mandoc.bsd.lv \
    --cc=source@mandoc.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).