emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Backwards compatibility (was: Re: [PATCH] ob-shell: consistent prefix)
@ 2024-01-20 16:03 Matt
  2024-01-20 18:54 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Matt @ 2024-01-20 16:03 UTC (permalink / raw)
  To: ihor radchenko; +Cc: emacs-orgmode

 ---- On Tue, 16 Jan 2024 14:10:00 +0100  Ihor Radchenko  wrote --- 

 > I do not mind changing the names, except that we must not break
 > backwards compatibility.  In particular, the non-private function
 > and variable names that were present in the latest Org stable
 > release must be either supplied with an alias or declared
 > obsolete. Otherwise, the third-party code using the old names will
 > be broken.

How far does backwards compatibility extend with regard to Org itself?  For the next version, for all time, or something else?  

The rule I infer from your comment is, "renamed symbols must be aliased."  This implies that any arguments associated with the symbol are the same after the name change.  How do we handle changes in function APIs?  I'm thinking of something like =org-babel-execute:shell= and =org-babel-sh-evaluate= where it would make sense to refactor the =stdin= and =cmdline= parameters.

--
Matt Trzcinski
Emacs Org contributor (ob-shell)
Learn more about Org mode at https://orgmode.org
Support Org development at https://liberapay.com/org-mode



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

* Re: Backwards compatibility (was: Re: [PATCH] ob-shell: consistent prefix)
  2024-01-20 16:03 Backwards compatibility (was: Re: [PATCH] ob-shell: consistent prefix) Matt
@ 2024-01-20 18:54 ` Ihor Radchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Ihor Radchenko @ 2024-01-20 18:54 UTC (permalink / raw)
  To: Matt; +Cc: emacs-orgmode

Matt <matt@excalamus.com> writes:

> How far does backwards compatibility extend with regard to Org itself?
> For the next version, for all time, or something else?

Usually, until next major release (we should have major releases more
frequently in future).

However, we often keep compat code in place even much later if it does
not stay on the way of maintenance or implementing new features.

> The rule I infer from your comment is, "renamed symbols must be
> aliased." This implies that any arguments associated with the symbol
> are the same after the name change. How do we handle changes in
> function APIs? I'm thinking of something like
> =org-babel-execute:shell= and =org-babel-sh-evaluate= where it would
> make sense to refactor the =stdin= and =cmdline= parameters.

1. When we need to add new arguments, we usually add them as optional
   arguments at the end.

2. When we need to remove arguments, we just keep the relevant arglist
   names as _ (indicating that the argument is unused).

3. When API is changing more significantly, we obsolete the old function
   code and keep it in org-compat. Then, we implement a completely new
   function with a new name, and use it throughout Org mode.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2024-01-20 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-20 16:03 Backwards compatibility (was: Re: [PATCH] ob-shell: consistent prefix) Matt
2024-01-20 18:54 ` Ihor Radchenko

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