From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id qHjhBzj5iWWWyQAAkFu2QA (envelope-from ) for ; Mon, 25 Dec 2023 22:50:48 +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 0NNPAjj5iWWdRgEAqHPOHw (envelope-from ) for ; Mon, 25 Dec 2023 22:50:48 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1703541047; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=5u9pFwdI4rX0GFec9Lx1v992EzuMH42fAZWyazsEAK0=; b=ETni1f4RATYhRe0VaIBiOgw//d1S2juUF58uTd5BdWhzpAaG2olwobyAcSWaDr8bjI+Vvx WfqzM0O3Yz49e9rRNcotfZ317M109rQ4CmWVot0CVT0RFmVJ2hO/qrX519k7Izk5DeA7ZR zK95SZXK041b2K5RYOn9nqTb9tDUCQkSpuxb0WOd6kb44UKr4EfILX37xRqhyeKqwVKWs0 lL6pHtP6CXrXLq0I2rw6KvqnZJUvZ6Fo9w7Qzkb2cr3Gt8csqwO57ULBocLivl1RiXYcz6 swOesi7MJKbikMszeEpnJkKNSh64W+qpDRXHe/sFZu0C/QEbTSD3MjsxTe521A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1703541047; a=rsa-sha256; cv=none; b=OWpsUgwbuTDR1kMRxOCRRsebI/I5IZyg8YJYKUOEs+UwYBTvmZvnpZKLJa3Ahnuu8HNymh WGjW5m2vs+vq+2eD6C2YXczI4Hj9BamDw9w9Q/2XUQYnwdg1aKt1wAc0ScJu9eSo1479gm hCa2iblJLoMr95H2c6kBPNW/UBgUczWw1adgnGY0mSzI828eXKJSo5EXMTbUUaU2Ol8mT5 COJlrPLoP7moxzVFxxStIp+DdubMfl34pWOOgVgG5sJY0Krhfq8tIaoGwW9CQEZbFCxMwQ v6oIn0aeHwwABpTCBaUveomg4Jq8okjljRg7UM/GadIdEupy9IfAeoWPhFXtxg== 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 D81AF65A29 for ; Mon, 25 Dec 2023 22:50:47 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rHspV-0004Qm-3d; Mon, 25 Dec 2023 16:49:45 -0500 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 1rHspT-0004QH-2P for emacs-orgmode@gnu.org; Mon, 25 Dec 2023 16:49:43 -0500 Received: from phubs.tethera.net ([2607:5300:60:3a9d::1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rHspR-0007qX-67 for emacs-orgmode@gnu.org; Mon, 25 Dec 2023 16:49:42 -0500 Received: from tethera.net (node-1w7jr9sq6r285hb4jzty0djso.ipv6.telus.net [IPv6:2001:569:bbf1:a00:6170:61c6:96ed:fd78]) by phubs.tethera.net (Postfix) with ESMTPS id AA8BB180066 for ; Mon, 25 Dec 2023 17:49:36 -0400 (AST) Received: (nullmailer pid 1460824 invoked by uid 1000); Mon, 25 Dec 2023 21:49:34 -0000 From: David Bremner To: emacs-orgmode@gnu.org Subject: custom function for org-babel src block export Date: Mon, 25 Dec 2023 13:49:34 -0800 Message-ID: <87r0jagdg1.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:5300:60:3a9d::1; envelope-from=david@tethera.net; helo=phubs.tethera.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, 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-Spam-Score: -3.86 X-Spam-Score: -3.86 X-Migadu-Queue-Id: D81AF65A29 X-Migadu-Scanner: mx10.migadu.com X-TUID: RmRtisbVGs19 I am generating slides using org-beamer. I would like certain code blocks to export as links containing URL-encoded content of the block. As an example I would like the following block #+begin_src stacker (defvar x 1) (deffun (f) (defvar y 2) (deffun (h) (+ x y)) (h)) (f) #+end_src would be exported as something like \href{https://www.example.com/stacker/?program=%28defvar%20x%201%29%0A%28deffun%20%28f%29%0A%20%20%28defvar%20y%202%29%0A%20%20%28deffun%20%28h%29%0A%20%20%20%20%28+%20x%20y%29%29%0A%20%20%28h%29%29%0A%28f%29}{execute on stacker} I can do the encoding easily enough (see end), but I did not see a way of hooking that up to org-babel, while retaining the ability to also use minted or listings for other blocks. I need the ability to use noweb expansion, so using a custom block type seems unattractive (at least at first glance). ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar stacker-base "\href{https://www.example.com/stacker/?program=%}{execute on stacker}") (defun db-stacker-link (prog) (format stacker-base (org-link-encode prog '(?? ? ?( ?) ?\n))))