Nicolas Goaziou <m...@nicolasgoaziou.fr> 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).