Ihor Radchenko <yanta...@posteo.net> writes:

> Stefan Monnier <monn...@iro.umontreal.ca> writes:
>
>> BTW, rather than unloading, `package.el` relies on forcibly "re"loading
>> from the new version the already loaded files from the old version.
>> It suffers from a different set of problem :-(
>> [ I suspect `defvar` is the main problem for that solution.  ]
>
> Could it be possible to force require use certain package version and
> automatically re-load a package when older version is being loaded?

After trying several more approaches, I now came up with yet another
idea. Instead of fiddling with load internals, compilation, or
load-path, what about making sure that Org libraries include version
info directly?

Every library will have

(require 'org-foo-9.X "org-foo")
(require 'org-bar-9.X "org-bar")
...
(provide 'org-lib)
(provide 'org-lib-9.X)

Then, we will make sure that the right version of the library is always
loaded. Simply because (provide 'org-lib-9.X) will be unique for
different Org releases.

There might still be a problem where we solve cyclic dependencies by
using declare-function, but those places should be fixed anyway, sooner
or later.

WDYT?

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

Reply via email to