From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id gON7G43yuF8efwAA0tVLHw (envelope-from ) for ; Sat, 21 Nov 2020 10:57:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id +DxtF43yuF8gfwAA1q6Kng (envelope-from ) for ; Sat, 21 Nov 2020 10:57:17 +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 982929401BC for ; Sat, 21 Nov 2020 10:57:16 +0000 (UTC) Received: from localhost ([::1]:35144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgQZu-0006q1-9t for larch@yhetil.org; Sat, 21 Nov 2020 05:57:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgQZO-0006pu-Eo for emacs-orgmode@gnu.org; Sat, 21 Nov 2020 05:56:42 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:56249) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgQZM-0005SX-Ef for emacs-orgmode@gnu.org; Sat, 21 Nov 2020 05:56:42 -0500 X-Originating-IP: 82.65.23.85 Received: from localhost.localdomain (82-65-23-85.subs.proxad.net [82.65.23.85]) (Authenticated sender: bruno@boulgour.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id BE594E0009; Sat, 21 Nov 2020 10:56:35 +0000 (UTC) Date: Sat, 21 Nov 2020 11:56:33 +0100 From: Bruno BEAUFILS To: emacs-orgmode@gnu.org Subject: looking for a macro eval workaround (9.1 vs 9.2 and +) for export backend test Message-ID: <20201121105633.kgwzxc2l6oo5yeau@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="r4ie67twwltp6txy" Content-Disposition: inline Received-SPF: none client-ip=217.70.183.196; envelope-from=bruno@boulgour.com; helo=relay4-d.mail.gandi.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, 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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bruno BEAUFILS Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.61 X-TUID: v3XAG1vvub/h --r4ie67twwltp6txy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I have a *lot* of org files with a macro =3Dif-backend=3D which enables me to decide what to export depending on the backend : #+begin_src org #+macro: if-backend (eval (if (org-export-derived-backend-p org-export-cu= rrent-backend '$1) "$2")) #+end_src For instance, I use it to include =3D\hfill=3D in LaTeX family export engines but not in others (html for instance) : #+begin_src org #+macro: hfill {{{if-backend(latex, \\hfill{} )}}} #+end_src I generally use emacs 26.3 as distributed by Debian bullseyes (which offer org-mode version 9.1.9). On another box I need to work with a more recent org-mode, precisely 9.4. In that environment, due to an incompatible change introduced by [[https://orgmode.org/Changes_old.html#outline-container-org003add6][releas= e 9.2]] the same macro has to be written in a different way : #+begin_src org #+macro: if-backend (eval (if (org-export-derived-backend-p org-export-cu= rrent-backend (intern $1)) $2)) #+end_src And thus I need to change also the macro using it, for instance the =3Dhfill=3D macro has to be written that way : #+begin_src org #+macro: hfill {{{if-backend(latex, \hfill{} )}}} #+end_src For now I need to work on the same files in these two different environment. Do anyone have an idea on how to be able whether to define the =3Dif-backend=3D in a way that it can work in both org versions or if there is a way to define these macro in different ways depending on org version? I would like to let the definitions in org files and not in emacs init files. --=20 Bruno BEAUFILS --r4ie67twwltp6txy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEBBABrHgyEtoGKdzdSG8gcoPQLaAFAl+48mEACgkQSG8gcoPQ LaDiyhAAmgLIU8dBuoHryNy2jnKpFpIzpAvbnkbTM4MTEEE4tRYFShGxLxcYUcBr ro75hvDDDlWLVleZYywXDfjJUoR10OAHPi69MrT93NO3O2e5BLyd7R680iUcCS8B 3Ol+a7cGDi36rSvbe7YFVMELlXIMohhzMkQFCh4hB2mnIIgFnPxxqtBQpdSf5g3H 7d/633Ebk1SuVQZSLWjKyFswf/ezundXboJcXmV9eJZDkITftVJya8zQ006TkuFq hhwGagsX/ElIaazSyq0+Gu17QWk2Xb9XWXItq8VHHKUf2g41C8pwTllwnSlRrsQ0 DbK3XfOYxTA6aO9a3ppNIPabe7pC+4h9FLHUnpI3+i7ux6/F1Uka0ZgV68QcKbJz Vsx5IiTErr2NL9we7HjazIn04uptQejdI40vslmobi339PLpJIm6A3reh4M8+Cr2 TxrShFT6SKGd0N1QL8ZmupQKqmQzEtQzOEfImHnRnY7QIQCv2xkmWSt8iLWF4pEv 3v07D9+/+qEOpmwAifOU6QTxDVqBcLs8gLvi3FO4WkL2OHGHyq3K+rBmhT0YFUPx od2hAKdFoAAxmp4UVN6Yotgy0LvaHBsC7NFPwH2qiXT1sMUxr4V/TvACtYcisFGY P2mP6/8DlcqVtgdipV45E7kGAqBUDNDKwaiMrFKNFRIOIBYrzQg= =7mO/ -----END PGP SIGNATURE----- --r4ie67twwltp6txy--