Stefan Monnier <monn...@iro.umontreal.ca> writes: >> My attempt to use shadowcheck idea you proposed failed with some very >> strange errors and I gave up. >> See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=62762#311 > > For this one I can see the problem. You define: > > (defmacro org-require-with-shadowcheck (feature) > [...] > `(eval-and-compile ...)) > > so it will behave like a function, except that it's also > executed during macroexpansion, so the (require 'org-element) within > `org-set-modules` will be eagerly executed while loading `org.el` :-( > > You should define `org-require-with-shadowcheck` as a function (just > like `require`).
But then it will not run during byte-compilation. And compilation will yield [...] org-datetree.el:278:14: Warning: the function ‘org-cut-subtree’ is not known to be defined. org-datetree.el:264:22: Warning: the function ‘org-up-heading-safe’ is not known to be defined. org-datetree.el:263:35: Warning: the function ‘org-back-to-heading’ is not known to be defined. org-datetree.el:257:37: Warning: the function ‘org-time-string-to-time’ is not known to be defined. org-datetree.el:237:6: Warning: the function ‘org-paste-subtree’ is not known to be defined. [...] and no single macro from other library will be expanded. -- 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>