From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gBozN6l++GEf8AAAgWs5BA (envelope-from ) for ; Tue, 01 Feb 2022 01:28:25 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oFXgM6l++GHRzgAAauVa8A (envelope-from ) for ; Tue, 01 Feb 2022 01:28:25 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9D4A536776 for ; Tue, 1 Feb 2022 01:28:25 +0100 (CET) Received: from localhost ([::1]:32994 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEh1z-0008BR-H2 for larch@yhetil.org; Mon, 31 Jan 2022 19:28:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEgzt-0007ji-Fl for emacs-orgmode@gnu.org; Mon, 31 Jan 2022 19:26:13 -0500 Received: from relay-egress-host.us-east-2.a.mail.umich.edu ([18.219.209.13]:44958 helo=steady-olwen.relay-egress.a.mail.umich.edu) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEgzr-0007AO-7W for emacs-orgmode@gnu.org; Mon, 31 Jan 2022 19:26:12 -0500 Received: from great-leshyi.authn-relay.a.mail.umich.edu (ip-10-0-72-138.us-east-2.compute.internal [10.0.72.138]) by steady-olwen.relay-egress.a.mail.umich.edu with ESMTPS id 61F87E21.E186B.5ABD23E4.1326585; Mon, 31 Jan 2022 19:26:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=relay-2018-08-29; t=1643675169; bh=srZMtPF+35bsNcCBglS7tdr53XW4YQoliVNjM+t7MiY=; h=To:From:Subject:In-reply-to:References:Date; b=iokYHVGjKqkMGwAtOmZPnzhzHUSgL20ntKgvwsFlU9orlP93QB9NmaX6XJbAEs1av rUC0ovujeQ+2OTmd/IEtNJmJEIb54FyA4M/6UbM3Cm37uiIADTKYT6+3hrKs+NdgaL CJq8lDKp8juV0onUkj6CoawQ8tEMMwcPgG/egWWg6to/rvQDG7ZVmYrlT/omqGvj1F NSbrvtQoW560Xtk4SkiLmrC0SierBsJc1lcqF2VXWgU3DAG9q6Z8WtAgHHgxv5X9cK jJJTQTiK8iYczmdtfHrP2VLb3Kr0ih2NoPUA1xAcT6Ycu3VEuxhS+c+mcI5zu7h2sm oYgmdpajp9XAg== Received: from localhost (unknown [216.211.165.46]) by great-leshyi.authn-relay.a.mail.umich.edu with ESMTPSA id 61F87E20.BB985.348D4B75.973619; Mon, 31 Jan 2022 19:26:08 -0500 To: emacs-orgmode@gnu.org From: Greg Minshall Subject: Re: [BUG] bug in 'ox-man? In-reply-to: <2924644.1643637646@apollo2.minshall.org> References: <2924644.1643637646@apollo2.minshall.org> Comments: In-reply-to Greg Minshall message dated "Mon, 31 Jan 2022 06:00:46 -0800." X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 28.0.90 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2997746.1643675130.1@apollo2.minshall.org> Content-Transfer-Encoding: quoted-printable Date: Mon, 31 Jan 2022 16:25:30 -0800 Message-ID: <2997747.1643675130@apollo2.minshall.org> Received-SPF: pass client-ip=18.219.209.13; envelope-from=minshall@umich.edu; helo=steady-olwen.relay-egress.a.mail.umich.edu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1643675305; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=srZMtPF+35bsNcCBglS7tdr53XW4YQoliVNjM+t7MiY=; b=cXLeA8K7BpGcPvR5fwV1dKQkH7LD5a3iXdQOaiuKrfgb5d+5Adv799cH6pqiyEDr2Cgv4V P6kq1E+sXMJZ6XBfMOnl+VQPJGKjQGELzkc/wlTMLvzPmy2IrWeHZHTHgD8bxJpKgO2f9c urU1aNXf56QpGL31Bcq2S6wyfkhi06SGMf5tSvAmewILXQMZ9ARa7KveIUVznExXeIYexS BCd3qRb71LtWclBk+Zso4y+0dOP3KogQixJKq0mQpbhTWbxotgXFzEA4ExqPF0MtuOnBx7 +sD/gjkSE5l6UHqrDKZG/Wg5rG7f0Um8WY+aLzQSAnYFARJAREecpD8E1SP8sw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643675305; a=rsa-sha256; cv=none; b=E2tZVYPcv3Xgvv8pbjsegiCYoUYg6BmXzZrkdvw+0jUpoluSGzBaDXtCf6gbxsa7XMmueI YlwkT10B2c97ThOPZWU0D3aO9XSYqO/fKuXzN+3UyjAjV1fNcYxbTLtw2iSl10/L1kaSQa gU6U4quzVWRRk0E9mTSTdHv4xAeTlg3Li5yeAZpKxLgbVtuVxx3VIjIa9AkWj5PchzpN+n AsitMtCpf861uXER2Jh/i8p5CYFG/2CfGwi1QlqXnFOrlj3YXie571Vs84Iw+r6UFzU2S4 tZyURZcU1yJ3SVCMRm6C1l6W6yE4R9lM6mWFL/NKsLCAZ7oRVoFM9zVuLNTSrA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=umich.edu header.s=relay-2018-08-29 header.b=iokYHVGj; dmarc=pass (policy=none) header.from=umich.edu; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -9.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=umich.edu header.s=relay-2018-08-29 header.b=iokYHVGj; dmarc=pass (policy=none) header.from=umich.edu; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9D4A536776 X-Spam-Score: -9.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: eb2KZEdkDTGt > #+begin_src bash :results output :exports code :eval never-export > echo 'lf "\n"' > #+end_src it seems that `.man` files are in troff(1) format, which uses backslash escapes up the wazoo (however that is spelled). it seems that (one way) to getting a backslash character through troff is representing it as "\e". for my *particular* instance, where the backslash is in an org src block, the below modification to `(org-man-src-block)` may work. presumably one might have backslash sequences in example blocks, or in the main text, or ...? i don't know enough to have any idea if there is some general mechanism that might solve all those. cheers, Greg ---- =46rom 0d0dadc6b4e7f3358612f056a9eb032c1eb4145f Mon Sep 17 00:00:00 2001 From: Greg Minshall Date: Mon, 31 Jan 2022 16:08:35 -0800 Subject: [PATCH] lisp/ox-man.el: escape backslashes from org src blocks --- lisp/ox-man.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ox-man.el b/lisp/ox-man.el index e808edcdf..6eb6b5ff8 100644 --- a/lisp/ox-man.el +++ b/lisp/ox-man.el @@ -748,7 +748,9 @@ CONTENTS holds the contents of the item. INFO is a pl= ist holding contextual information." (if (not (plist-get info :man-source-highlight)) (format ".RS\n.nf\n\\fC%s\\fP\n.fi\n.RE\n\n" - (org-export-format-code-default src-block info)) + (replace-regexp-in-string + "\\\\" "\\\\e" + (org-export-format-code-default src-block info))) (let* ((tmpdir temporary-file-directory) (in-file (make-temp-name (expand-file-name "srchilite" tmpdir)= )) (out-file (make-temp-name (expand-file-name "reshilite" tmpdir)= )) -- 2.34.1 ----