From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:306:f42::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uJPnMDIBymEiWAEAgWs5BA (envelope-from ) for ; Mon, 27 Dec 2021 19:08:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id iOGaLTIBymH3XgAAauVa8A (envelope-from ) for ; Mon, 27 Dec 2021 19:08:50 +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 6B7181BE53 for ; Mon, 27 Dec 2021 19:08:49 +0100 (CET) Received: from localhost ([::1]:60818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1uQS-00013q-Au for larch@yhetil.org; Mon, 27 Dec 2021 13:08:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:48328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1uMw-00013L-Ts for emacs-orgmode@gnu.org; Mon, 27 Dec 2021 13:05:11 -0500 Received: from mail.hostpark.net ([212.243.197.30]:33140) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1uMu-0001Xz-Bm for emacs-orgmode@gnu.org; Mon, 27 Dec 2021 13:05:10 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 835E2165C5; Mon, 27 Dec 2021 19:05:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:references:in-reply-to:subject:subject :from:from:received:received; s=sel2011a; t=1640628300; bh=TcTR1 Uzqa4W5mLO1bA/15RDNZQ9Eh2CAQMpeqBxZImw=; b=zb15zdPp/yf2dnZUoIsvV sjKUg+fH3VhFy9QKGDqgyrb/NDGUY//cmQjWfci204+Q8W8i5NQfOlbxXIBmdXJc 2dPdSDgBthysCMLkXQIYJJHHe8FBWnS8kBzu7e/iRLqJN8UhvDSXH+2PteLZAiPl KAnOBdrBrWGyzQJ3PfZ2Ls= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id 20lrpFGuvbrX; Mon, 27 Dec 2021 19:05:00 +0100 (CET) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 5261F165AF; Mon, 27 Dec 2021 19:05:00 +0100 (CET) From: Jonas Bernoulli To: Nicolas Goaziou Subject: Re: [PATCH 1/2] ox-texinfo: Turn a description list item with "+" bullet into @itemx In-Reply-To: <87wnjr9he9.fsf@nicolasgoaziou.fr> References: <87pmqhmvg1.fsf@bernoul.li> <20211218214038.9459-1-jonas@bernoul.li> <20211218214038.9459-2-jonas@bernoul.li> <87wnjr9he9.fsf@nicolasgoaziou.fr> Date: Mon, 27 Dec 2021 19:05:00 +0100 Message-ID: <87zgol7wkz.fsf@bernoul.li> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: none client-ip=212.243.197.30; envelope-from=jonas@bernoul.li; helo=mail.hostpark.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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: , Cc: kyle@kyleam.com, emacs-orgmode@gnu.org 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=1640628530; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=QN0dCW8wbwIPwnwYp9zKIAXpjce26ENZ+fnDVrR4eng=; b=gGfqfjnl2gYiFYACNkJsGvY3Vx9FKYK10tCNkskSD+Cg06osMpGqZWdOBdYB4qlSA86Kml O27GZK94TPtLyZknxX+E+ua0RZ0j96TEewCk3o3VxO+qfY9/QiPtDwSy7qvd2VpMXKf0DP cLFYoxDf82f623AXb8SnOoXO7KRWzFoiu79xMKK5NsRNMtC9sSOYdvYSKFVPQlJpoICial PReD5l3VyT+Yl8Eubm9t52o5VI7cKTi8v+5xFdFr0je97aziAkJQa468gE5LoG7JMYWxGs f9+W+rsNCE68OrLQS3qR8bYIQjjiR2ZwhXD+PJA/+LojM1uDz8WZuv6dpRYNLQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640628530; a=rsa-sha256; cv=none; b=aZPBMyRmd9zLWQdXecT7YSd+vszOHst3mHXhlz5fm2vmXC1rEgs/M6YlX1lVxMSTSnd3dY 8huWwLuIW/5+WIuCA6G92/jC9vKJ/g4n/MtZqIwPy6/TjaiFSyyjGFbkjFcyOGRPiqZQh1 Oqic2Q+H061yrY5S6VOI+oslHDEesQ4V/x4LqAjWmIz9d7IqXDmDi/6cleNwvp8/MJlGkl 1/22Wo+SDLHQ6uDhNGg4jcddIKQvjExKsYJboumVQP7kqC/poeEaOqp4JuNYq9wxDxUOgY kMc8YBeS2OSydXDcSbj1iKEXYFfwQuwVaUcUzpOoFZMYOZiKA5+Ev8o0pXxdPQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b=zb15zdPp; dmarc=none; 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: -3.87 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b=zb15zdPp; dmarc=none; 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: 6B7181BE53 X-Spam-Score: -3.87 X-Migadu-Scanner: scn1.migadu.com X-TUID: W3kEZgTSu/Wx Nicolas Goaziou writes: > Hello, > > Thanks. Some comments follow. Thanks for the review! > Jonas Bernoulli writes: > >> +In description lists the used bullet is significant when exporting to >> +Texinfo; when in doubt, then use =3D-=3D. An item that uses =3D+=3D in= stead >> +becomes a new entry in the first column of the table. The above >> +output can also be produced with: >>=20=20 >> #+begin_example >> -#+ATTR_TEXINFO: :enum A >> -1. Alpha >> -2. Bravo >> -3. Charlie >> +,#+attr_texinfo: :table-type vtable :indic asis >> +- foo :: >> ++ bar :: >> + This is the common text for foo and bar. >> #+end_example > > The above is fragile, because pressing on an item will > "repair" the bullets. Therefore, you cannot support mixed bullets in the > same list. The alternative also isn't great (see below). I vaguely remember having run into this feature before when using Org to record a pros and cons list. As a maintainer I don't like this question but; could this feature be made optional? (Of course one could use tags to indicate whether an item is a pro or cons, but for such a simple use- case that seems more work than necessary and less immediately obvious.) >> *** Tables in Texinfo export >> diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el >> index b0125894a..35862357d 100644 >> --- a/lisp/ox-texinfo.el >> +++ b/lisp/ox-texinfo.el >> @@ -418,6 +418,11 @@ (defun org-texinfo--filter-section-blank-lines (hea= dline _backend _info) >> "Filter controlling number of blank lines after a section." >> (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" "\n\n" headline)) >>=20=20 >> +(defun org-texinfo--filter-parse-tree (tree backend info) >> + "Normalize headlines and items." >> + (org-texinfo--normalize-headlines tree backend info) >> + (org-texinfo--normalize-items tree info)) > > Could you expound the docstring? Arguments are missing, and "normalize" > is vague. This bothered me a bit too when writing it but at the same time it seemed like overkill to replicate the docstrings of the called functions. How do you feel about using a hook instead? (defvar org-texinfo--filter-parse-tree-functions '(org-texinfo--normalize-headlines org-texinfo--normalize-items) "List of functions the `texinfo' back-end applies to the parsed tree. Each filter is called with three arguments: the parse tree, as returned by `org-element-parse-buffer', the back-end, as a symbol, and the communication channel, as a plist. It must return the modified parse tree to transcode.") Do you prefer to add the hook functions as done above or should each one be added individually using add-hook? >> + (org-element-map tree 'plain-list >> + (lambda (plain-list) >> + (when (eq (org-element-property :type plain-list) 'descriptive) >> + (let ((contents (org-element-contents plain-list))) >> + (while (setq item (pop contents)) >> + (let ((next-item (car contents))) >> + (when (and next-item >> + (equal (org-element-property :bullet next-item= ) "+ ")) > > The above will fail if `org-list-two-spaces-after-bullet-regexp' is > non-nil. You should compare the trimmed bullet with "+". Done. Is this okay?: (when (and next-item (string-prefix-p "+" (org-element-property :bullet next-item))) Or should the line-breaks go elsewhere? > Anyhow, relying on mixed bullets is not great=E2=80=A6 The alternative isn't great either. For example: - Key: C-c C-w (forge-browse-TYPE) :: + Key: C-c C-w (forge-browse-dwim) :: + Key: N b I (forge-browse-issues) :: + Key: N b P (forge-browse-pullreqs) :: + Key: N b t (forge-browse-topic) :: + Key: N b i (forge-browse-issue) :: + Key: N b p (forge-browse-pullreq) :: These commands visit the topic, issue(s), pull-request(s), post, branch, commit, or remote at point in a browser. ... vs. - Key: C-c C-w (forge-browse-TYPE), C-c C-w (forge-browse-dwim), N b I (for= ge-browse-issues), N b P (forge-browse-pullreqs), N b t (forge-browse-topic= ), N b i (forge-browse-issue), N b p (forge-browse-pullreq) :: These commands visit the topic, issue(s), pull-request(s), post, branch, commit, or remote at point in a browser. ... I am sure I am gonna make mistakes when using the latter approach. Cheers, Jonas