From: Ihor Radchenko <yantar92@posteo.net>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Tom Gillespie <tgbugs@gmail.com>,
"emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>,
Bastien <bzg@gnu.org>
Subject: Re: org-assert-version considered harmful
Date: Fri, 18 Aug 2023 14:26:10 +0000 [thread overview]
Message-ID: <877cpsa0l9.fsf@localhost> (raw)
In-Reply-To: <jwvttswfp0n.fsf-monnier+emacs@gnu.org>
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>> 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.
I see. Then, I can resolve the issue simply by
(put 'org-require-with-shadowcheck 'byte-hunk-handler 'byte-compile-file-form-require)
> 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).
I first want to try the most generous way to reveal any potential
pitfalls.
Like recursive load that is still happening when I do
1. emacs -Q
2. M-x org-version (built-in)
3. M-: (push "/path/to/git/version/of/org/lisp" load-path)
4. M-x org-mode
5. Observe recursive loading error
--
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>
next prev parent reply other threads:[~2023-08-18 14:26 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 18:27 org-assert-version considered harmful Stefan Monnier
2022-09-13 1:52 ` Ihor Radchenko
2022-09-13 2:16 ` Timothy
2022-09-13 2:53 ` Stefan Monnier
2022-09-13 3:18 ` Ihor Radchenko
2022-09-13 13:26 ` Stefan Monnier
2022-09-13 14:42 ` Ihor Radchenko
2022-09-13 16:13 ` Stefan Monnier
2022-09-14 2:46 ` Ihor Radchenko
2022-09-14 14:08 ` Stefan Monnier
2022-09-14 19:13 ` Tim Cross
2022-09-25 2:39 ` Bastien
2022-09-25 3:15 ` Ihor Radchenko
2022-09-25 4:27 ` Timothy
2022-09-25 9:37 ` Bastien
2022-09-25 9:55 ` Ihor Radchenko
2022-09-25 10:24 ` Bastien
2022-09-25 11:10 ` Ihor Radchenko
2022-09-25 11:26 ` Bastien
2022-09-25 12:16 ` Ihor Radchenko
2022-09-25 13:18 ` Bastien
2022-09-26 11:15 ` Ihor Radchenko
2022-09-25 12:20 ` Ihor Radchenko
2022-09-25 13:16 ` Bastien
2022-09-26 11:29 ` Ihor Radchenko
2022-09-27 21:35 ` Bastien
2022-10-31 14:11 ` Cook, Malcolm
2022-10-31 20:16 ` [External] : " Daniel Ortmann
2022-10-31 20:40 ` Cook, Malcolm
2022-10-31 23:16 ` Tim Cross
2022-11-01 6:09 ` Ihor Radchenko
2022-11-02 20:42 ` Cook, Malcolm
2022-11-03 7:51 ` Ihor Radchenko
2022-11-03 17:30 ` Cook, Malcolm
2022-12-02 8:16 ` Tom Gillespie
2022-12-02 6:45 ` Ihor Radchenko
2022-12-04 4:22 ` Tom Gillespie
2022-12-04 4:33 ` Stefan Monnier
2022-12-04 11:12 ` Ihor Radchenko
2023-08-16 11:08 ` Ihor Radchenko
2023-08-16 12:30 ` Stefan Monnier
2023-08-16 12:41 ` Ihor Radchenko
2023-08-16 13:41 ` Stefan Monnier
2023-08-18 9:37 ` Ihor Radchenko
2023-08-18 13:19 ` Stefan Monnier
2023-08-18 13:33 ` Ihor Radchenko
2023-08-18 13:45 ` Stefan Monnier
2023-08-18 14:26 ` Ihor Radchenko [this message]
2023-08-18 14:29 ` Ihor Radchenko
2023-08-17 16:43 ` Max Nikulin
2023-08-17 16:59 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877cpsa0l9.fsf@localhost \
--to=yantar92@posteo.net \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=tgbugs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).