source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* texi2mdoc: Account for @item a=@var{foo} and similar by using a `Ns'
@ 2015-03-03 15:04 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2015-03-03 15:04 UTC (permalink / raw)
  To: source

Log Message:
-----------
Account for @item a=@var{foo} and similar by using a `Ns' macro to remove
spacing between the macro and prior text.  This cleans up, among others, the
GNU ld.texinfo manual.
Also add the backslash.

Modified Files:
--------------
    texi2mdoc:
        extern.h
        main.c

Revision Data
-------------
Index: main.c
===================================================================
RCS file: /home/cvs/mdocml/texi2mdoc/main.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -Lmain.c -Lmain.c -u -p -r1.58 -r1.59
--- main.c
+++ main.c
@@ -94,7 +94,8 @@ static	const struct texitok __texitoks[T
 	{ dosymbol, "*", 1 }, /* TEXICMD_ASTERISK */
 	{ dosymbol, "@", 1 }, /* TEXICMD_AT */
 	{ doignline, "author", 6 }, /* TEXICMD_AUTHOR */
-	{ doinline, "b", 1 }, /* TEXICMD_BOLD */
+	{ doinline, "b", 1 }, /* TEXICMD_B */
+	{ dosymbol, "\\", 1 }, /* TEXICMD_BACKSLASH */
 	{ dosymbol, "!", 1 }, /* TEXICMD_BANG */
 	{ dosymbol, "bullet", 6 }, /* TEXICMD_BULLET */
 	{ dobye, "bye", 3 }, /* TEXICMD_BYE */
@@ -733,6 +734,15 @@ doinline(struct texi *p, enum texicmd cm
 		return;
 	}
 
+	/* 
+	 * If we haven't seen any whitespace, then we don't want the
+	 * subsequent macro to insert any whitespace. 
+	 */
+	if (p->outmacro && 0 == p->seenws) {
+		teximacroopen(p, "Ns");
+		teximacroclose(p);
+	}
+
 	teximacroopen(p, macro);
 	p->seenws = 0;
 	if (TEXICMD_SC == cmd)
@@ -1203,6 +1213,9 @@ dosymbol(struct texi *p, enum texicmd cm
 		break;
 	case (TEXICMD_AT):
 		texiputchar(p, '@');
+		break;
+	case (TEXICMD_BACKSLASH):
+		texiputchar(p, '\\');
 		break;
 	case (TEXICMD_BANG):
 		texiputchar(p, '!');
Index: extern.h
===================================================================
RCS file: /home/cvs/mdocml/texi2mdoc/extern.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -Lextern.h -Lextern.h -u -p -r1.24 -r1.25
--- extern.h
+++ extern.h
@@ -55,6 +55,7 @@ enum	texicmd {
 	TEXICMD_AT,
 	TEXICMD_AUTHOR,
 	TEXICMD_B,
+	TEXICMD_BACKSLASH,
 	TEXICMD_BANG,
 	TEXICMD_BULLET,
 	TEXICMD_BYE,
--
 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:[~2015-03-03 15:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 15:04 texi2mdoc: Account for @item a=@var{foo} and similar by using a `Ns' 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).