From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QLl/LOqBZmG/bAAAgWs5BA (envelope-from ) for ; Wed, 13 Oct 2021 08:51:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id gK4hKOqBZmFadgAAB5/wlQ (envelope-from ) for ; Wed, 13 Oct 2021 06:51:22 +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 1F6AE19A31 for ; Wed, 13 Oct 2021 08:51:22 +0200 (CEST) Received: from localhost ([::1]:37996 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1maY6j-0003BH-7d for larch@yhetil.org; Wed, 13 Oct 2021 02:51:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1maY5z-0003B4-70 for emacs-orgmode@gnu.org; Wed, 13 Oct 2021 02:50:35 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:43895) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1maY5x-0006gk-K9 for emacs-orgmode@gnu.org; Wed, 13 Oct 2021 02:50:34 -0400 Received: by mail-lf1-x132.google.com with SMTP id r19so7131753lfe.10 for ; Tue, 12 Oct 2021 23:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=sJeMCPw0rJBfTAxmmOcViEUutv5ce7McqIu++/GlSp4=; b=Q1JdnZqreg9LTZCUQG2B8JU8Ew+5Z9+I0josjDhQ9DWty5lH//mOAy+lwJ6B6k/YNS ohcaA1DEWGy8TZGevO30jeb1C+a+2gq9lcUtZFpQNBIBbhoBy830f2wUczbhHx+TM/iu vQxr8ksz4hM6WIeLCHEb3xFOWrkknJrktFLJxiPCGfeFzXgxe8O+NUl4DtV4oI/xaOdn x9bwFpUlsPthckdvibE3TWAeP+OA9ixz7iCAV/lcyt5GFX/vzYt3pTBM9wtgahLA6BJl fR+wTjwHRZWXDQ1ueDd78nsiJsGh+brrx4osaX4VDB/r68DfXWjMVV5sAajfTVNqziTb lkZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=sJeMCPw0rJBfTAxmmOcViEUutv5ce7McqIu++/GlSp4=; b=rb85nvWgd4vhjHf/VI4/ujorBeznNDAIIUDrkAg+e7EOoEokfP01G06+1vRTLUdpt6 hnBd8Ifj9iwgErOwhjFfo+KedP4FF6SLKDVju2Pl1xgUD0kL5PkYXcIfLOnFKaIzZILp 8n9ZPosmHVqHs0znnGLfwHdCW54s95vXa7LwF2GRt4/OJmCGSXIOaIwk4op7ViIvauzj wIkEvFqoY8XkbmpdWJQ00FhiY+QIxmmTKF2o7neEXSwgS84FjS1J09j/Y+XU5zr59jsb zoM8HgzWb8ojMlZiOKy7m0gHGTG9kO87bu8Tlq+0T7Gto0bmOvFJ3R+XyZwtH6JT54Xm 1urA== X-Gm-Message-State: AOAM533ST3E+g0pw89UQjr4l4Ky1PDbwfEvC/MEtTZUJ+Yf/nsUmSo2I zJpQDRinl2JNvAe+F0bamqQ= X-Google-Smtp-Source: ABdhPJygAQVEGX18nqvxFb09N1Vv8kz6PSY4ddZwSuxMe/9QHRKQWk0ccgNTquxRQCxyTwXb+6CfLA== X-Received: by 2002:a05:6512:4020:: with SMTP id br32mr18415556lfb.569.1634107831448; Tue, 12 Oct 2021 23:50:31 -0700 (PDT) Received: from localhost ([91.210.107.150]) by smtp.gmail.com with ESMTPSA id x1sm876543lfr.83.2021.10.12.23.50.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Oct 2021 23:50:31 -0700 (PDT) From: Ihor Radchenko To: Jason Ross Subject: Re: Best way to include METAPOST in ConTeXt exporter In-Reply-To: References: <87wnmtb2sb.fsf@localhost> <87o884buwf.fsf@localhost> Date: Wed, 13 Oct 2021 14:51:49 +0800 Message-ID: <87ily1s9h6.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=yantar92@gmail.com; helo=mail-lf1-x132.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-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: emacs-orgmode@gnu.org 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=1634107882; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=sJeMCPw0rJBfTAxmmOcViEUutv5ce7McqIu++/GlSp4=; b=DdFACAB2CV6GmaehKyRsotBiR07t+w7hmXqJrauquT15es+Eo+D6wg4UKC+MtW0BJpFVzK LWNdMaZNg+Bggo5uwDLOA81+RfBoZwcLiJJJm3zu5uMzOKOhG6VS/lalStAxfIs9lc4+l+ HEir4x4kp7wY98NzLBpr2n2WaJHK3eNa2raggHwuhOZdBDl17sgtYpNQRSWsKVJ0bcwMI9 Re6os3yyYyd9BBajBdb5pZ+UQeahZGCZqp3a+nH6XCN6cwrr52EB+POIpIIPXmjG7q2R18 bLdoPnOQF/5S6OCFmJ96IZ6/tXFwDv0swUjJfdBspmOWyBs4Luu4PMBb8IFfIw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1634107882; a=rsa-sha256; cv=none; b=j1h2lYvRTQ+yj/MVMef6B4s43EAaHe9V63aD35MkPR41SVRm7TLynzY3JXrVHgh1P0Kxzy 6A2yTlr5t/xSNguJqUFOcDHhgks9y0JeHyXjh+hTVPwC35LewVVwCnRFRDYT8gi3VF2u78 mfyk6q49Zdpe8ceHQdD1Yno0Nc6mHrc6WL77fGcQIlfu2KVO1eDd29AzgopZtG+1/U+jHV 8rOsaqqaZ/p3N51+hj2mv9FTG+knMcFrfLRWuR6M5HX4ehel/ypIWWQxBHqZ168Kgf2S47 U0BtN4hzngJA53jYnK+eGSmCTdD/C9df6DkswnrkmWEtzjwZze6ZZTtV62MOjQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q1JdnZqr; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Spam-Score: -2.61 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q1JdnZqr; dmarc=pass (policy=none) header.from=gmail.com; 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-Migadu-Queue-Id: 1F6AE19A31 X-Spam-Score: -2.61 X-Migadu-Scanner: scn0.migadu.com X-TUID: 2F7jnUCYYvGu Jason Ross writes: > Here's a hook that modifies the source blocks to wrap their > output in #+BEGIN/END_METAPOST tags if the ConTeXt backend is used, > before Org Babel gets to them, but otherwise leaves them alone. > > I wonder if anyone has any better ideas of how to do this. I'm > modifying the Org source with the hook before the document gets parsed > so that it can be more backend-agnostic but it seems like it would > be better if there was a way to modify the document parse tree > directly instead. I don't like that I'm effectively parsing and > rebuilding (hopefully) the same string in order to change the :result > type. I am not sure if there is an easy way. ob-exp gets run before backend filters and you do not yet have access to the document parse tree. You may consider a patch for ob-exp to get better control over code execution during export. Best, Ihor