From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 0EeILdhhS2WaZgAAG6o9tA:P1 (envelope-from ) for ; Wed, 08 Nov 2023 11:24:24 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0EeILdhhS2WaZgAAG6o9tA (envelope-from ) for ; Wed, 08 Nov 2023 11:24:24 +0100 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 85191502E0 for ; Wed, 8 Nov 2023 11:24:24 +0100 (CET) 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=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699439064; 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=e90nO1J1p6v33WgoEJdZXdh7LkmQi6xxcl4cgP1zhBU=; b=JgHLlCp3XjNl5dPP66MtgHeMlC4IWDnkz2ZDxlkARNoc9Mbma0QTuFyJLlZDXY7ASKA/q1 evWF9c8+b2p82nTeH909W17DJJ222b/3e//HepNlsNOpseAr62bEBRz+yAOjQemO9iJn1m gx6OcO4KeExdVEkjVsvKBuDABfSL0zNd+V0XkmHbDatkIE+RFVDW6xVUR2OSuqZtza618y wqb6LCpOCy8LSDau5l+0zUdEq+r93WCSU+WlDs04SyPE8+gS8++ybx6O/aUzKl5AIgFxWe dFidCVQ8NiwXkJfdvY+Q5S3ZTfWhhtsGD5edTIrrFNKtBJO7Coqyk5Xkzghx9g== 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=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699439064; a=rsa-sha256; cv=none; b=BSRBGbcZIIUXw47zczgXcJAZ2xyn+1R03szKmAa7WCfrCJ6WRpaYUlybN7yYbbbaSt79Nm o97GYy2Ll4y5M7u/cXZj05XZauJWI2ka1bFa/NVHCz2gsgOEZovv0GcxuFPPrAoIdrdR5P Jf2ORHPEvXobxlMSH3qaa4+un+PSzHJIp86N0EFVzHAktxyfaORcAztDnM7oBucopCo7XY swyh5S1IbdEwb3N9k2pyAQ/yt0O8PdPo4EyKo1gmSH18pwmV4pheGpOCedSXH7HuaHx+OE MBGc0VizSC89p+O/OrLsoQ0szrYkN6p+sUfXH3YWaWuG/itR2u5bKiwsXgFHjg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r0fil-0004Db-0v; Wed, 08 Nov 2023 05:23:39 -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 1r0fii-0004DC-Rr for emacs-orgmode@gnu.org; Wed, 08 Nov 2023 05:23:36 -0500 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r0fif-00076C-CX for emacs-orgmode@gnu.org; Wed, 08 Nov 2023 05:23:34 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1r0fid-00098i-Df for emacs-orgmode@gnu.org; Wed, 08 Nov 2023 11:23:31 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: [RFC][PATCH v2] Allow to export to ascii custom link types as notes Date: Wed, 8 Nov 2023 17:23:18 +0700 Message-ID: References: <874jijaukf.fsf@localhost> <8734y1aeae.fsf@localhost> <87lebt8rrm.fsf@localhost> <87v8ad29n2.fsf@localhost> <87il6d22rr.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla Thunderbird Content-Language: en-US, ru-RU In-Reply-To: <87il6d22rr.fsf@localhost> 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: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 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, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.60 X-Spam-Score: -0.60 X-Migadu-Queue-Id: 85191502E0 X-Migadu-Scanner: mx13.migadu.com X-TUID: pjNGlXMY2eAf On 07/11/2023 18:58, Ihor Radchenko wrote: > Max Nikulin writes: > >>> (funcall protocol path desc backend info *link-object*) >> >> It would require another iteration with `condition-case' to deal with >> functions having old signature. > > Is it a problem? Performance for large projects like Worg. > We can alternatively check function arity. 5 unnamed arguments for functions that are supposed to be implemented by users looks rather close to a border when it becomes fragile. The language does not enforce type checking for user-supplied functions and users would not bother as well. Multi-argument functions was a painful experience with FORTRAN for me (fortunately I was not deeply involved). >> Earlier you considered :filter property that receives link object >> instead of path and desc pair. I am unsure concerning name, but I like >> that idea. > > I feel that :filter + :export will be rather redundant - they will do > the same thing and only differ by calling convention. And we will have > issues with priority of :filter vs. :export if both happen to be > present (e.g. when a user defines a custom :export in personal config). Fair point. :export should have precedence to not break user customization. Those who define :filter should set :export to nil. It is not perfect, but the extra argument is worse from my point of view. >>> Then, if the :export function returns non-string, the return value is >>> further processed as (org-export-data *return-value* info). >> >> Do you mean something like the following? >> >> (defun org-man-export (link description backend) >> "Export a man page LINK with DESCRIPTION. >> BACKEND is the current export backend." >> (org-element-create-link >> (format "http://man.he.net/?topic=%s§ion=all" link) >> description)) > > Yes. It is nice idea for most backends, but it is unclear for me what the following function should return for ox-ascii Ihor Radchenko. Re: Exporting elisp: and shell: links. Sun, 08 Oct 2023 09:48:07 +0000. https://list.orgmode.org/87r0m5phrc.fsf@localhost > +(defun org-link--export-code (path description _ info &optional lang) > + "Export executable link with PATH and DESCRIPTION. > +INFO is the current export info plist. > +LANG is the language name, as in #+begin_src lang. For example, \"elisp\" > +or \"shell\"." > + (concat > + (org-export-data > + (org-element-create > + 'inline-src-block > + `( :language ,lang > + :value ,path > + :parameters ":exports code :noweb no :eval never")) > + info) > + (when description (format " (%s)" description)))) Source code should be exported inline or as a note depending on preferences. This case exported element is not a link, so description should be treated separately.