all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: John Kitchin <jkitchin@andrew.cmu.edu>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: links-9.0 v3
Date: Fri, 08 Jul 2016 23:32:01 +0200	[thread overview]
Message-ID: <8737njx1da.fsf@saiph.selenimh> (raw)
In-Reply-To: <m2poqpl0lo.fsf@Johns-MacBook-Air.local> (John Kitchin's message of "Thu, 07 Jul 2016 15:17:07 -0400")

Hello,

John Kitchin <jkitchin@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

  reply	other threads:[~2016-07-08 21:32 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 14:41 links-9.0 v3 John Kitchin
2016-07-06 22:10 ` Nicolas Goaziou
2016-07-06 23:06   ` John Kitchin
2016-07-07  1:55   ` John Kitchin
2016-07-07  8:20     ` Nicolas Goaziou
2016-07-07 13:27       ` John Kitchin
2016-07-07 14:56         ` Nicolas Goaziou
2016-07-07 19:17           ` John Kitchin
2016-07-08 21:32             ` Nicolas Goaziou [this message]
2016-07-07 19:21           ` John Kitchin
2016-07-08 21:48             ` Nicolas Goaziou
2016-07-08 22:04               ` John Kitchin
2016-07-09 13:27               ` John Kitchin
2016-07-18 12:02                 ` Nicolas Goaziou
2016-07-15  1:12               ` John Kitchin
2016-07-18 11:48                 ` Nicolas Goaziou
2016-07-18 15:20                   ` John Kitchin
2016-07-18 16:05                     ` Nicolas Goaziou
2016-07-18 16:55                       ` John Kitchin
2016-07-18 21:59                         ` Nicolas Goaziou
2016-07-18 23:37                           ` John Kitchin
2016-08-06  1:14                         ` [PATCH] " Matt Lundin
2016-08-08  0:12                           ` John Kitchin
2016-08-08  5:30                             ` Robert Klein
2016-08-08  9:21                               ` Nicolas Goaziou
2016-08-08  9:08                           ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8737njx1da.fsf@saiph.selenimh \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=jkitchin@andrew.cmu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.