emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tyler Smith <tyler@plantarum.ca>
To: Mario Martelli <mario@martelli.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: [PATCH] protocol: allow users to disable warning about old style links
Date: Wed, 21 Jun 2017 12:24:27 -0400	[thread overview]
Message-ID: <1498062267.12063.1016838368.47F2F341@webmail.messagingengine.com> (raw)
In-Reply-To: <03532FC9-6028-4699-B695-CB474FD155AB@martelli.de>

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	other threads:[~2017-06-21 16:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 12:11 [PATCH] protocol: allow users to disable warning about old style links Alex Branham
2017-06-16  6:13 ` Nicolas Goaziou
2017-06-16 11:31   ` Alex Branham
2017-06-16 14:26     ` Nicolas Goaziou
2017-06-21 15:27   ` Tyler Smith
2017-06-21 16:01     ` Mario Martelli
2017-06-21 16:24       ` Tyler Smith [this message]
2017-06-21 16:34         ` Tyler Smith
2017-06-21 16:51         ` Mario Martelli
2017-06-21 17:09           ` Tyler Smith
2017-06-21 17:17             ` Mario Martelli

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=1498062267.12063.1016838368.47F2F341@webmail.messagingengine.com \
    --to=tyler@plantarum.ca \
    --cc=emacs-orgmode@gnu.org \
    --cc=mario@martelli.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).