Re: [O] [BUG] Cannot export a raw link

2014-05-04 Thread Nicolas Goaziou
Hello,

Michael Brand  writes:

> I am not 100 % sure whether it is related with the above changes. But
> could you please check again if the merge conflict in lisp/ox-html.el
> between maint and master was resolved correctly with your merging
> commit fffd055ac5e920e744e350a1ad164494aec9fa91 on master? I think on
> master it should not be
>
> (org-link-escape
>  (org-link-unescape
>   (concat type ":" raw-path)) org-link-escape-chars-browser))
>
> but
>
> (org-link-escape-browser
>  (org-link-unescape (concat type ":" raw-path
>
> like it was after my commit 54e3009d7319e4bece967be165061331070635e5.

Fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] Cannot export a raw link

2014-05-03 Thread Michael Brand
Hi Nicolas

On Wed, Apr 16, 2014 at 9:15 AM, Nicolas Goaziou  wrote:
> I suggest the following for the 8.2.6 release:
>
>   - revert the whole patches line
>
>   - at the parser level
>
> - if scheme is not "file" or derived (e.g., "file+sys" or
>   "docview"), assume PATH is a correct URI and do not change
>   anything ;
>
> - otherwise, if PATH is absolute and do not start with two or more
>   slashes, append "//" to it ;
>
>   - at the back-ends level, simply add "file:" if PATH is absolute and
> use PATH otherwise.
>
> I think it is sufficient for 8.2.6.  We can still discuss if more
> parsing is needed for 8.3.
>
> WDYT?

I am not 100 % sure whether it is related with the above changes. But
could you please check again if the merge conflict in lisp/ox-html.el
between maint and master was resolved correctly with your merging
commit fffd055ac5e920e744e350a1ad164494aec9fa91 on master? I think on
master it should not be

(org-link-escape
 (org-link-unescape
  (concat type ":" raw-path)) org-link-escape-chars-browser))

but

(org-link-escape-browser
 (org-link-unescape (concat type ":" raw-path

like it was after my commit 54e3009d7319e4bece967be165061331070635e5.

Michael



Re: [O] [BUG] Cannot export a raw link

2014-04-17 Thread Bastien
Nicolas Goaziou  writes:

> Bastien  writes:
>
>> Nicolas Goaziou  writes:
>>
>>> FWIW, I vote for regular URI mailto:j...@doe.com?subject=Test.
>>
>> Yep, 100% agreed.
>
> Done in b9f2e17f07faf01109fc6f7f1eb5a34e0f97eafb.

Works fine, thanks!

-- 
 Bastien



Re: [O] [BUG] Cannot export a raw link

2014-04-17 Thread Nicolas Goaziou
Bastien  writes:

> Nicolas Goaziou  writes:
>
>> FWIW, I vote for regular URI mailto:j...@doe.com?subject=Test.
>
> Yep, 100% agreed.

Done in b9f2e17f07faf01109fc6f7f1eb5a34e0f97eafb.


Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] Cannot export a raw link

2014-04-17 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

>> Indeed, please go ahead with this plan when you can.
>
> Done.

Thanks,

> FWIW, I vote for regular URI mailto:j...@doe.com?subject=Test.

Yep, 100% agreed.

-- 
 Bastien



Re: [O] [BUG] Cannot export a raw link

2014-04-17 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> Indeed, please go ahead with this plan when you can.

Done.

> Also, `org-open-at-point' needs to correctly deal with links
> like mailto:j...@doe.com?subject=Test -- I think it used to
> work but the subject is not parsed correctly here.

I don't think it ever worked. According to `org-link-mailto-program',
Org provides its own syntax, which is

  mailto:j...@doe.com::Test

Unfortunately, this is also buggy at the moment. But, before fixing it,
I think we should decide which syntax we are going to support
(supporting both is sub-optimal, IMO).

FWIW, I vote for regular URI mailto:j...@doe.com?subject=Test. That
implies to get rid of `org-link-mailto-program' and delegate the parsing
job to `browse-url', which can be configured, in this case, through
`browse-url-mailto-function'.


Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] Cannot export a raw link

2014-04-16 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> I suggest the following for the 8.2.6 release:
>
>   - revert the whole patches line
>
>   - at the parser level
>
> - if scheme is not "file" or derived (e.g., "file+sys" or
>   "docview"), assume PATH is a correct URI and do not change
>   anything ;
>
> - otherwise, if PATH is absolute and do not start with two or more
>   slashes, append "//" to it ;
>
>   - at the back-ends level, simply add "file:" if PATH is absolute and
> use PATH otherwise.
>
> I think it is sufficient for 8.2.6.  We can still discuss if more
> parsing is needed for 8.3.

Indeed, please go ahead with this plan when you can.

Also, `org-open-at-point' needs to correctly deal with links
like mailto:j...@doe.com?subject=Test -- I think it used to
work but the subject is not parsed correctly here.

Thanks,

-- 
 Bastien



Re: [O] [BUG] Cannot export a raw link

2014-04-16 Thread Achim Gratz
Nicolas Goaziou writes:
[…]
> I think it is sufficient for 8.2.6.  We can still discuss if more
> parsing is needed for 8.3.

I agree that this should take care of it.  Unless Org honestly tries to
be RFC3986 conformant in the future, I don't really see the point in
further changes at the moment.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] [BUG] Cannot export a raw link

2014-04-16 Thread Nicolas Goaziou
I suggest the following for the 8.2.6 release:

  - revert the whole patches line

  - at the parser level

- if scheme is not "file" or derived (e.g., "file+sys" or
  "docview"), assume PATH is a correct URI and do not change
  anything ;

- otherwise, if PATH is absolute and do not start with two or more
  slashes, append "//" to it ;

  - at the back-ends level, simply add "file:" if PATH is absolute and
use PATH otherwise.

I think it is sufficient for 8.2.6.  We can still discuss if more
parsing is needed for 8.3.

WDYT?


Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] Cannot export a raw link

2014-04-14 Thread Nicolas Goaziou
Achim Gratz  writes:

> groff has this snippet:
>
>
>   (if (file-name-absolute-p raw-path)
>   (concat "file://" (expand-file-name raw-path))
> (concat "file://" raw-path)))

This needs to be fixed, along with ox-man.el. Anyway, that wasn't
introduced with the patch being discussed.

> Well, there's the option of correctly parsing into scheme, authority,
> path, query and fragment...  But that is probably not going into 8.2.6
> in any case.

I don't think we need to completely parse the URI because:

  - we are not going to consume it,
  - Org syntax is not completely compatible with RFC3986 (e.g., search
options like [[file:test.org::* My headline]]).

I think we need scheme, authority, path+query+fragment, and search
options. At the moment, the parser handles scheme,
authority+path+query+fragment and search options.
`url-generic-parse-url' may help, too.

We also need a function to build back the link, in order to make life of
back-end developers easier. This is why authority is needed.

>> Another one is to drop the whole thing, return to previous state, and
>> implement ad-hoc rules to fix "file:", which is probably the only scheme
>> introducing problems.
>
> I forgot what the previous state was, but trying to fix file: URIs
> without correctly parsing them sounds like a losing proposition.

Previous state was, in a nutshell, to recognize scheme:blob, which leads
to the same kind of problem since blob may or may not contain the
authority part.


Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] Cannot export a raw link

2014-04-14 Thread Achim Gratz
Nicolas Goaziou writes:
> With latest patch and following Org buffer
>
>   file:test.org
>   file:/test.org
>   file:///test.org
>
> I get (HTML export)
>
>   test.html
>   file:///test.html
>   file:///test.html
>
> So, it looks good so far.

groff has this snippet:

--8<---cut here---start->8---
  (if (file-name-absolute-p raw-path)
  (concat "file://" (expand-file-name raw-path))
(concat "file://" raw-path)))
--8<---cut here---end--->8---

which unconditionally adds an authority if I read it correctly.

> Unfortunately, it fails with a non-empty authority. E.g.,
>
>   file://hostname/test.org
>
> becomes
>
>   test.html
>
> So it is not satisfactory.

Right, I didn't read as far into the patch.

> One possibility is to store somewhere in the parsed link that the URI
> provided the "//" part, and, if so, re-introduce it unconditionally when
> building back the link.

Well, there's the option of correctly parsing into scheme, authority,
path, query and fragment...  But that is probably not going into 8.2.6
in any case.

https://tools.ietf.org/html/rfc3986

> Another one is to drop the whole thing, return to previous state, and
> implement ad-hoc rules to fix "file:", which is probably the only scheme
> introducing problems.

I forgot what the previous state was, but trying to fix file: URIs
without correctly parsing them sounds like a losing proposition.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptations for Waldorf Q V3.00R3 and Q+ V3.54R2:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] [BUG] Cannot export a raw link

2014-04-14 Thread Nicolas Goaziou
Hello,

Achim Gratz  writes:

> It still isn't correct.  If you put "//" after a "file:" scheme, then
> you need to put an authority there (an empty authority means localhost
> in some contexts, but then the path has to start with a slash). 

The patch didn't change "file" scheme handling. It changed "http",
"https" and "ftp".

> Also, with the new implementation relative file: links would stop
> working. A relative file link cannot have any slashes after the
> scheme, while an absolute path must have three (not going into the
> vagaries of trying to use UNC paths and file links that work around
> the security policies of various web browsers).

With latest patch and following Org buffer

  file:test.org
  file:/test.org
  file:///test.org

I get (HTML export)

  test.html
  file:///test.html
  file:///test.html

So, it looks good so far.

Unfortunately, it fails with a non-empty authority. E.g.,

  file://hostname/test.org

becomes

  test.html

So it is not satisfactory.

One possibility is to store somewhere in the parsed link that the URI
provided the "//" part, and, if so, re-introduce it unconditionally when
building back the link.

Another one is to drop the whole thing, return to previous state, and
implement ad-hoc rules to fix "file:", which is probably the only scheme
introducing problems.


Regards,

-- 
Nicolas Goaziou



Re: [O] [BUG] Cannot export a raw link

2014-04-14 Thread Achim Gratz
Nicolas Goaziou writes:
> Correct. It should be fixed.

It still isn't correct.  If you put "//" after a "file:" scheme, then
you need to put an authority there (an empty authority means localhost
in some contexts, but then the path has to start with a slash).  Also,
with the new implementation relative file: links would stop working.  A
relative file link cannot have any slashes after the scheme, while an
absolute path must have three (not going into the vagaries of trying to
use UNC paths and file links that work around the security policies of
various web browsers).

http://www-archive.mozilla.org/quality/networking/testing/filetests.html


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada




Re: [O] [BUG] Cannot export a raw link

2014-04-14 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> 1. create a file with "http://orgmode.org"; as its contents
> 2. export it to HTML
> 3. the exported link is wrong: http:orgmode.org
>
> I guess it has to do with this commit:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=3589f6
>
> Can you double-check?

Correct. It should be fixed.

Though, export back-ends in the wild implementing their own link
handling (i.e., not through a derived back-end) need to apply the
change.

IMO, this can still be part of Org 8.2.6, but it should be notified as
an incompatible change in Org News.


Regards,

-- 
Nicolas Goaziou



[O] [BUG] Cannot export a raw link

2014-04-14 Thread Bastien
Hi Nicolas,

1. create a file with "http://orgmode.org"; as its contents
2. export it to HTML
3. the exported link is wrong: http:orgmode.org

I guess it has to do with this commit:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=3589f6

Can you double-check?

Thanks,

-- 
 Bastien