From nobody Wed Feb 11 01:26:09 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506959231187981.1753505793381; Mon, 2 Oct 2017 08:47:11 -0700 (PDT) Received: from localhost ([::1]:52915 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz2vz-0001Tm-5w for importer@patchew.org; Mon, 02 Oct 2017 11:47:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz2bd-0007yQ-Kd for qemu-devel@nongnu.org; Mon, 02 Oct 2017 11:26:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dz2bX-0007sh-Kr for qemu-devel@nongnu.org; Mon, 02 Oct 2017 11:26:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54398) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dz2bX-0007rz-Ce for qemu-devel@nongnu.org; Mon, 02 Oct 2017 11:25:59 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8676820272; Mon, 2 Oct 2017 15:25:58 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 164606F985; Mon, 2 Oct 2017 15:25:54 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 8BA8A115626D; Mon, 2 Oct 2017 17:25:52 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8676820272 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=armbru@redhat.com From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 2 Oct 2017 17:25:23 +0200 Message-Id: <20171002152552.27999-4-armbru@redhat.com> In-Reply-To: <20171002152552.27999-1-armbru@redhat.com> References: <20171002152552.27999-1-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 02 Oct 2017 15:25:58 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [RFC PATCH 03/32] qapi2texi: Fix for examples containing '@' X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, mdroth@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instead of quoting example text so that the @example environment shows it verbatim, simply use the @verbatim environment. Examples are no longer indented in output, because makeinfo doesn't indent @verbatim, unlike @example. TODO keep indentation somehow? Signed-off-by: Markus Armbruster --- scripts/qapi2texi.py | 12 +++++------- tests/qapi-schema/doc-good.json | 2 +- tests/qapi-schema/doc-good.out | 2 +- tests/qapi-schema/doc-good.texi | 16 ++++++++-------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py index 92e2af2cd6..1500afc553 100755 --- a/scripts/qapi2texi.py +++ b/scripts/qapi2texi.py @@ -52,13 +52,11 @@ def subst_braces(doc): =20 =20 def texi_example(doc): - """Format @example""" - # TODO: Neglects to escape @ characters. - # We should probably escape them in subst_braces(), and rename the - # function to subst_special() or subs_texi_special(). If we do that, = we - # need to delay it until after subst_vars() in texi_format(). - doc =3D subst_braces(doc).strip('\n') - return EXAMPLE_FMT(code=3Ddoc) + """Format example text""" + return """@verbatim +{code} +@end verbatim +""".format(code=3Ddoc.strip('\n')) =20 =20 def texi_format(doc): diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.j= son index 44098d7f1a..54a0012d5f 100644 --- a/tests/qapi-schema/doc-good.json +++ b/tests/qapi-schema/doc-good.json @@ -117,7 +117,7 @@ # <- out # Examples: # - *verbatim* -# - @at sign BUG: gets passed to Texinfo unescaped +# - @at sign # - {braces} # Since: 2.10 ## diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index b732b81119..a62d2d879c 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -138,7 +138,7 @@ Duis aute irure dolor <- out section=3DExamples - *verbatim* -- @at sign BUG: gets passed to Texinfo unescaped +- @at sign - {braces} section=3DSince 2.10 diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.t= exi index 840a492249..3b77f2f675 100644 --- a/tests/qapi-schema/doc-good.texi +++ b/tests/qapi-schema/doc-good.texi @@ -201,17 +201,17 @@ Ut enim ad minim veniam Duis aute irure dolor =20 @b{Example:} -@example +@verbatim -> in <- out -@end example +@end verbatim =20 @b{Examples:} -@example +@verbatim - *verbatim* -- @at sign BUG: gets passed to Texinfo unescaped -- @{braces@} -@end example +- @at sign +- {braces} +@end verbatim =20 @b{Since:} 2.10 @@ -227,11 +227,11 @@ If you're bored enough to read this, go see a video o= f boxed cats @b{Arguments:} the members of @code{Object} =20 @b{Example:} -@example +@verbatim -> in =20 <- out -@end example +@end verbatim =20 @end deftypefn =20 --=20 2.13.6