From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IHSUCed6+GGSwgAAgWs5BA (envelope-from ) for ; Tue, 01 Feb 2022 01:12:23 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6NcMBud6+GHJGQEAauVa8A (envelope-from ) for ; Tue, 01 Feb 2022 01:12:23 +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 B765111127 for ; Tue, 1 Feb 2022 01:12:22 +0100 (CET) Received: from localhost ([::1]:50128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nEgmS-0007JW-Jz for larch@yhetil.org; Mon, 31 Jan 2022 19:12:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEgMo-0003Mo-PX for emacs-orgmode@gnu.org; Mon, 31 Jan 2022 18:45:54 -0500 Received: from mail.hostpark.net ([212.243.197.30]:45126) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEgMl-0001yl-7A for emacs-orgmode@gnu.org; Mon, 31 Jan 2022 18:45:50 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id D43F616AA9 for ; Tue, 1 Feb 2022 00:45:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-transfer-encoding:mime-version:references:in-reply-to :x-mailer:message-id:date:date:subject:subject:from:from :received:received; s=sel2011a; t=1643672740; bh=vShVH0IU4zq8mF8 EpoXy7/VaSGUF5D3jrGZGixvYRJs=; b=bMOLI5OVcGPlqyDmXqpnqv/0bjsmJs4 Jg/dNh/ymMzINPtkEzs4PtGpKtuto1vyLT6nq6Jg1ByAD/Ogj0TYN+wUJmJgVoqi 7X+dCOOAw6aPlArXX8gFPTNNcp8VI6QP4QNJGG5Xs7tfTGfVOFpQomXSKfboutHe 3pSGEgPfivyA= 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 YNTqM7vshHgc for ; Tue, 1 Feb 2022 00:45:40 +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 X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 9B3BB1652C for ; Tue, 1 Feb 2022 00:45:40 +0100 (CET) From: Jonas Bernoulli To: emacs-orgmode@gnu.org Subject: [PATCH v5 4/4] ox-texinfo: Allow enabling compact syntax for @itemx per file Date: Tue, 1 Feb 2022 00:45:40 +0100 Message-Id: <20220131234540.762181-5-jonas@bernoul.li> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131234540.762181-1-jonas@bernoul.li> References: <20211218214038.9459-1-jonas@bernoul.li> <20220131234540.762181-1-jonas@bernoul.li> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, 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=1643674342; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: 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=45KKP9pEdjdSyRpLcdgZ5G5kGmlbvcd5aT5zwcmfPYU=; b=OjqMwqMlskVH3eHl2onXkzb17LGRfGppzQeBXyx+6qpkKSkNu6CitrdjqfBOwR1AozPe+N zwlXUacOgx4T/HUfzDsO47vaih3sCFeLXSHckPBUtf/S2DgLssWVcTeuRnKkW/FZsWKjnn xbOZ59fnH6riZRDKqXtP3ZYXdCsEZ/xpSsPRoUD9JtNk0/DD5MVf43qTfGItBYiVtAGRzB hdcgY6eGamqOjy75m6qdHOIxNQ8xsBneQETePftDyx1ppYXUbXTzCtoyRFyb7Njj+GHJJb wuuOtWn2gaEdtPeqlnriwtY39gDsM0k5HGHnCgCC0YrxUbsA8JttgGLFotTWkg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1643674342; a=rsa-sha256; cv=none; b=nIIK0YO4Jk1eTur2yIEqWiAu9XadP50oVW+766d1Uis7bCp2kuTCoY3z/NeAvU3Qd1A9ZZ kViAdDLfyEm1sjQYp5pJgCahPIHvGboPUJ2jd6DVTenWGUmbqYt6kwVVHdnh/XLiFyPvYT mTWOOQrOzRdLSXrD8+b681WYX5a9OsgD2f3KO9KLr9cegoSG2tMVjgilBfuoUyVN9T5t5i U7pYVVGRfPowzgHOJwhv4mZ9BZu6yWJjFH5BG79YdhRWjbbenR7hRQxvqcWwSemCpe/zlp BXHxnZVt/8f6Uc3ty8ucFk3eJpfeQx6wBefEG1wSN7hF0rJC/PZBk4vm9s5k2w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b=bMOLI5OV; 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: -2.43 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=bernoul.li header.s=sel2011a header.b=bMOLI5OV; 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: B765111127 X-Spam-Score: -2.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: qVPM9pHFc4qY * doc/org-manual.org (Plain lists in Texinfo export): Document the :texinfo-compact-itemx export option and variable org-texinfo-compact-itemx. * lisp/ox-texinfo.el: Add org-texinfo-compact-itemx to the :options-alist of the texinfo backend. * lisp/ox-texinfo.el (org-texinfo-compact-itemx): New option. * lisp/ox-texinfo.el (org-texinfo--massage-key-item): Add INFO argument and use the :texinfo-compact-itemx export option. * lisp/ox-texinfo.el (org-texinfo-item): Use the :texinfo-compact-itemx export option. --- doc/org-manual.org | 6 +++++- lisp/ox-texinfo.el | 35 ++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/doc/org-manual.org b/doc/org-manual.org index d7d81c1d4..7cd93ab0e 100644 --- a/doc/org-manual.org +++ b/doc/org-manual.org @@ -15307,7 +15307,11 @@ example is transcoded to the same output as above. This is the common text for variables foo and bar. #+end_example -Likewise, the Texinfo export back-end supports two approaches to +Support for this compact syntax can also be enabled for all lists in a +file using the =compat-itemx= export option, or globally using the +variable =org-texinfo-compact-itemx=. + +The Texinfo export back-end also supports two approaches to writing Texinfo definition commands (see [[info:texinfo::Definition Commands]]). One of them uses description lists and is describe below, the other is described in [[*Special blocks in Texinfo export]]. diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 673084859..dba93e318 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -119,8 +119,8 @@ (org-export-define-backend 'texinfo (:texinfo-table-default-markup nil nil org-texinfo-table-default-markup) (:texinfo-text-markup-alist nil nil org-texinfo-text-markup-alist) (:texinfo-format-drawer-function nil nil org-texinfo-format-drawer-function) - (:texinfo-format-inlinetask-function nil nil org-texinfo-format-inlinetask-function))) - + (:texinfo-format-inlinetask-function nil nil org-texinfo-format-inlinetask-function) + (:texinfo-compact-itemx nil "compact-itemx" org-texinfo-compact-itemx))) ;;; User Configurable Variables @@ -355,6 +355,19 @@ (defcustom org-texinfo-format-inlinetask-function :group 'org-export-texinfo :type 'function) +;;;; Itemx + +(defcustom org-texinfo-compact-itemx nil + "Non-nil means certain items in description list are transcoded using `@itemx'. + +If this is non-nil and an item in a description list has no +body but is followed by another item, then the second item is +transcoded to `@itemx'. See info node `(org)Plain lists in +Texinfo export' for how to enable this for individual lists." + :package-version '(Org . "9.6") + :group 'org-export-texinfo + :type 'boolean) + ;;;; Compilation (defcustom org-texinfo-info-process '("makeinfo --no-split %f") @@ -614,7 +627,7 @@ (defun org-texinfo--separate-definitions (tree _backend info) (org-texinfo--split-definition plain-list item cmd args)) (t (when args - (org-texinfo--massage-key-item plain-list item args)) + (org-texinfo--massage-key-item plain-list item args info)) (push item items))))) (unless (org-element-contents plain-list) (org-element-extract-element plain-list))))) @@ -663,7 +676,7 @@ (defun org-texinfo--split-plain-list (plain-list items) (mapc #'org-element-extract-element items)) plain-list)) -(defun org-texinfo--massage-key-item (plain-list item args) +(defun org-texinfo--massage-key-item (plain-list item args info) "In PLAIN-LIST modify ITEM based on ARGS. Reformat ITEM's tag property and determine the arguments for the @@ -674,7 +687,9 @@ (defun org-texinfo--massage-key-item (plain-list item args) non-nil and ITEM has no content but is followed by another item, then store the `@findex' and `@kindex' values in the next item. If the previous item stored its respecive values in this item, -then move them to the next item." +then move them to the next item. + +INFO is a plist used as a communication channel." (let ((key nil) (cmd nil)) (if (string-match (rx (+ " ") @@ -701,8 +716,9 @@ (defun org-texinfo--massage-key-item (plain-list item args) (setq kindex (nconc kindex (list key)))) (cond ((and next-item - (org-not-nil - (org-export-read-attribute :attr_texinfo plain-list :compact)) + (or (plist-get info :texinfo-compact-itemx) + (org-not-nil + (org-export-read-attribute :attr_texinfo plain-list :compact))) (not (org-element-contents item)) (eq 1 (org-element-property :post-blank item))) (org-element-put-property next-item :findex findex) @@ -1138,8 +1154,9 @@ (defun org-texinfo-item (item contents info) (let* ((tag (org-element-property :tag item)) (plain-list (org-element-property :parent item)) (compact (and (eq (org-element-property :type plain-list) 'descriptive) - (org-not-nil (org-export-read-attribute - :attr_texinfo plain-list :compact)))) + (or (plist-get info :texinfo-compact-itemx) + (org-not-nil (org-export-read-attribute + :attr_texinfo plain-list :compact))))) (previous-item nil)) (when (and compact (org-export-get-next-element item info) -- 2.35.1