From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: attachment: link type export to HTML invalid attach dir Date: Sat, 15 Feb 2020 23:04:40 +0000 Message-ID: <87eeuvpi47.fsf@kyleam.com> References: <87h7zrradl.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:59249) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j36Ug-0006XG-Nr for emacs-orgmode@gnu.org; Sat, 15 Feb 2020 18:05:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j36Uf-0001IY-Cd for emacs-orgmode@gnu.org; Sat, 15 Feb 2020 18:05:02 -0500 In-Reply-To: <87h7zrradl.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane-mx.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou , Bastien Cc: Gustav =?utf-8?Q?Wikstr=C3=B6m?= , "emacs-orgmode@gnu.org" Nicolas Goaziou writes: > In a nutshell: > > `org-link-parameters' accepts a new property, :open, which is > like :follow, but function installed there is called with a universal > prefix argument. It could replace :follow altogether, but for > compatibility reasons, they both live side by side for the moment. > > Also, :export function is called with a fourth argument, the export info > channel. I updated the export back-ends to handle the new signature, and > provided a compatibility layers for link libraries in the wild, which > may still use three arguments. > > There are two new tools: `org-link-open-as-file' and > `org-export-link-as-file'. They can be used as helper functions for, > respectively, :open and :export functions. > > WDYT? It looks like a good direction to go. > Subject: [PATCH 1/2] Extend export tooling in link parameters [...] > (defcustom org-link-parameters nil > - "An alist of properties that defines all the links in Org mode. > + "Alist of properties that defines all the links in Org mode. > + [...] > +`:export' > + > + Function that accepts three mandatory arguments : nit: extra space before colon > + Optionally, it may accept the export communication channel as > + a fourth argument, in case you need using Org Export tooling, s/need using/need to use/ ? > Subject: [PATCH 2/2] ol: Extend open tooling in link parameters [...] > - Function that takes the link path (a string) as an argument and > - \"opens\" the link. > + Function used to follow the link, when `org-open-at-point' is > + command runs on it. Delete "is"? (Also, assuming the "is" is dropped, to my ears it'd read better with a "the" in front of org-open-at-point.) > [ @@ -990,37 +998,14 @@ (defun org-link-open (link &optional arg) ] > - (if (string-match "[*?{]" (file-name-nondirectory path)) > - (dired path) > - ;; Look into `org-link-parameters' in order to find > - ;; a DEDICATED-FUNCTION to open file. The function will be > - ;; applied on raw link instead of parsed link due to the > - ;; limitation in `org-add-link-type' ("open" function called > - ;; with a single argument). If no such function is found, > - ;; fallback to `org-open-file'. > - (let* ((option (org-element-property :search-option link)) > - (app (org-element-property :application link)) > - (dedicated-function > - (org-link-get-parameter (if app (concat type "+" app) type) > - :follow))) As far as I can see (by looking at the diff and quickly testing), the file+{sys,emacs} functionality is being removed. That's probably okay/intended, given that it was marked as deprecated in 9.0. But perhaps it's worth mentioning in ORG-NEWS that this functionality has now been removed entirely. > +(defun org-link-open-as-file (path arg) > + "Pretend PATH is a file name and open it. > + > +According to \"file\"-link syntax, PATH may include addition s/addition/additional/ > +search options, separated from the file name with \"::\". > + > +This function is meant to be used as a possible tool for `:open' > +property in `org-link-parameters.'" nit: I think the period should go after the quote (regardless of the strange preference in American English to put commas and periods within quotes).