New org-protocol link style
mattwoodbury opened this issue · 9 comments
The handler needs to be updated to use the new org-protocol link style: org-protocol://sub-protocol?key=val&key2=val2, e.g., org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html&title=The%20title.
Thanks for filing this issue.
It appears that the new format of protocol URL isn't working with my version of Emacs and Org, so I can't easily verify whether my changes are working.
The protocol handler app really just passes whatever URL you send it to Emacs, though the new URL format causes it to fail because it attempts to extract the title of the page to display in the notification. I can easily add some branching logic to handle both formats of URL, but I can't tell if the new form is going to actually work in Emacs.
For example, from the terminal, this works for me:
% emacsclient 'org-protocol://capture://l/foo/bar'
However, this does not:
% emacsclient 'org-protocol://capture?template=l&url=foo&title=bar'
I am running GNU Emacs 25.3.1 (x86_64-apple-darwin17.3.0, NS appkit-1561.20 Version 10.13.2 (Build 17C88)) of 2018-01-15
. This is the latest stable version available through Homebrew. The development version is 26.0.91, but that gave me some unrelated problems so I fell back to stable for now.
I learned that the new style links were introduced in Org 9, and I have Org 8.2.10.
org-version is a variable defined in ‘org.el’.
Its value is "8.2.10"
I have orgmode.org/elpa
in my package-archives
list, but a newer version of Org is not offered to me in the package list. Since Org is now a part of Emacs, my assumption is that Org 9 will be packaged with Emacs 26 (but I am guessing).
Hi!
has that been fixed yet? i followed your excellent guide, got the notification but dont get the link stored in org mode
thx and best
Z
I am able to reproduce the issue, but to resolve it I'll need to write AppleScript code to convert a querystring into a dictionary/hash or list, and probably implement some test to make sure that it doesn't break for versions of Emacs before 26 (where the capture URL is the older version).
PRs are greatly welcome here.
I started poking at this and decided to move the bulk of the actual string processing into a Python script in the application bundle. I have it working with the new style URIs and so now I just need to get it to detect the old style and also read an optional local config file to get your path to emacsclient
because it's not uncommon to have more than one on your system and if you don't run the correct one it'll fail to function. Also not everyone will have theirs installed where mine is installed.
When this is all set it'll probably be hands-down the best macOS Org Protocol handler out there...
This change depends on #3.
Hello! Thanks for your work on this applet. Like @zeltak, have got everything working but the protocol is only copying "http:" as the link strings instead of the full url. It'd be great to have the new style links! Let me know if there's any way I can help—
Or am I experiencing a different issue? 🤔
I'm sorry @pierwill, I haven't been using this in some time and lost track of this issue. It's not too likely that I'm going to dive deeper into it, but PRs are always welcome.