emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [PATCH] protocol: allow users to disable warning about old style


From: Tyler Smith
Subject: Re: [O] [PATCH] protocol: allow users to disable warning about old style links
Date: Wed, 21 Jun 2017 12:24:27 -0400

On Wed, Jun 21, 2017, at 12:01 PM, Mario Martelli wrote:
> 
> I have shared a proposal to move org-protocol documentation to core 
> documentation.
> It’s mainly copied together from the old one and 9.0 NEWS.
> 
> The important part regarding the new syntax could be found here:
> 
> https://github.com/mgmart/org-mode/blob/documentation/org-protocol/contrib/orgmanual.org#L7347-L7364
> 
> Would that help or is there still something to add?

Thanks, Mario.

Your documentation refers to the new-style links, but the examples still
use the old style I think? My javascript is very basic, but from some
experimenting here, I think the old style links are what you've used:

    javascript:location.href='org-protocol://sub-protocol://'+
          encodeURIComponent(location.href)+'/'+
          encodeURIComponent(document.title)+'/'+
          encodeURIComponent(window.getSelection())

whereas the new-style key-value links would be:

    javascript:location.href='org-protocol://sub-protocol?url='+
          encodeURIComponent(location.href)+'&title='+
          encodeURIComponent(document.title)+'&selection='+
          encodeURIComponent(window.getSelection())

(I'm not actually sure what the name corresponding to `getSelection()`
is)

This is based on the following link style for store-link, which works
for me with Firefox 45.9 and Org 9.0 on Emacs 26.0.50:

    
javascript:location.href='org-protocol://store-link?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)

Also, I think your example for store-link should include the
document.title element?

    
javascript:location.href='org-protocol://store-link://'+encodeURIComponent(location.href)

It's true that old style links are still supported, but if they produce
a warning error when you use them, it would make sense to suggest the
new style syntax as the default for use by us newbies.

Best,

Tyler

--
plantarum.ca






reply via email to

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