From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sEq6GEKvsGFEVAAAgWs5BA (envelope-from ) for ; Wed, 08 Dec 2021 14:12:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id wGRsFEKvsGHgdwAAbx9fmQ (envelope-from ) for ; Wed, 08 Dec 2021 13:12:34 +0000 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 B2D2535715 for ; Wed, 8 Dec 2021 14:12:33 +0100 (CET) Received: from localhost ([::1]:59388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muwkJ-0002zd-Sr for larch@yhetil.org; Wed, 08 Dec 2021 08:12:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muwhf-0001dV-3B for emacs-orgmode@gnu.org; Wed, 08 Dec 2021 08:09:47 -0500 Received: from ciao.gmane.io ([116.202.254.214]:41486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muwhd-0001r6-1J for emacs-orgmode@gnu.org; Wed, 08 Dec 2021 08:09:46 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1muwhX-00027i-NC for emacs-orgmode@gnu.org; Wed, 08 Dec 2021 14:09:39 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: Raw Org AST snippets for "impossible" markup Date: Wed, 8 Dec 2021 20:09:29 +0700 Message-ID: References: <4897bc60-b74f-ccfd-e13e-9b89a1194fdf@mailbox.org> <87fsrbp673.fsf@gmail.com> <1ef0e093-c165-2a5f-954d-6a33b64c8ee9@mailbox.org> <87r1avgnpi.fsf@localhost> <878rx2bzhw.fsf@nicolasgoaziou.fr> <9525e029-a590-3f48-df64-ffb9176075d9@mailbox.org> <87k0gh68ke.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <87k0gh68ke.fsf@posteo.net> Content-Language: en-US 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: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-2.44, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1638969153; 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=6TPlLB3W2Flf9976PztiPKO/JIsgYGQLbAnuk4FP3YY=; b=H7ZQ4UQMBMqXRUOQ/eoFf3YsEBnCGY0B6iRUiTX6bLodKfZcJhecFjIzI52X+P2ZZUMIE8 FHQVacPFUO3Kws0Oa1NqfqyrUi4pRSQUoTnjjJqKx1p+0GsNtofFgTCcpdDARRDBj3jQw1 KnjcPtxVXPnb4JMMEl0k/e/mND3yW62wsssCML4mslWqYiyfEk7AsltlTIpfwrrbTv6I3y /TCyeKDcp3WqQIsG0esxJr1Ydypri8OKtNp3vgMmdPZYBYD69hZjKCPxhmCJuphAmJ79xe dXEZ0y2PloU7msZhmMjZnvbUO847KFZr0RcYSSLqugs/RMsyZ+TlUPyeGJZH8g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1638969153; a=rsa-sha256; cv=none; b=dKNoW1FQrTrlT/fllZq7mFHtKCe0JNUYlIXvqp2i5pgtCnxDadFcuv166MJUMe7PRa/8VI DDZOanhjqyNwdqCIbm2WGPBEJqiKEg997fgj2QIzbElOIxPA54dfLYSKx70TM+97xmkA9e 7/6L6QN/AsMl1UTLtN87vqs/lfc6cPBJVQUBP3PmwZ3FrC9QJ0gMDY2fZjbGyT1RGi57PA DZApizb3ResqShHyE/QS0aImbwVCYDEWxeUeD6pLxjgvPBR5S8eRuH7vGOKYdXNY34mrpw qpa0FYVnVeW71Eei0OeFq+O5SrYxrPVXE39ID+U7liyO9nm14zcK5TcfaxmMRg== 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" X-Migadu-Spam-Score: -2.35 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" X-Migadu-Queue-Id: B2D2535715 X-Spam-Score: -2.35 X-Migadu-Scanner: scn1.migadu.com X-TUID: TAFqFBx+GcTB On 06/12/2021 22:45, Juan Manuel MacĂ­as wrote: > > I understand that with this method the emphases could be nested, which > it seems also very productive. I like it. > > I would suggest, however, not to use the term 'italics', since is a > 'typographic' term, but a term that is agnostic of format and > typography, something like as 'emphasis' or 'emph'. For example, in a > format agnostic environment like Org, which is concerned only with > structure, an emphasis is always an emphasis. But in a typographic > environment that emphasis may or may not be be in italics. That is why > in LaTeX you can write constructions like: As you have guessed, It is not my choice, it is interface of ox.el and org-element.el. However if you strongly want to use proper terminology in markup, you may try to trade it for +your soul+ compatibility and portability issues. The following almost works: #+begin_src elisp :results silent (defun orgia-link (link-data desc info) (let* ((backend-struct (plist-get info :back-end)) (backend-name (org-export-backend-name backend-struct))) (or (org-export-custom-protocol-maybe link-data desc backend-name info) (let* ((parent (org-export-backend-parent backend-struct)) (transcoders-alist (org-export-get-all-transcoders parent)) (link-transcoder (alist-get 'link transcoders-alist))) (if link-transcoder (funcall link-transcoder link-data desc info) desc))))) (defun evilatex-emph (_emph content info) ;; I have no idea yet why newline is appended. (format "\\textit{%s}%%" content)) (org-export-define-derived-backend 'evilatex 'latex :translate-alist '((emph . evilatex-emph) (link . orgia-link))) #+end_src #+begin_src elisp (let ((org-export-with-broken-links 'mark)) (org-export-string-as "An [[orgia:(italic () \"ex\")]]ample of word and [[http://te.st][link]] [[unknown:prefix][desc]]!" 'evilatex t)) #+end_src #+RESULTS: : An \emph{ex}ample of \textit{inter}% : word and \href{http://te.st}{link} [BROKEN LINK: unknown:prefix]! Actually, I believe that something like orgia-link code should be added by `org-exprot-define-derived-backend' if "link" is missed in translate-alist. I suspect that `org-export-get-all-transcoders' may be avoided. > (setq org-export-global-macros > '(("emph" . "(eval (my-macro-emph $1))"))) Sorry, I have not prepared better variant to solve comma in macro problem yet.