>>> But then it will not run during byte-compilation. >> Yeah, I was assuming that you had replaced all `require`s with >> `org-require-with-shadowcheck`, but that's probably not what you'd done. > That's exactly what I have done.
Ah. The issue comes from the fact that `require` is treated specially by the byte compiler, so if you define `org-require-with-shadowcheck` as a function it indeed won't do quite the same as `require`. The way `require` is treated specially by the byte-compiler only affects top-level uses (making them behave as if they're wrapped inside `eval-and-compile`). So you want to use `eval-and-compile` only for those `require`s that are at top-level. Personally, I'd only change those `require`s that load `org-macs`, which should be enough to cover almost all cases (and I wouldn't just silently reload the file, but I'd also emit a warning explaining that we detected a bad situation and using a workaround since that workaround is not 100% reliable anyway). Stefan