From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id GJRvDNSn9WUmfQEAqHPOHw:P1 (envelope-from ) for ; Sat, 16 Mar 2024 15:08:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id GJRvDNSn9WUmfQEAqHPOHw (envelope-from ) for ; Sat, 16 Mar 2024 15:08:20 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710598100; a=rsa-sha256; cv=none; b=bp3ibNLhjbJCBKzfVP+ZU7zlWjcmnp7dRRn4e8pwanmxULWU6e3aV52yIie5jsnLk5+pnO kmZiAIdlocda8GXTgFjE5Tvn1CxjC/oW5kl7cWRfC8SFSwBz+Mu+dVXBO8n/9Si7Fb3Ygc h+9o0l/95ofG0B2YNRLQ3H8Z1kYBBDI5vQ6GMPQCQGV6xXEN4LFXaJgyEEqemZH+Ky/Pqe 1hYnLIqzmQA88BPpv2W9li+3xG/0Is+ZqCbIqaj3kZiBvYRy2mYTphGRJG5lL1ei2RNU4A 9RAPWzzN1dAmSKCzYniEy6PhZE6LoBcVUKxlTTbiQlNMDV1C9ru5k1wVNGAI/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710598100; 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; bh=dbGh+Ugfme0wwNimx4EOiGmicCcgg3g3yiVgwf7ag9E=; b=nOXYDsYGCxW1Q/jO3TcihJ6tC26M0prdtQq/MSkgF8n4XG4WlQKhzhFc6IKE0+++/hipfc A1ZCFpPx03n1709yYCMnZ5V0KZM7uPzhAGe9wmrjyfVKQI7pzJD5vG68tM3taEiyE/got/ uMLNuLIy6Zrvh3qijkPltPWtQzzM8DGo+6RmDQ3Yi67mGpz2goVOAFad+DUYzsPgLu3lFV x0C4eGp1DYdmqWY9gaNorLljPW+lhRkJBh7wlKuNSO/8fzzlYptVmCnRGroFwiVBdF7e8I 1fYQ4kf7qFYm2k6UJ4j0NYtHOGDxJY+7YkXqD/X4H8X5ZrWvqaph0fxgCR+aXQ== 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 042E077159 for ; Sat, 16 Mar 2024 15:08:20 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlUhC-0005Tt-Sk; Sat, 16 Mar 2024 10:07:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlUhB-0005Tc-N4 for emacs-orgmode@gnu.org; Sat, 16 Mar 2024 10:07:33 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlUhA-00074p-Ee for emacs-orgmode@gnu.org; Sat, 16 Mar 2024 10:07:33 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rlUh6-0004lG-Vk for emacs-orgmode@gnu.org; Sat, 16 Mar 2024 15:07:28 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: `:export' attribute?: Re: Experimental public branch for inline special blocks Date: Sat, 16 Mar 2024 21:07:23 +0700 Message-ID: References: <87wmql6690.fsf@posteo.net> <87cysb2h68.fsf@posteo.net> <877ciavnwo.fsf_-_@posteo.net> <87bk7k7tuf.fsf@posteo.net> <87wmq85xn9.fsf@posteo.net> <877ci7bm2b.fsf@posteo.net> <87y1an9wkj.fsf@posteo.net> <87il1qm61y.fsf@posteo.net> <87edcem4rw.fsf@posteo.net> <87wmq4me2k.fsf@posteo.net> <875xxn4g2g.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla Thunderbird Content-Language: en-US, ru-RU In-Reply-To: <875xxn4g2g.fsf@posteo.net> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 26 X-Spam_score: 2.6 X-Spam_bar: ++ X-Spam_report: (2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 1.12 X-Spam-Score: 1.12 X-Migadu-Queue-Id: 042E077159 X-TUID: 9mWAA+dKAw+e On 15/03/2024 23:26, Juan Manuel MacĂ­as wrote: > Tomorrow I will make a new commit with your code. An update with a couple of bugs fixed. Now it is possible to specify different export rules for a backend and all its derivatives: (ignore (pp (let ((rules (org-export--inline-special-block-make-backend-list (org-split-string "latex/ html./ html+= ascii+ *")))) (mapcar (lambda (backend) (let ((hierarchy (org-export--backend-hierarchy backend))) (list backend (org-export--inline-special-block-export-decision rules hierarchy)))) '(odt latex beamer html md ascii))))) ((odt content) (latex nil) (beamer nil) (html nil) (md full) (ascii full)) ---- (defun org-export--inline-special-block-make-backend-list (rules) (let (result) (dolist (spec rules) (if (string-match "\\`\\([-_a-zA-Z0-9]*\\)\\(?:\\([/+*]\\)\\([=.]\\)?\\|\\([=.]\\)\\([/+*]\\)?\\)?\\'" spec) (let ((name (match-string 1 spec)) (inherit (or (match-string 3 spec) (match-string 4 spec))) (what (or (match-string 2 spec) (match-string 5 spec)))) (push (cons (if (string-equal "" name) '@ (intern name)) (cons (or (not inherit) (string-equal inherit "=")) (if what (string-to-char what) ?+))) result)) (message "invalid :export specification %S" spec))) (nreverse result))) (defun org-export--backend-hierarchy (backend) "Result may be cached in INFO." (let ((hierarchy)) (when (not (symbolp backend)) (setq backend (org-export-backend-name backend))) (while backend (push backend hierarchy) (setq backend (org-export-backend-parent (org-export-get-backend backend)))) hierarchy)) (defun org-export--inline-special-block-export-decision (rule-list hierarchy) (let ((hierarchy (cons '@ hierarchy)) (decision ?+)) (while (and hierarchy rule-list) (let* ((rule (pop rule-list)) (tail (memq (car rule) hierarchy))) (when (and tail (or (not (cdr tail)) ; Current backend. (cadr rule))) ; Inherits. (setq hierarchy (cdr tail)) (setq decision (cddr rule))))) (pcase decision (?+ 'full) (?* 'content) (?/ nil) (_ 'full))))