emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-protocol-capture and chrome
@ 2012-04-17  8:55 Richard Riley
  2012-04-17 10:06 ` Richard Riley
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Riley @ 2012-04-17  8:55 UTC (permalink / raw)
  To: emacs-orgmode


Could someone please post a working setup (browser bookmark url and
template) for org-protocol-capture to correctly get triggered from a
Google Chrome bookmark link in order to store the current url. Googling
shows some conflicting views : some with removing calls to encodeURI and
others hacking xdg-open.

thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-protocol-capture and chrome
  2012-04-17  8:55 org-protocol-capture and chrome Richard Riley
@ 2012-04-17 10:06 ` Richard Riley
  2012-04-19 20:20   ` Harri Kiiskinen
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Riley @ 2012-04-17 10:06 UTC (permalink / raw)
  To: emacs-orgmode

Richard Riley <rileyrg@gmail.com> writes:

> Could someone please post a working setup (browser bookmark url and
> template) for org-protocol-capture to correctly get triggered from a
> Google Chrome bookmark link in order to store the current url. Googling
> shows some conflicting views : some with removing calls to encodeURI and
> others hacking xdg-open.
>
> thanks!
>

As an aside, the documentation in worg is wrong with regard to the default
template key for capture:

The doc says :-

,----
| You don't need to setup a capture template to use org-protocol-capture,
| since Org-mode provides a default template for those cases. Newer
| versions provide an interactive interface for choosing a template. You
| may provide a template to be used by customizing the variable
| org-capture-default-template.
`----

I believe the correct variable is

,----
| org-protocol-default-template-key
`----

regards

r.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-protocol-capture and chrome
  2012-04-17 10:06 ` Richard Riley
@ 2012-04-19 20:20   ` Harri Kiiskinen
  2012-04-20  1:23     ` Bernt Hansen
  0 siblings, 1 reply; 7+ messages in thread
From: Harri Kiiskinen @ 2012-04-19 20:20 UTC (permalink / raw)
  To: emacs-orgmode, rileyrg

From: Richard Riley <rileyrg@gmail.com>
Subject: Re: [O] org-protocol-capture and chrome
Date: Tue, 17 Apr 2012 12:06:32 +0200

> Richard Riley <rileyrg@gmail.com> writes:
> 
>> Could someone please post a working setup (browser bookmark url and
>> template) for org-protocol-capture to correctly get triggered from a
>> Google Chrome bookmark link in order to store the current url. Googling
>> shows some conflicting views : some with removing calls to encodeURI and
>> others hacking xdg-open.

Hi,

I just spent some time in trying to set this up last weekend. In
short, on linux, it does not work by default, as Chrome insists on
using the OS to open the link, more specifically gvfs-open. This
program, on the other hand, has a long-standing bug which makes it
unable to handle encoded URI's. If the URI is fed to it unencoded,
then org-protocol is not able to separate the different parts of the
argument as it uses internally '/' as separator.

I posted last week-end a patch to this list which adds a variable to
org-protocol to use a custom separator. In this case, the URI in
Chrome does not need to be encoded, and gvfs-open won't choke on it. I
found that a separator like '|||' works perfectly. With this patch,
the wiki examples work well, just leave out the
encodeRUIComponent-part.

It feels stupid to add a custom variable just to circumvent this
problem, but the bug in gvfs-open was first reported in something like
2006 and still isn't fixed, so I guess it may not be something to hold
one's breath on.

The format of the patch was probably not correct as I have no idea
whether it made it anywhere from this list, but should be found in the
archives around April 14th.

Best,

Harri K.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-protocol-capture and chrome
  2012-04-19 20:20   ` Harri Kiiskinen
@ 2012-04-20  1:23     ` Bernt Hansen
  2012-04-20 10:22       ` Richard Riley
  0 siblings, 1 reply; 7+ messages in thread
From: Bernt Hansen @ 2012-04-20  1:23 UTC (permalink / raw)
  To: Harri Kiiskinen; +Cc: rileyrg, emacs-orgmode

Harri Kiiskinen <harkiisk@gmail.com> writes:

> The format of the patch was probably not correct as I have no idea
> whether it made it anywhere from this list, but should be found in the
> archives around April 14th.

It's sitting on the patchwork server waiting to be dealt with.

http://patchwork.newartisans.com/project/org-mode/list/

-Bernt

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-protocol-capture and chrome
  2012-04-20  1:23     ` Bernt Hansen
@ 2012-04-20 10:22       ` Richard Riley
  2012-04-20 10:48         ` Bastien
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Riley @ 2012-04-20 10:22 UTC (permalink / raw)
  To: emacs-orgmode

Bernt Hansen <bernt@norang.ca> writes:

> Harri Kiiskinen <harkiisk@gmail.com> writes:
>
>> The format of the patch was probably not correct as I have no idea
>> whether it made it anywhere from this list, but should be found in the
>> archives around April 14th.
>
> It's sitting on the patchwork server waiting to be dealt with.
>
> http://patchwork.newartisans.com/project/org-mode/list/
>
> -Bernt
>

Would be nice : seems straightforward enough and totally backwards
comaptible. Nice one Harri.

Chrome is pretty much #1 browser these days and building user base all
the time.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-protocol-capture and chrome
  2012-04-20 10:22       ` Richard Riley
@ 2012-04-20 10:48         ` Bastien
  2012-04-20 11:42           ` Richard Riley
  0 siblings, 1 reply; 7+ messages in thread
From: Bastien @ 2012-04-20 10:48 UTC (permalink / raw)
  To: emacs-orgmode

Richard Riley <rileyrg@gmail.com> writes:

> Bernt Hansen <bernt@norang.ca> writes:
>
>> Harri Kiiskinen <harkiisk@gmail.com> writes:
>>
>>> The format of the patch was probably not correct as I have no idea
>>> whether it made it anywhere from this list, but should be found in the
>>> archives around April 14th.
>>
>> It's sitting on the patchwork server waiting to be dealt with.
>>
>> http://patchwork.newartisans.com/project/org-mode/list/
>>
>> -Bernt
>>
>
> Would be nice : seems straightforward enough and totally backwards
> comaptible. Nice one Harri.

This has just been applied.  Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: org-protocol-capture and chrome
  2012-04-20 10:48         ` Bastien
@ 2012-04-20 11:42           ` Richard Riley
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Riley @ 2012-04-20 11:42 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@altern.org> writes:

> Richard Riley <rileyrg@gmail.com> writes:
>
>> Bernt Hansen <bernt@norang.ca> writes:
>>
>>> Harri Kiiskinen <harkiisk@gmail.com> writes:
>>>
>>>> The format of the patch was probably not correct as I have no idea
>>>> whether it made it anywhere from this list, but should be found in the
>>>> archives around April 14th.
>>>
>>> It's sitting on the patchwork server waiting to be dealt with.
>>>
>>> http://patchwork.newartisans.com/project/org-mode/list/
>>>
>>> -Bernt
>>>
>>
>> Would be nice : seems straightforward enough and totally backwards
>> comaptible. Nice one Harri.
>
> This has just been applied.  Thanks,

Seems better but using this bookmark:-

,----
| javascript:location.href='org-protocol://capture://'+ location.href+'/'+ document.title+'/'+ window.getSelection()
`----

and this capture template:-

,----
| 			      ("z" "default" entry (file+datetree "journal.org")
| 			       "* %^{Title}\n\t:PROPERTIES:\n\t:DateCreated: %T\n\t:END:\n  Source: %u, %c\n\n  %i"
| 			       :empty-lines 1)
`----

with org-protocol-default-template-key set to "z" the resulting popup
capture buffer still has the incorrect format for the url link. When I
C-c C-l on the Source link (%c which is the kill ring head ) I get only
"http:" in the Link: field and pressing "enter" on it doesnt do the
xpexted thing (open the link). I dont know which side this needs to be
fixed : possibly %c needs to be reparsed and constructed as a legitimate
org link element?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-04-20 11:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17  8:55 org-protocol-capture and chrome Richard Riley
2012-04-17 10:06 ` Richard Riley
2012-04-19 20:20   ` Harri Kiiskinen
2012-04-20  1:23     ` Bernt Hansen
2012-04-20 10:22       ` Richard Riley
2012-04-20 10:48         ` Bastien
2012-04-20 11:42           ` Richard Riley

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).