emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Regression: org-translate-link doesn't work correctly in Org 8.3


From: Sergei Nosov
Subject: Re: [O] Regression: org-translate-link doesn't work correctly in Org 8.3
Date: Wed, 19 Aug 2015 13:53:30 +0300

wild guess: what if you simply make the ":" optional like this:

I believe, the preceding text should be made optional as well (i.e. + should be *, like (string-match "\\([a-zA-Z0-9]*\\):?\\(.*\\)" s))

But anyway, it doesn't seem to work, because for some reason (I just noticed this) - the org-translate-link function doesn't seem to be called at all, when C-c C-o is executed. It is called only in org-element-link-parser. 

Also, org-translate-link tries to return the link in the "<type>:<link>" format (exactly the way it expects the input parameter to be). So, simply modifying the regexp shouldn't work because of this as well.

So, I suppose, something like what Nicolas suggests should be done about it (i.e. providing the type and the link in the "new format").

Also, org-translate-link should probably be called somewhere in org-open-at-point again.



--
Best regards,
       Sergei Nosov

On Wed, Aug 19, 2015 at 1:39 PM, Nicolas Goaziou <address@hidden> wrote:
Hello,

Bastien <address@hidden> writes:

> Hi Sergei,
>
> wild guess: what if you simply make the ":" optional like this:
>
> (string-match "\\([a-zA-Z0-9]+\\):\\(.*\\)" s)
>
> (string-match "\\([a-zA-Z0-9]+\\):?\\(.*\\)" s)
>                                  ^^^
>
> ?

I think `org-translate-link' should be updated to provide correct type,
including internal ones, to `org-link-translation-function'. E.g.,

  http://orgmode.org => "http"
  #something         => "custom-id"
  (ref:line)         => "coderef"
  whatever           => "fuzzy"

At least, this would be consistent with the parser.

Regards,

--
Nicolas Goaziou


reply via email to

[Prev in Thread] Current Thread [Next in Thread]