From: kristaps@mdocml.bsd.lv
To: source@mdocml.bsd.lv
Subject: texi2mdoc: Account for @item a=@var{foo} and similar by using a `Ns'
Date: Tue, 3 Mar 2015 10:04:54 -0500 (EST) [thread overview]
Message-ID: <13959896329447406101.enqueue@fantadrom.bsd.lv> (raw)
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
reply other threads:[~2015-03-03 15:04 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=13959896329447406101.enqueue@fantadrom.bsd.lv \
--to=kristaps@mdocml.bsd.lv \
--cc=source@mdocml.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).