From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tyler Smith Subject: Re: [PATCH] protocol: allow users to disable warning about old style links Date: Wed, 21 Jun 2017 12:24:27 -0400 Message-ID: <1498062267.12063.1016838368.47F2F341@webmail.messagingengine.com> References: <8737b2bwg9.fsf@utexas.edu> <8737b0h33u.fsf@nicolasgoaziou.fr> <1498058861.4191387.1016780232.4A4DF5FB@webmail.messagingengine.com> <03532FC9-6028-4699-B695-CB474FD155AB@martelli.de> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiQh-0005tF-RK for emacs-orgmode@gnu.org; Wed, 21 Jun 2017 12:24:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNiQf-0004DW-7z for emacs-orgmode@gnu.org; Wed, 21 Jun 2017 12:24:31 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:58579) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dNiQe-0004DJ-Q6 for emacs-orgmode@gnu.org; Wed, 21 Jun 2017 12:24:29 -0400 In-Reply-To: <03532FC9-6028-4699-B695-CB474FD155AB@martelli.de> 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: Mario Martelli Cc: emacs-orgmode@gnu.org On Wed, Jun 21, 2017, at 12:01 PM, Mario Martelli wrote: >=20 > I have shared a proposal to move org-protocol documentation to core docum= entation. > It=E2=80=99s mainly copied together from the old one and 9.0 NEWS. >=20 > The important part regarding the new syntax could be found here: >=20 > https://github.com/mgmart/org-mode/blob/documentation/org-protocol/contri= b/orgmanual.org#L7347-L7364 >=20 > 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=3D'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=3D'org-protocol://sub-protocol?url=3D'+ encodeURIComponent(location.href)+'&title=3D'+ encodeURIComponent(document.title)+'&selection=3D'+ 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: =C2=A0=C2=A0=C2=A0 javascript:location.href=3D'org-protocol://store-link?ur= l=3D'+encodeURIComponent(location.href)+'&title=3D'+encodeURIComponent(docu= ment.title) Also, I think your example for store-link should include the document.title element? javascript:location.href=3D'org-protocol://store-link://'+encodeURIComp= onent(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