emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Inconsistency between org-store-link-functions and org-store-link
@ 2015-11-06 18:23 Aaron Ecay
  2015-11-06 20:26 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Ecay @ 2015-11-06 18:23 UTC (permalink / raw)
  To: orgmode

Hello all,

The docstring of org-store-link-functions says: “Each function will be
called in turn until one returns a non-nil value.”  However, the code of
org-store-link actually calls all the functions, and if more than one
returns a non-nil value raises a prompt asking the user to choose (and
then calls that function a second time).

Should we change the code to match the doc, or vice versa?

Aaron

PS I vote for keeping the semantics described in the doc, because the
current implementation’s double calling of the selected function
means that store-link functions that have side effects will behave
unpredictably.  Imagine a store-link function for image buffers that
uploads the buffer to imgur or a similar hosting site, and stores the
http url of the uploaded file.  The current implementation would
upload the image twice.

-- 
Aaron Ecay

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

* Re: Inconsistency between org-store-link-functions and org-store-link
  2015-11-06 18:23 Inconsistency between org-store-link-functions and org-store-link Aaron Ecay
@ 2015-11-06 20:26 ` Nicolas Goaziou
  2015-11-07 12:47   ` Aaron Ecay
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2015-11-06 20:26 UTC (permalink / raw)
  To: orgmode

Hello,

Aaron Ecay <aaronecay@gmail.com> writes:

> The docstring of org-store-link-functions says: “Each function will be
> called in turn until one returns a non-nil value.”  However, the code of
> org-store-link actually calls all the functions, and if more than one
> returns a non-nil value raises a prompt asking the user to choose (and
> then calls that function a second time).
>
> Should we change the code to match the doc, or vice versa?

The former, IMO.

> Aaron
>
> PS I vote for keeping the semantics described in the doc, because the
> current implementation’s double calling of the selected function
> means that store-link functions that have side effects will behave
> unpredictably.  Imagine a store-link function for image buffers that
> uploads the buffer to imgur or a similar hosting site, and stores the
> http url of the uploaded file.  The current implementation would
> upload the image twice.

I agree.

Regards,

-- 
Nicolas Goaziou

P.S: next release is AFAIK "8.4", not "9.0", you may want to update your
recent changes advertising the latter. Thank you.

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

* Re: Inconsistency between org-store-link-functions and org-store-link
  2015-11-06 20:26 ` Nicolas Goaziou
@ 2015-11-07 12:47   ` Aaron Ecay
  2015-11-07 16:14     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Aaron Ecay @ 2015-11-07 12:47 UTC (permalink / raw)
  To: Nicolas Goaziou, orgmode

Hi Nicolas,

2015ko azaroak 6an, Nicolas Goaziou-ek idatzi zuen:
> 
> Hello,
> 
> Aaron Ecay <aaronecay@gmail.com> writes:
> 
>> The docstring of org-store-link-functions says: “Each function will be
>> called in turn until one returns a non-nil value.”  However, the code of
>> org-store-link actually calls all the functions, and if more than one
>> returns a non-nil value raises a prompt asking the user to choose (and
>> then calls that function a second time).
>> 
>> Should we change the code to match the doc, or vice versa?
> 
> The former, IMO.

OK, will do.

[...]

> 
> P.S: next release is AFAIK "8.4", not "9.0", you may want to update your
> recent changes advertising the latter. Thank you.

I’m confused.  My impression of Bastien’s decision
<http://mid.gmane.org/87oai4w69i.fsf@gnu.org> is that Org 8.4 should be
compatible with emacs 23.  Master contains changes that require emacs 24
(to give one example, files that require cl-lib).  So, I thought master
was going to become Org 9.0, and the 8.4 release would be cut from
either maint or an earlier revision of master before emacs24-only
changes were introduced.

-- 
Aaron Ecay

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

* Re: Inconsistency between org-store-link-functions and org-store-link
  2015-11-07 12:47   ` Aaron Ecay
@ 2015-11-07 16:14     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2015-11-07 16:14 UTC (permalink / raw)
  To: orgmode

Aaron Ecay <aaronecay@gmail.com> writes:

> I’m confused.  My impression of Bastien’s decision
> <http://mid.gmane.org/87oai4w69i.fsf@gnu.org> is that Org 8.4 should be
> compatible with emacs 23.  Master contains changes that require emacs 24
> (to give one example, files that require cl-lib).  So, I thought master
> was going to become Org 9.0, and the 8.4 release would be cut from
> either maint or an earlier revision of master before emacs24-only
> changes were introduced.

Fair enough. I changed references to Org 8.4 into references to Org 9.0
in master.

Regards,

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

end of thread, other threads:[~2015-11-07 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-06 18:23 Inconsistency between org-store-link-functions and org-store-link Aaron Ecay
2015-11-06 20:26 ` Nicolas Goaziou
2015-11-07 12:47   ` Aaron Ecay
2015-11-07 16:14     ` Nicolas Goaziou

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