From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sIwmGhyv7GE1yQAAgWs5BA (envelope-from ) for ; Sun, 23 Jan 2022 02:27:56 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id cGDqEhyv7GETWwAAG6o9tA (envelope-from ) for ; Sun, 23 Jan 2022 02:27:56 +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 EBC793A4D7 for ; Sun, 23 Jan 2022 02:27:55 +0100 (CET) Received: from localhost ([::1]:60072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nBRfe-0002Ao-JM for larch@yhetil.org; Sat, 22 Jan 2022 20:27:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBRdu-0002AR-Br for emacs-orgmode@gnu.org; Sat, 22 Jan 2022 20:26:06 -0500 Received: from mail.hostpark.net ([212.243.197.30]:39622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBRds-0000O7-Do for emacs-orgmode@gnu.org; Sat, 22 Jan 2022 20:26:06 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id EEA9F163CB; Sun, 23 Jan 2022 02:26:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-type:content-type:mime-version:message-id:date:date :references:in-reply-to:subject:subject:from:from:received :received; s=sel2011a; t=1642901160; bh=JGgTYs7k3zjZseYHZTLqH39l 6NZa1HZIQNlMTDIq8Is=; b=DRzhcgH3HG4m4cVy0uUNfyQnz3GD7Jz635mvCDeO fp8Qo2XanzrEPEnK3SV6yWQOpobf9CD/6W+CfYfdHt3JM7slpE47BgfRpwxBEpAi P+G8TECbuBL9vcsnXJZdU4BOE+kdKmjrg5AfuGaorU//zIqU2Wpeg0sbbtYKfTQh G54= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id FhJGmNU6KJ0q; Sun, 23 Jan 2022 02:26: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 B33BA163D7; Sun, 23 Jan 2022 02:26:00 +0100 (CET) From: Jonas Bernoulli To: Nicolas Goaziou Subject: Re: [PATCH v3 2/3] ox-texinfo: Optionally use @itemx for certain description list items In-Reply-To: <874k5vzswr.fsf@nicolasgoaziou.fr> References: <20211218214038.9459-1-jonas@bernoul.li> <20220118151129.19646-1-jonas@bernoul.li> <20220118151129.19646-3-jonas@bernoul.li> <874k5vzswr.fsf@nicolasgoaziou.fr> Date: Sun, 23 Jan 2022 02:26:00 +0100 Message-ID: <87h79vjl93.fsf@bernoul.li> MIME-Version: 1.0 Content-Type: text/plain 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: 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=1642901276; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=wxvut2ZaOawHLpqYmdBRGcVq3w+juJd+TcckJ0wBdmg=; b=H3xp6i+xak0ITqwdxpaIQjwW9LZFHNymYOM5uVriN5GOMH/SY6AjXt5V1JTUBwg5adr6dC 7qzaXlDuYQj96YJTiim2R0OpPqJWadje7PPFwUXuB/CF7il6K31wcVWVbASuFa7CzCfXJX vkgjDQ/b6TvuJiJ2dTPQ/X7yGoWaPlfP8xZqfzDcTHoIysKbvrMGp9QgK/zlfgPj+mppva SPm0m8lP4FuiXegx1JENCenYxvtDGMRW4o9RW9GJGnRhMOi96LkGUinwaVDYhhFSYVlKgd pNijqh0TgTPgydpHllPepqRGgPLqVP0EdWK4QSe11cp0tfSySam6hJcDL4MLxQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642901276; a=rsa-sha256; cv=none; b=YuZ+JsK6bH4OuOea+N1Lp+9Ckvc/FGQ5n+4Q4ik+VX+2byYGKlktJ7/oIbJo2VC9+Tb8Fx yj9kUu0YerAayTNcmX9Gl/i3TP/ujgxm7JkGXjuSlyyN/PZjHR+Oy1WWlWc/2f9K37eOH5 ptEpfWC7solWSbruLJHTPgJVSFnOfLU4AyxwFb3ajAv9HpWdGr1OpX/mkWVN8iIKsn3DQn BarAv3dygALckrOilHb+NFDtFTyQ/MityZzFTHiQ0jeeaqa+rehhP5XoZOa23TDji3MHzT LeBuUCHHgyy2uf1ikRr+B57BbdHlitA3p0LigCg5MpDhGNUcKeMAMIxZfyLBVA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b=DRzhcgH3; 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.93 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b=DRzhcgH3; 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: EBC793A4D7 X-Spam-Score: -3.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: D+8V1mTeU6A8 Nicolas Goaziou writes: >> #+begin_example >> -,#+ATTR_TEXINFO: :table-type vtable :sep , :indic asis >> +,#+attr_texinfo: :table-type vtable :indic asis :sep , >> - foo, bar :: This is the common text for variables foo and bar. >> #+end_example > > This change is not needed. Org markup is capitalized in examples to make > it stand out. It's not great because 1) it is ugly 2) users may think > Org syntax is uppercase. But changing that is not the point of this patch. Sorry about that; I also don't like it when contributors sneak in cosmetic changes. >> (defun org-texinfo--normalize-headlines (tree _backend info) >> "Normalize headlines in TREE. >> >> -BACK-END is the symbol specifying back-end used for export. >> +_BACKEND is the symbol `texinfo'; the back-end used for export. > > You don't need to document ignored arguments. The argument was already documented before I touched this, and additionally the given name was incorrect. Should I leave this untouched to avoid making unrelated cosmetic changes or should I remove this line? >> +(defun org-texinfo--combine-items (tree _backend info) >> + "Combine certain description list items. >> + >> +_BACKEND is the symbol `texinfo'; the back-end used for export. >> +INFO is a plist used as a communication channel. > > Same as above. This one is an addition so I am dropping it. (The reason I originally added it in the above addition is that I saw it being present here.) >> +If the `:combine' attribute of a description list is non-nil and >> +an item in that list has no body and is followed by another item, >> +then remove the first item and prepend its `:tag' to that of the >> +second item. >> + >> +Such an item that absorbed the tags of other items is later >> +transcoded to one `@item', followed by one or more `@itemx'. >> + >> +Return new tree." >> + (org-element-map tree 'item >> + (lambda (item) >> + (let ((plain-list (org-element-property :parent item))) >> + (when (and (org-not-nil (org-export-read-attribute >> + :attr_texinfo plain-list :compact)) >> + (eq (org-element-property :type plain-list) 'descriptive)) >> + (let ((next-item >> + (cadr (memq item (org-element-contents plain-list))))) > > I suggest to use `org-export-get-next-element', which is not as > low-level as this. Okay changed. In the next commit, in org-texinfo--massage-key-item, I am also using the low-level approach. That function isn't passed INFO, so I am unsure what to do there. Looking at org-export-get-next-element it seems fine to just pass it nil as INFO. >> - (items (and tag >> - (let ((tag (org-export-data tag info))) >> + (items (org-element-property :itemx item)) >> + (items (cond (items >> + (mapcar (lambda (tag) (org-export-data tag info)) >> + (nconc items (list tag)))) >> + ((not tag) nil) >> + (t >> + (setq tag (org-export-data tag info)) > > OK, but I think this is a bit convoluted. I wonder if we need > `org-texinfo--combine-items' at all. I.e., `org-texinfo-item' could > decide to prefix current tag with @itemx if 1) the item is empty 2) the > list has a non-nil :compact attribute 3) there's another item following > it. IOW, we do not need to rely on an :itemx property. I think so, but its bed time. I'll look into it tomorrow. Thanks for the review, Jonas