Hello, John Kitchin <jkitc...@andrew.cmu.edu> writes:
> I don't understand what you mean here. The contents of org-link > protocols (in master) looks a lot like a list of (link-type :follow > :export), e.g. You're right. Keys in `org-link-protocols' are types. >> (nth 1 (assoc app org-link-protocols)) > > I see that these are not the same, since type != app. Per the above, this snippet from `org-open-at-point' is suspicious. > I was referring to the optional parameter, although I reconsider it > here. I don't understand how does the "application" get to the > follow functions of links other than file+sys and file+emacs. It seems > like we would need to allow type+application:path as a link syntax and > extend the link-parser to get the application. Right now it looks like > the parser only adds application properties to file type links. file+sys and file+emacs predate the parser. Since the manual doesn't seem to generalize them, parser support for them is rather minimalist. I really hope this syntax is not going to be extended, because it doesn't sound right to define the application opening a link at the syntax level. > I don't mind this (it makes links more flexible after all ;) OTOH, we > would have to "register" each type+application for the link regexp, and > then each type can have its own follow function, so it seems unnecessary > to me. I agree. As long as we need the regexp (because of plain links, actually), my suggestion is a false good idea. > My understanding of your statement of the problem is that the > link-parser recognizes file:path, file+sys:path, and file+emacs:path as > links of type "file", with different "application" properties. In the > implementation of org-open-at-point on master, there is a cond branch > for the "file" type link, and inside that the application is checked. > Hence, without your suggestion at the end, there is not a way to access > the :follow function of file+sys or file+emacs. > > To me this seems to be an unnecessary distinction from a link point of > view since those three file links could just be defined as regular links > with different follow/export functions. OTOH, perhaps there are other > places in org-mode that rely on being able to tell when a link is a > file, even if they are labeled file+sys or file+emacs that I am not > aware of? Any use not relying on :follow does not care above "+sys" or "+emacs". E.g., during export, file+sys and file+emacs are treated the same. > If I compare this to what exists in org-ref, for example, there > are close to 40 different types of citations one can use, but they are > all fundamentally "cite" types. They all share a common follow action, > but have different export functions. When defined as separate links, I > use them like cite:key citenum:key, citet:key, autocite:key, etc... > > Even here while I can see some utility for an application, e.g. perhaps > to open the key in zotero, or mendeley or bibtex, I would normally > associate that action with the :follow function. Am I missing > something? I think file+app was designed to override :follow function, so associating the action with the :follow function wouldn't help. > I only mentioned it because it seems to be in there in master via this line: > > (regexp-opt (cons "coderef" org-link-types) > > but it looks like it is in there in a different sort of way. It doesn't > seem important here. The line above creates a regexp matching types, as stored by the parser, as returned by (org-element-property :type link). This can be "coderef". OTOH (regexp-opt org-link-types) is meant to match links in an Org buffer, where there is no "coderef". Regards, -- Nicolas Goaziou