* Re: [Stefan Monnier] Requiring `ol` in `org-real`s autoloads
[not found] <87h6mgozsz.fsf@gmail.com>
@ 2023-10-24 14:51 ` Amy Grinn
2023-10-24 16:57 ` Stefan Monnier
0 siblings, 1 reply; 2+ messages in thread
From: Amy Grinn @ 2023-10-24 14:51 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Kyle Meyer, emacs-devel
Hi Stefan,
Thanks for the contribution. I agree with your approach and like your
solution, so I will apply the patch.
Best,
Amy
Amy Grinn <grinntaylor@gmail.com> writes:
> -------------------- Start of forwarded message --------------------
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> To: Taylor Grinn <grinntaylor@gmail.com>
> Cc: Kyle Meyer <kyle@kyleam.com>, emacs-devel@gnu.org
> Subject: Requiring `ol` in `org-real`s autoloads
> Date: Thu, 19 Oct 2023 16:57:34 -0400
>
> In `org-real.el` I see:
>
> ;;;###autoload
> (require 'ol)
>
> This is bad for several reasons, such as the fact that it slows down
> startup by forcing the load of part of Org, but more importantly it
> breaks Org:
>
> The order in which packages are activated is not deterministic,
> so it's totally possible that `org-real` gets loaded before
> `org` gets activated (I know, because that's how I bumped into this
> problem), meaning that the above (require 'ol) will load the `ol` (and
> `org-compat` etc...) that's bundled with Emacs, while later on the
> non-bundled Org package will be activated at which point it will burp
> because you can't have two different versions of Org loaded at the same
> time (e.g. currently the `org-compat` in Emacs doesn't define
> `org--flatten-tree`, so loading `org-src` from the unbundled Org
> package will break if you've loaded the `org-compat` that's bundled in
> your Emacs).
>
> The patch below seems to fix the problem.
>
>
> Stefan
>
> diff --git a/org-real.el b/org-real.el
> index 35604ed7f1..9c45d0e0d8 100644
> --- a/org-real.el
> +++ b/org-real.el
> @@ -1,6 +1,6 @@
> ;;; org-real.el --- Keep track of real things as org-mode links -*- lexical-binding: t -*-
>
> -;; Copyright (C) 2021 Free Software Foundation, Inc.
> +;; Copyright (C) 2021-2023 Free Software Foundation, Inc.
>
> ;; Author: Taylor Grinn <grinntaylor@gmail.com>
> ;; Version: 1.0.6
> @@ -49,7 +49,6 @@
>
> ;;;; Requirements
>
> -;;;###autoload
> (require 'ol)
>
> (require 'boxy)
> @@ -333,9 +332,10 @@ diagram."
> ;;;; `org-insert-link' configuration
>
> ;;;###autoload
> -(org-link-set-parameters "real"
> - :follow #'org-real-follow
> - :complete #'org-real-complete)
> +(with-eval-after-load 'ol
> + (org-link-set-parameters "real"
> + :follow #'org-real-follow
> + :complete #'org-real-complete))
>
> ;;;###autoload
> (defun org-real-follow (url &rest _)
>
> -------------------- End of forwarded message --------------------
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Stefan Monnier] Requiring `ol` in `org-real`s autoloads
2023-10-24 14:51 ` [Stefan Monnier] Requiring `ol` in `org-real`s autoloads Amy Grinn
@ 2023-10-24 16:57 ` Stefan Monnier
0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2023-10-24 16:57 UTC (permalink / raw)
To: Amy Grinn; +Cc: Kyle Meyer, emacs-devel
> Thanks for the contribution. I agree with your approach and like your
> solution, so I will apply the patch.
Great, thank you,
Stefan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-10-24 16:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <87h6mgozsz.fsf@gmail.com>
2023-10-24 14:51 ` [Stefan Monnier] Requiring `ol` in `org-real`s autoloads Amy Grinn
2023-10-24 16:57 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.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).