From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: links-9.0 v3 Date: Fri, 08 Jul 2016 23:32:01 +0200 Message-ID: <8737njx1da.fsf@saiph.selenimh> References: <87oa6afmeu.fsf@saiph.selenimh> <87k2gxg8qm.fsf@saiph.selenimh> <8737nlfqdv.fsf@saiph.selenimh> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLdNa-0004LX-PB for emacs-orgmode@gnu.org; Fri, 08 Jul 2016 17:32:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bLdNY-0004SL-HZ for emacs-orgmode@gnu.org; Fri, 08 Jul 2016 17:32:09 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:49176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bLdNY-0004S5-Az for emacs-orgmode@gnu.org; Fri, 08 Jul 2016 17:32:08 -0400 In-Reply-To: (John Kitchin's message of "Thu, 07 Jul 2016 15:17:07 -0400") 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.org@gnu.org Sender: "Emacs-orgmode" To: John Kitchin Cc: "emacs-orgmode@gnu.org" Hello, John Kitchin 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