From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id WH4OL9V29GWDPwAAe85BDQ:P1 (envelope-from ) for ; Fri, 15 Mar 2024 17:27:01 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id WH4OL9V29GWDPwAAe85BDQ (envelope-from ) for ; Fri, 15 Mar 2024 17:27:01 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=pOj8T5aH; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1710520021; 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=A4+m2pvLPgi2+MwWFWVSy1WezwQY5Pcc/EHKbQus2ew=; b=tIzW/FwiS4vFzXzf+85sb+8t59/b4LvT9rmGpDrXJ/tvN4PEzp9JsotgsTcDVUlbSetKPH 1KaZMoV7b4Ut/xWTyahGyVrm+wPJW6R0mjZAVGro5jfCnix73WCD0Ti88st3hPCkXXLfz4 51nk6RDl+dHegNoJqWLHOwrqznz8GY6ktv7Hq/9sxOJnlyBsHLn4ZBuGlxC++fqgtUhQqa i2fznbfA3IRQKk6ITnaZ96JR9xJGnLxiAdzXuRvkp9u9IWgfzJ4QUSzrWx0gAMJIWI4rOq +z4KfQoZFQzhs3oC9bmiM7GRigs3nvPlZNoiKKZ6FU8RPmkoy4v7QSTVeVEWvw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=pOj8T5aH; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1710520021; a=rsa-sha256; cv=none; b=um2fTHdNoGAUVa2Iw7sZz2nB2XF0gm+NrITuKMji7L6jhgboR5R5g3tC9W7oGn0nKDCtiW iHu7PV+H7urYz9bfwY28HJOSBDsCD5vW3oTTePkHlb9E20+NzOMkXjYCc4gy5N3v/a6fRK pgQrHJhZtcBVNKzcU+0jT1u5Jhqf7tSoLST5NqOygy3sdupQnyRrACJn3QVcsjRYjHAlgv fbPcLMNoxCo4uFTymtrjw67oMaRwPUtz4FOKbJZfvo0Q31ipiJ/aNzdb8zsTJAlrE5CfII neJTPSLIwyEFi12PWcd+CZOd+bmJBMfHAyg5BrDmcM1v/AX6oOG5shN9/0VsEA== 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 6DC9416E43 for ; Fri, 15 Mar 2024 17:27:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlAO1-0004Jr-Sk; Fri, 15 Mar 2024 12:26:25 -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 1rlANz-0004Ji-Ge for emacs-orgmode@gnu.org; Fri, 15 Mar 2024 12:26:23 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rlANx-0004lz-7O for emacs-orgmode@gnu.org; Fri, 15 Mar 2024 12:26:23 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D52FD240103 for ; Fri, 15 Mar 2024 17:26:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1710519978; bh=xluJsjfjUVEF6CI4XYCIKbcEiuPTBS+I3V+EqmOMXzo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=pOj8T5aHfN+8M7h4Oy2EUT4J5pfPOAo09UtcuR31czbOIAXxQ7jF1XEwqG1t11qWw 1RtoFsI1m6hSvldpVQ1GnDrJiSuqwJAwNFP5OUNE0qH5/1keWd8FdniMTHcFcntugu GfYO/Hv70f/OME+fMdwuZJ2nPqCJU+K3JqwEFEQ/cLKkg3QYJTafE7rB489Uw0zfii yt4eLj5HAX7oKgwMC9yCZAtU8qXk0Paox921jKXetdn0xbALXilA7X9BgsdgT8IGu8 pKTAk433hTM+zv56eH9zhFQ9mtnUXX+sG25kMP9Cm7MakiZuFChp5aFUKRJ3MC5FnR 4a6Qfy/WuTGOw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Tx8ky2pdXz6tyR; Fri, 15 Mar 2024 17:26:18 +0100 (CET) From: =?utf-8?Q?Juan_Manuel_Mac=C3=ADas?= To: Max Nikulin Cc: emacs-orgmode@gnu.org Subject: Re: `:export' attribute?: Re: Experimental public branch for inline special blocks In-Reply-To: (Max Nikulin's message of "Fri, 15 Mar 2024 17:52:48 +0700") 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> Date: Fri, 15 Mar 2024 16:26:15 +0000 Message-ID: <875xxn4g2g.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=maciaschain@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.17 X-Spam-Score: -9.17 X-Migadu-Queue-Id: 6DC9416E43 X-TUID: BX3TfalNNzwA Max Nikulin writes: > (ignore > (pp > (let ((rules > (org-export--inline-special-block-make-backend-alist > (org-split-string "latex/ html./ ascii+ *")))) > (mapcar (lambda (backend) > (list backend > (org-export--inline-special-block-export-decision > rules backend))) > '(odt latex beamer html md ascii))))) > > Gives > > ((odt content) > (latex nil) > (beamer nil) > (html nil) > (md content) > (ascii full)) > > Function definitions: > > (defun org-export--inline-special-block-make-backend-alist > (rules) > (nconc > (let (result) > (dolist (spec rules) > (if (string-match > > "\\`\\([-_a-zA-Z0-9]*\\)\\(?:\\([/+*]\\)\\|\\([=3D.]\\)\\([/+*]\\)?\\)?\\= '" > spec) > (let ((name (match-string 1 spec)) > (inherit (match-string 3 spec)) > (what (or (match-string 2 spec) > (match-string 4 spec)))) > (push (cons > (if (string-equal "" name) '@ (intern name)) > (cons (or (not inherit) (string-equal inherit "=3D")) > (if what (string-to-char what) ?+))) > result)) > (message "invalid :export specification %S" spec))) > result))) > > (defun org-export--inline-special-block-export-decision > (rules-alist backend) > (when (symbolp backend) > (setq backend (org-export-get-backend backend))) > (let* ((rule (assoc (org-export-backend-name backend) rules-alist)) > (decision (and rule (cddr rule)))) > (while (and (not decision) > (setq backend (org-export-backend-parent backend))) > (setq backend (org-export-get-backend backend)) > (when (and (setq rule (assq (org-export-backend-name backend) > rules-alist)) > rule > (cadr rule)) > (setq decision (cddr rule)))) > (unless decision > (setq rule (assq '@ rules-alist)) > (setq decision (and rule (cddr rule)))) > (pcase decision > (?+ 'full) > (?* 'content) > (?/ nil) > (_ 'full)))) I've been testing your code and it works very well. It is certainly finer than the current approach. I think it could be implemented, and we are testing that. Tomorrow I will make a new commit with your code. --=20 Juan Manuel Mac=C3=ADas -- Composici=C3=B3n tipogr=C3=A1fica, tratamiento d= e datos, dise=C3=B1o editorial y ortotipograf=C3=ADa