From: Achim Gratz <Stromeko@nexgo.de>
To: emacs-orgmode@gnu.org
Subject: Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
Date: Wed, 19 Dec 2012 16:09:20 +0100 [thread overview]
Message-ID: <878v8ujcyn.fsf@Rainer.invalid> (raw)
In-Reply-To: 87obhrrl44.fsf@bzg.ath.cx
Bastien writes:
>> (if (locate-library "org-loaddefs")
>> (require 'org-loaddefs)
> ^^^^^^^^^^^^^
>
> You don't need this, there is (load "org-loaddefs.el" t t) in org.el.
Well, yes he does when he is using Org from Git. It's a wash when he's
using builtin Org from Emacs and potentially wrong when he's using Org
from ELPA, depending on if he does it before or after
package-initialize.
You've expressed before that you want to know why this is so. As a
reminder, Org from Git currently has all its autoload definitions in
org-loaddefs. Lets look at this for all possible Emacs versions:
XEmacs and Emacs 22 don't come with a builtin Org version. You have no
autoloads including none for the entry point for the major mode until
you load org-loaddefs (or org).
Emacs 23, 24.1 and 24.2 comes with older versions of Org that don't even
have org-loaddefs. All autoloads for the builtin version are in
loaddefs from Emacs and they are already loaded when the user
initialization stuff is run. Some things in those autoloads happen to
point to the correct libraries, but only by chance. Generally one has
to assume that the autoloads that are present have the wrong docstring,
point to the wrong file and present an outdated API. To fix this, one
must load org-loaddefs (or org).
Emacs 24.3 will come with a newer version of Org, but still older than
the one from Git. Only part of the autoloads are present in loaddefs,
the rest would be pulled in from the bundled org-loaddefs when org is
loaded. That is the reason why one does not need to do that when only
using the builtin Org version. Again however, these builtin autoload
definitions from loaddefs must be presumed outdated for Org from Git, so
it is still necessary to load org-loaddefs (or org) in the initalization
code to make sure the correct first-level autoloads take precedence even
when it is assured that all autoload code-paths also trigger loading of
org (I don't think that this can be easily guaranteed and I know of no
tool that would allow one to analyse).
Last but not least, if one uses Org from ELPA, then it must be arranged
that org-loaddefs gets loaded only after package-initialize, otherwise
you'll end up with the correct first-level autoloads, but outdated
second-level autoloads (that get replaced with the current ones when org
gets loaded).
Regards,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
DIY Stuff:
http://Synth.Stromeko.net/DIY.html
next prev parent reply other threads:[~2012-12-19 15:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-18 22:48 Opening (for the first time) a 10-line Org doc takes 4 seconds Sebastien Vauban
2012-12-18 23:33 ` Bastien
2012-12-19 9:05 ` Sebastien Vauban
2012-12-23 8:52 ` Bastien
2012-12-19 15:09 ` Achim Gratz [this message]
2013-01-05 11:39 ` Bastien
2013-01-05 12:01 ` Achim Gratz
2013-01-05 12:37 ` Bastien
2013-01-05 13:23 ` Achim Gratz
2013-01-05 13:37 ` Bastien
2013-01-16 1:49 ` Bernt Hansen
2013-01-16 17:04 ` Achim Gratz
2013-01-05 12:39 ` Bastien
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=878v8ujcyn.fsf@Rainer.invalid \
--to=stromeko@nexgo.de \
--cc=emacs-orgmode@gnu.org \
/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).