emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-protocol-store-link does not account for argument type
@ 2022-01-26 23:02 Thuna
  2022-01-27 14:49 ` Max Nikulin
  0 siblings, 1 reply; 6+ messages in thread
From: Thuna @ 2022-01-26 23:02 UTC (permalink / raw)
  To: emacs-orgmode

Currently org-protocol-store-link assumes FNAME to be in the old-style.
Changing the nil in line 467 of org-protocol.el to (listp fname) fixes
the issue.


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

* Re: [BUG] org-protocol-store-link does not account for argument type
  2022-01-26 23:02 [BUG] org-protocol-store-link does not account for argument type Thuna
@ 2022-01-27 14:49 ` Max Nikulin
  2022-01-27 15:13   ` Thuna
  0 siblings, 1 reply; 6+ messages in thread
From: Max Nikulin @ 2022-01-27 14:49 UTC (permalink / raw)
  To: Thuna, emacs-orgmode

On 27/01/2022 06:02, Thuna wrote:
> Currently org-protocol-store-link assumes FNAME to be in the old-style.
> Changing the nil in line 467 of org-protocol.el to (listp fname) fixes
> the issue.

Could you, please, describe your actual problem?

I have tried

     emacsclient 'org-protocol://store-link?url=http://o.rg/&title=Tt1'
     emacsclient 'org-protocol://store-link:/https:%2F%2Fo2.rg/Tt2'

and both links have been stored successfully.

There are even some tests for handling of new and old style URIs by 
store-link subprotocol though they are not run by default.



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

* Re: [BUG] org-protocol-store-link does not account for argument type
  2022-01-27 14:49 ` Max Nikulin
@ 2022-01-27 15:13   ` Thuna
  2022-01-27 16:47     ` Max Nikulin
  0 siblings, 1 reply; 6+ messages in thread
From: Thuna @ 2022-01-27 15:13 UTC (permalink / raw)
  To: Max Nikulin, emacs-orgmode


> Could you, please, describe your actual problem?

Currently, org-protocol-store-link, as a function, fails to work for
new-style links.

Doing the following:
1. M-: (org-protocol-store-link "url=U&title=T")
2. M-x org-insert-link

and accepting the suggestions for the link and the description inserts
"[[url=U&title=T]]" instead of "[[U][T]]", which should be the expected
behavior according to the documentation of the function, unless I am
misunderstanding it.


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

* Re: [BUG] org-protocol-store-link does not account for argument type
  2022-01-27 15:13   ` Thuna
@ 2022-01-27 16:47     ` Max Nikulin
  2022-01-27 18:15       ` Thuna
  0 siblings, 1 reply; 6+ messages in thread
From: Max Nikulin @ 2022-01-27 16:47 UTC (permalink / raw)
  To: Thuna, emacs-orgmode

On 27/01/2022 22:13, Thuna wrote:
> 
>> Could you, please, describe your actual problem?
> 
> Currently, org-protocol-store-link, as a function, fails to work for
> new-style links.
> 
> Doing the following:
> 1. M-: (org-protocol-store-link "url=U&title=T")
> 2. M-x org-insert-link
> 
> and accepting the suggestions for the link and the description inserts
> "[[url=U&title=T]]" instead of "[[U][T]]", which should be the expected
> behavior according to the documentation of the function, unless I am
> misunderstanding it.

See the last paragraph of the docstring:

> FNAME should be a property list.  If not, an old-style link of the
                     ^^^^^^^^^^^^^^
> form URL/TITLE can also be used."

You pass a string for *new* URI style.

Maybe there is another description of the interface that should be 
implemented by functions handling subprotocols.

You may look at the tests if you are going to use org-protocol in some 
special way.


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

* Re: [BUG] org-protocol-store-link does not account for argument type
  2022-01-27 16:47     ` Max Nikulin
@ 2022-01-27 18:15       ` Thuna
  2022-01-28 12:21         ` Max Nikulin
  0 siblings, 1 reply; 6+ messages in thread
From: Thuna @ 2022-01-27 18:15 UTC (permalink / raw)
  To: Max Nikulin, emacs-orgmode


> See the last paragraph of the docstring:
>
>> FNAME should be a property list.  If not, an old-style link of the
>                      ^^^^^^^^^^^^^^
>> form URL/TITLE can also be used."
>
> You pass a string for *new* URI style.

I see, it seems I have misunderstood the documentation then.  My
apologies for the inconvenience.


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

* Re: [BUG] org-protocol-store-link does not account for argument type
  2022-01-27 18:15       ` Thuna
@ 2022-01-28 12:21         ` Max Nikulin
  0 siblings, 0 replies; 6+ messages in thread
From: Max Nikulin @ 2022-01-28 12:21 UTC (permalink / raw)
  To: Thuna, emacs-orgmode

On 28/01/2022 01:15, Thuna wrote:
> 
>> See the last paragraph of the docstring:
>>
>>> FNAME should be a property list.  If not, an old-style link of the
>>                       ^^^^^^^^^^^^^^
>>> form URL/TITLE can also be used."
>>
>> You pass a string for *new* URI style.
> 
> I see, it seems I have misunderstood the documentation then.  My
> apologies for the inconvenience.

I think, you have missed an opportunity to get a suggestion concerning 
you actual problem. You original report and the response were so brief 
that it is impossible to guess the context of the question and your goal.

Code org-protocol has enough hacks and the functions unlikely should be 
called from outside. Defining new subprotocol is likely the only case 
when it is necessary to understand arguments of functions. I suspect a 
function appropriate for your purpose is defined somewhere else.


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

end of thread, other threads:[~2022-01-28 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 23:02 [BUG] org-protocol-store-link does not account for argument type Thuna
2022-01-27 14:49 ` Max Nikulin
2022-01-27 15:13   ` Thuna
2022-01-27 16:47     ` Max Nikulin
2022-01-27 18:15       ` Thuna
2022-01-28 12:21         ` Max Nikulin

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