From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Requiring `ol` in `org-real`s autoloads Date: Thu, 19 Oct 2023 16:57:34 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12621"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Kyle Meyer , emacs-devel@gnu.org To: Taylor Grinn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 19 22:58:48 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qta6R-000314-Rt for ged-emacs-devel@m.gmane-mx.org; Thu, 19 Oct 2023 22:58:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qta5Q-0007if-P5; Thu, 19 Oct 2023 16:57:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qta5M-0007iP-Vl for emacs-devel@gnu.org; Thu, 19 Oct 2023 16:57:41 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qta5K-0006sx-NP for emacs-devel@gnu.org; Thu, 19 Oct 2023 16:57:40 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 708D680073; Thu, 19 Oct 2023 16:57:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1697749055; bh=qFdTAvQymR+Xcb9+wFjefKW1hawf3L/ghs9/ydv7cdg=; h=From:To:Cc:Subject:Date:From; b=a89bMkTqxf2L3+QmdZBdzat8pP3Ece+nS6MJRsE7uarstIMoFoucpMbiX6P+aaMN3 K4hbjk9lrq2gfs+rkLLR9lEDx7wkZCgI0v+pXpvtH1Axupi2AR12+U9Z4L3vHfU9s4 HuUUSEE13w5OAVmAPVyJel6TLo+hyJ/MumsxB9H1Ju7xHqjBFbbqxw1URmwBash3S9 Pu63TDCQ3YWPc2D7FTtAxHv3lMqPvvCUHY1+EHvsBs8P9+021iVdBaylcntGPUqLDc q3SwnYuN4fOMrVxj/dIGhO9zJWApECGvrGRsrhNIbElbn7dEor8Xoa5HTtVMMIrQY/ d36IxRQteohow== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 1A50B8001F; Thu, 19 Oct 2023 16:57:35 -0400 (EDT) Original-Received: from pastel (unknown [45.72.216.111]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E88AC120296; Thu, 19 Oct 2023 16:57:34 -0400 (EDT) Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:311605 Archived-At: --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=org-real.patch 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 ;; 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 _) --=-=-=--