emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Opening (for the first time) a 10-line Org doc takes 4 seconds
@ 2012-12-18 22:48 Sebastien Vauban
  2012-12-18 23:33 ` Bastien
  0 siblings, 1 reply; 13+ messages in thread
From: Sebastien Vauban @ 2012-12-18 22:48 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hello,

Looking at how to improve my Org config, regarding speed, I notice that it
takes 4.22 s to open a simple 10-line Org file *for the first time* (when Org
wasn't loaded yet). The reason is that it requires a big amount of packages,
those requiring themselves many others, and so on.

Do you find such a time normal, or too much?

How to redo the test:

    emacs -q -l .emacs-minimal.el

where `.emacs-minimal.el' is:

--8<---------------cut here---------------start------------->8---
(message "Loading Minimal Emacs...")

(defconst em/emacs-load-time-start (float-time))

;; change the pathnames appropriately!
(add-to-list 'load-path (expand-file-name "~/src/org-mode/lisp"))
(add-to-list 'load-path (expand-file-name "~/src/org-mode/contrib/lisp"))

(add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
(if (locate-library "org-loaddefs")
    (require 'org-loaddefs)
  (require 'org-install))

(defadvice require (around require-around)
  "Leave a trace of packages being loaded."
  (let* ((feature (ad-get-arg 0))
         (require-depth (or (and (boundp 'require-depth) require-depth)
                            0))
         (prefix (concat (make-string (* 2 require-depth) ? ) "")))
    (cond ((featurep feature)
           (message "%s%s -> %s... Done" ;; already loaded
                    prefix
                    (if load-file-name
                        (file-name-base load-file-name)
                      "nil?")
                    feature)
           (setq ad-return-value feature))
          (t
           (let ((lvn/time-start))
             (message "%s%s -> %s..."
                      prefix
                      (if load-file-name
                          (file-name-base load-file-name)
                        "nil?")
                      feature)
             (setq lvn/time-start (float-time))
             (let ((require-depth (1+ require-depth)))
               ad-do-it))))))

(ad-activate 'require)

(find-file "TODO.org")

(message "Loading Minimal Emacs... Done (in %.2f s)"
         (- (float-time) em/emacs-load-time-start))
--8<---------------cut here---------------end--------------->8---

and `TODO.org' is some simple Org file such as:

--8<---------------cut here---------------start------------->8---
#+TITLE:     Simple Org file
#+LANGUAGE:  en-us

* Emacs

** TODO Improve performance

Check out how to improve overall perf by putting chunks of code inside
(eval-after-load) forms.
--8<---------------cut here---------------end--------------->8---

That results in all the following packages to be loaded:

--8<---------------cut here---------------start------------->8---
Loading Minimal Emacs...
.emacs-minimal -> help-fns... Done [2 times]
org -> cl...
  cl -> cl-lib... Done
  cl -> macroexp... Done
org -> gnus-sum...
  gnus-sum -> gnus...
    gnus -> wid-edit...
    gnus -> mm-util...
      mm-util -> mail-prsvr...
      mm-util -> timer... Done
    gnus -> nnheader...
      nnheader -> mail-utils...
      nnheader -> mm-util... Done
      nnheader -> gnus-util...
        gnus-util -> time-date... Done
    gnus -> gnus-util... Done
    gnus -> nnheader... Done
    gnus -> gnus-ems...
  gnus-sum -> gnus-group...
    gnus-group -> gnus... Done
    gnus-group -> gnus-start...
      gnus-start -> gnus... Done
      gnus-start -> gnus-win...
        gnus-win -> gnus... Done
        gnus-win -> gnus-util... Done
      gnus-start -> gnus-int...
        gnus-int -> gnus... Done
        gnus-int -> message...
          message -> mailheader...
          message -> gmm-utils...
          message -> mail-utils... Done
          message -> mailabbrev...
          message -> mail-parse...
            mail-parse -> mail-prsvr... Done
            mail-parse -> ietf-drums...
              ietf-drums -> mm-util... Done
            mail-parse -> rfc2231...
              rfc2231 -> ietf-drums... Done
              rfc2231 -> rfc2047...
                rfc2047 -> mm-util... Done
                rfc2047 -> ietf-drums... Done
                rfc2047 -> mail-prsvr... Done
                rfc2047 -> rfc2045...
                  rfc2045 -> ietf-drums... Done
            mail-parse -> rfc2047... Done
            mail-parse -> rfc2045... Done
          message -> mml...
            mml -> mm-util... Done
            mml -> mm-bodies...
              mm-bodies -> mm-util... Done
              mm-bodies -> rfc2047... Done
              mm-bodies -> mm-encode...
                mm-encode -> mail-parse... Done
            mml -> mm-encode... Done
            mml -> mm-decode...
              mm-decode -> mail-parse... Done
              mm-decode -> mm-bodies... Done
            mml -> mml-sec...
          message -> rfc822...
          message -> format-spec...
          cl-macs -> cl-lib... Done
          cl-macs -> macroexp... Done
          cl-macs -> gv...
            gv -> macroexp... Done
          message -> idna...
        gnus-int -> gnus-range...
      gnus-start -> gnus-spec...
        gnus-spec -> gnus... Done
      gnus-start -> gnus-range... Done
      gnus-start -> gnus-util... Done
    gnus-group -> nnmail...
      nnmail -> gnus... Done
      nnmail -> nnheader... Done
      nnmail -> message... Done
      nnmail -> gnus-util... Done
      nnmail -> mail-source...
        mail-source -> format-spec... Done
        mail-source -> mm-util... Done
        mail-source -> message... Done
      nnmail -> mm-util... Done
      nnmail -> gnus-int... Done
    gnus-group -> gnus-spec... Done
    gnus-group -> gnus-int... Done
    gnus-group -> gnus-range... Done
    gnus-group -> gnus-win... Done
    gnus-group -> gnus-undo...
      gnus-undo -> gnus-util... Done
      gnus-undo -> gnus... Done
    gnus-group -> gmm-utils... Done
    gnus-group -> time-date... Done
    gnus-group -> gnus-ems... Done
  gnus-sum -> gnus-spec... Done
  gnus-sum -> gnus-range... Done
  gnus-sum -> gnus-int... Done
  gnus-sum -> gnus-undo... Done
  gnus-sum -> gnus-util... Done
  gnus-sum -> gmm-utils... Done
  gnus-sum -> mm-decode... Done
  gnus-sum -> nnoo...
    nnoo -> nnheader... Done
org -> calendar...
  calendar -> cal-menu...
    cal-menu -> calendar... Done
org -> find-func...
org -> format-spec... Done
Loading d:/home/sva/src/org-mode/lisp/org-loaddefs.el (source)...done
org -> ob-emacs-lisp...
  ob-emacs-lisp -> ob...
    ob -> cl... Done
    ob -> ob-eval...
      ob-eval -> cl... Done
    ob -> org-macs...
    ob -> org-compat...
      org-compat -> cl... Done
      org-compat -> org-macs... Done
  ob-emacs-lisp -> ob-comint...
    ob-comint -> ob... Done
    ob-comint -> org-compat... Done
    ob-comint -> comint...
      comint -> ring...
      comint -> ansi-color...
      comint -> regexp-opt... Done
    ob-comint -> cl... Done
org -> org-compat... Done
org -> org-version...
org -> outline...
org -> noutline... Done
org -> time-date... Done
org -> easymenu... Done
org -> overlay... Done
org -> org-macs... Done
org -> org-entities...
  org-entities -> org-macs... Done
  org-entities -> cl... Done
org -> org-faces...
  org-faces -> org-macs... Done
  org-faces -> org-compat... Done
org -> org-list...
  org-list -> cl... Done
  org-list -> org-macs... Done
  org-list -> org-compat... Done
org -> org-pcomplete...
  org-pcomplete -> cl... Done
  org-pcomplete -> org-macs... Done
  org-pcomplete -> org-compat... Done
  org-pcomplete -> pcomplete...
    pcomplete -> comint... Done
org -> org-src...
  org-src -> org-macs... Done
  org-src -> org-compat... Done
  org-src -> ob-keys...
    ob-keys -> ob... Done
  org-src -> ob-comint... Done
  org-src -> cl... Done
org -> org-footnote...
  org-footnote -> cl... Done
  org-footnote -> org-macs... Done
  org-footnote -> org-compat... Done
org -> ob... Done
org -> ob-table...
  ob-table -> ob... Done
org -> ob-lob...
  ob-lob -> cl... Done
  ob-lob -> ob... Done
  ob-lob -> ob-table... Done
org -> ob-ref...
  ob-ref -> ob... Done
  ob-ref -> cl... Done
org -> ob-tangle...
  ob-tangle -> ob... Done
  ob-tangle -> org-src... Done
  ob-tangle -> cl... Done
org -> ob-comint... Done
org -> ob-keys... Done
org -> font-lock... Done
org -> macroexp... Done [2 times]
org -> help-fns... Done [2 times]
org -> bytecomp...
  bytecomp -> backquote... Done
  bytecomp -> macroexp... Done
  bytecomp -> cconv...
org -> warnings...
byte-opt -> bytecomp... Done
byte-opt -> macroexp... Done
org -> help-fns... Done [2 times]
org -> macroexp... Done [2 times]
.emacs-minimal -> org-bbdb...
  org-bbdb -> org... Done
  org-bbdb -> cl... Done
.emacs-minimal -> org-bibtex...
  org-bibtex -> org... Done
  org-bibtex -> bibtex...
    bibtex -> button... Done
  org-bibtex -> cl... Done
  org-bibtex -> org-compat... Done
.emacs-minimal -> org-docview...
  org-docview -> org... Done
.emacs-minimal -> org-gnus...
  org-gnus -> org... Done
  org-gnus -> gnus-util... Done
  org-gnus -> gnus-sum... Done
.emacs-minimal -> org-info...
  org-info -> org... Done
.emacs-minimal -> org-jsinfo...
  org-jsinfo -> org-exp...
    org-exp -> org... Done
    org-exp -> org-macs... Done
    org-exp -> org-agenda...
      org-agenda -> org... Done
      org-agenda -> org-macs... Done
      org-agenda -> cl... Done
      org-agenda -> macroexp... Done
    org-exp -> ob-exp...
      ob-exp -> ob... Done
      ob-exp -> cl... Done
    org-exp -> org-src... Done
    org-exp -> cl... Done
    org-exp -> macroexp... Done [2 times]
  org-jsinfo -> org-html...
    org-html -> org-exp... Done
    org-html -> format-spec... Done
    org-html -> cl... Done
.emacs-minimal -> org-irc...
  org-irc -> org... Done
.emacs-minimal -> org-mew...
  org-mew -> org... Done
.emacs-minimal -> org-mhe...
  org-mhe -> org... Done
.emacs-minimal -> org-rmail...
  org-rmail -> org... Done
.emacs-minimal -> org-vm...
  org-vm -> org... Done
.emacs-minimal -> org-w3m...
  org-w3m -> org... Done
.emacs-minimal -> org-wl...
  org-wl -> org... Done
OVERVIEW
Loading vc-svn...done
Loading vc-git...done
.emacs-minimal -> vc-git... Done [2 times]
Loading Minimal Emacs... Done (in 4.22 s)
--8<---------------cut here---------------end--------------->8---

what takes 4.22 seconds on my machine.

If all of the above packages are somehow always required, then, yes, that's
normal I guess.

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  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-19 15:09   ` Achim Gratz
  0 siblings, 2 replies; 13+ messages in thread
From: Bastien @ 2012-12-18 23:33 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Sébastien,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> 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.

Are your org elisp files compiled?

What results do you have without the advice on `require'?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  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
  1 sibling, 1 reply; 13+ messages in thread
From: Sebastien Vauban @ 2012-12-19  9:05 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Bastien,

Bastien wrote:
> "Sebastien Vauban" 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.

OK. And `org.el' is loaded[1] because of the major-mode association to the
`.org' files, then, right?

Anyway, that does not have impacts here.

> Are your org elisp files compiled?

Nope. Never.

> What results do you have without the advice on `require'?

I've now ran 5 tests with each config:

    | without advice | with advice |
    |----------------+-------------|
    |           3.78 |        3.95 |
    |           3.73 |        3.86 |
    |           3.76 |        3.83 |
    |           3.80 |        3.83 |
    |           3.81 |        3.94 |
    |----------------+-------------|
    |           3.78 |        3.88 |
    #+TBLFM: @7$1..@7$2=vmean(@I..@-I);%.2f

That is less than 3% time penalty for the logs done during the execution of
all the `require'.

Best regards,
  Seb

[1] BTW, why not a `require' instead?

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2012-12-18 23:33 ` Bastien
  2012-12-19  9:05   ` Sebastien Vauban
@ 2012-12-19 15:09   ` Achim Gratz
  2013-01-05 11:39     ` Bastien
  1 sibling, 1 reply; 13+ messages in thread
From: Achim Gratz @ 2012-12-19 15:09 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2012-12-19  9:05   ` Sebastien Vauban
@ 2012-12-23  8:52     ` Bastien
  0 siblings, 0 replies; 13+ messages in thread
From: Bastien @ 2012-12-23  8:52 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



Hi Sébastien,

"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> OK. And `org.el' is loaded[1] because of the major-mode association to the
> `.org' files, then, right?

Right.

> [1] BTW, why not a `require' instead?

About (load "org-loaddefs.el" t t) ?

Because it is auto-generated.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2012-12-19 15:09   ` Achim Gratz
@ 2013-01-05 11:39     ` Bastien
  2013-01-05 12:01       ` Achim Gratz
  0 siblings, 1 reply; 13+ messages in thread
From: Bastien @ 2013-01-05 11:39 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Hi Achim,

Achim Gratz <Stromeko@nexgo.de> writes:

>> 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.

I use Org from Git and I don't have 

  (load "org-loaddefs.el" t t)

in my .emacs.el.  I simply have:

  (add-to-list 'load-path "~/install/git/org-mode/lisp/")

before any Org configuration and *all* autoloads are correct.

My understanding is that users who don't use "make install"
will have to do the same and add the correct load-path, which
will in turn produce the correct autoloads.  Am I right?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2013-01-05 11:39     ` Bastien
@ 2013-01-05 12:01       ` Achim Gratz
  2013-01-05 12:37         ` Bastien
  2013-01-05 12:39         ` Bastien
  0 siblings, 2 replies; 13+ messages in thread
From: Achim Gratz @ 2013-01-05 12:01 UTC (permalink / raw)
  To: emacs-orgmode

Bastien writes:
> I use Org from Git and I don't have 
>
>   (load "org-loaddefs.el" t t)
>
> in my .emacs.el.  I simply have:
>
>   (add-to-list 'load-path "~/install/git/org-mode/lisp/")
>
> before any Org configuration and *all* autoloads are correct.

Only with a recent Emacs 24 and it really only works for code paths that
load org.el early enough.  I cannot stress often enough that the
autoload definitions are not absolute and _this_ is the part that makes
things really tricky.  They will follow changes in load-path, but only
if the library name stays the same.  Again, the example to try is this:

Move an autoloaded function from one file to another in the Git
directory.  Re-generate the autoload file.  Re-start Emacs, try to call
that function and see Emacs try to load the _old_ file (because that's
the autoload definition it has at that point).  Re-start Emacs again,
load org-loaddefs with the proper load-path in place and see that it
loads the new file.

> My understanding is that users who don't use "make install"
> will have to do the same and add the correct load-path, which
> will in turn produce the correct autoloads.  Am I right?

I'm not sure I understand you correctly.  All of the following
conditions must hold for this to work:

- the load-path is set up to point to the Git work-tree first and no
  functions in the org namespace have been called before doing so

- the org-loaddefs.el in the Git worktree is up-to-date

- none of the invoked functions have their library-name changed in the
  Git worktree

- all code-paths must trigger loading of org (and thus org-loaddefs)
  before invoking further autoloads


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

SD adaptation for Waldorf rackAttack V1.04R1:
http://Synth.Stromeko.net/Downloads.html#WaldorfSDada

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2013-01-05 12:01       ` Achim Gratz
@ 2013-01-05 12:37         ` Bastien
  2013-01-05 13:23           ` Achim Gratz
  2013-01-05 12:39         ` Bastien
  1 sibling, 1 reply; 13+ messages in thread
From: Bastien @ 2013-01-05 12:37 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Bastien writes:
>> I use Org from Git and I don't have 
>>
>>   (load "org-loaddefs.el" t t)
>>
>> in my .emacs.el.  I simply have:
>>
>>   (add-to-list 'load-path "~/install/git/org-mode/lisp/")
>>
>> before any Org configuration and *all* autoloads are correct.
>
> Only with a recent Emacs 24 and it really only works for code paths that
> load org.el early enough.

What earlier version of Emacs does not behave like the current Emacs 24
trunk with respect to this issue, and more importantly, *why* is it so?

Thanks,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2013-01-05 12:01       ` Achim Gratz
  2013-01-05 12:37         ` Bastien
@ 2013-01-05 12:39         ` Bastien
  1 sibling, 0 replies; 13+ messages in thread
From: Bastien @ 2013-01-05 12:39 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> I'm not sure I understand you correctly.  All of the following
> conditions must hold for this to work:
>
> - the load-path is set up to point to the Git work-tree first and no
>   functions in the org namespace have been called before doing so
>
> - the org-loaddefs.el in the Git worktree is up-to-date
>
> - none of the invoked functions have their library-name changed in the
>   Git worktree

Okay.  This are normal conditions to me, and we can document this if
necessary.

> - all code-paths must trigger loading of org (and thus org-loaddefs)
>   before invoking further autoloads

I'm not sure what you mean by "code-paths".

You mean that no non-org library should call an org-* function before 
the load-path for org-mode is set correctly?

-- 
 Bastien

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2013-01-05 12:37         ` Bastien
@ 2013-01-05 13:23           ` Achim Gratz
  2013-01-05 13:37             ` Bastien
  0 siblings, 1 reply; 13+ messages in thread
From: Achim Gratz @ 2013-01-05 13:23 UTC (permalink / raw)
  To: emacs-orgmode

Bastien writes:
> What earlier version of Emacs does not behave like the current Emacs 24
> trunk with respect to this issue,

Emacs 22 doesn't have any autoloads for Org at all, so nothing works.

Emacs 23 has some autoload definitions from its built-in Org version(s),
but there have been many changes to function/library name pairs in later
versions of Org, so I'd generally expect this to be broken, but maybe
not overtly if org gets loaded first (but org-version is not present as
an autoloaded function for example).

Emacs 24.x should be mostly clean, but there have been some additional
autoloads in Babel that would be missing.

> and more importantly, *why* is it so?

Uh… iff any autoload definitions exist, they may or may not be
associated with the correct library name.  They also may or may not have
the correct doc string or number of parameters.  You have to load these
definitions from the correct files, they don't get picked up
automatically.  The files that get loaded at startup are defined in
<prefix>/<emacs-version>/lisp/loadup.el (this is either loaddefs.el or
ldefs-boot.el, depending on whether the bootstrap or the normal Emacs is
started).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2013-01-05 13:23           ` Achim Gratz
@ 2013-01-05 13:37             ` Bastien
  2013-01-16  1:49               ` Bernt Hansen
  0 siblings, 1 reply; 13+ messages in thread
From: Bastien @ 2013-01-05 13:37 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Achim Gratz <Stromeko@nexgo.de> writes:

> Bastien writes:
>> What earlier version of Emacs does not behave like the current Emacs 24
>> trunk with respect to this issue,
>
> Emacs 22 doesn't have any autoloads for Org at all, so nothing works.
>
> Emacs 23 has some autoload definitions from its built-in Org version(s),
> but there have been many changes to function/library name pairs in later
> versions of Org, so I'd generally expect this to be broken, but maybe
> not overtly if org gets loaded first (but org-version is not present as
> an autoloaded function for example).
>
> Emacs 24.x should be mostly clean, but there have been some additional
> autoloads in Babel that would be missing.

All this I know -- I'm a bit stubborn but I read and learn :)

Let me restate my question.

Let's say that someone uses Emacs 23.2 with Org from Git.  This user
has this line in her ~/.emacs.el before any other Org configuration:

  (add-to-list 'load-path "~/git/org-mode/lisp/")

My assumption is that C-h f org-mode RET will show that org-mode is
an autoloaded function in "~/git/org-mode/lisp/" -- as it does for
me (using Emacs 24).

Is that so?  (I can't test Org with Emacs 23.2 right now.)

-- 
 Bastien

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2013-01-05 13:37             ` Bastien
@ 2013-01-16  1:49               ` Bernt Hansen
  2013-01-16 17:04                 ` Achim Gratz
  0 siblings, 1 reply; 13+ messages in thread
From: Bernt Hansen @ 2013-01-16  1:49 UTC (permalink / raw)
  To: Bastien; +Cc: Achim Gratz, emacs-orgmode

Bastien <bzg@altern.org> writes:

> Achim Gratz <Stromeko@nexgo.de> writes:
>
>> Bastien writes:
>>> What earlier version of Emacs does not behave like the current Emacs 24
>>> trunk with respect to this issue,
>>
>> Emacs 22 doesn't have any autoloads for Org at all, so nothing works.
>>
>> Emacs 23 has some autoload definitions from its built-in Org version(s),
>> but there have been many changes to function/library name pairs in later
>> versions of Org, so I'd generally expect this to be broken, but maybe
>> not overtly if org gets loaded first (but org-version is not present as
>> an autoloaded function for example).
>>
>> Emacs 24.x should be mostly clean, but there have been some additional
>> autoloads in Babel that would be missing.
>
> All this I know -- I'm a bit stubborn but I read and learn :)
>
> Let me restate my question.
>
> Let's say that someone uses Emacs 23.2 with Org from Git.  This user
> has this line in her ~/.emacs.el before any other Org configuration:
>
>   (add-to-list 'load-path "~/git/org-mode/lisp/")
>
> My assumption is that C-h f org-mode RET will show that org-mode is
> an autoloaded function in "~/git/org-mode/lisp/" -- as it does for
> me (using Emacs 24).
>
> Is that so?  (I can't test Org with Emacs 23.2 right now.)

For the record here is the output on my Emacs:

GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of 2013-01-08
on murphy, modified by Debian

Current git head:  release_7.9.3d-826-gbe0d87d

,----[ minimal.emacs ]
| (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
| (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode))
| (require 'org)
| 
| (global-set-key "\C-cl" 'org-store-link)
| (global-set-key "\C-ca" 'org-agenda)
| (global-set-key "\C-cb" 'org-iswitchb)
`----

,----[ minimal-emacs ]
| #!/bin/sh
| TESTEL=
| TESTFILE=/tmp/test.el
| if test -e $TESTFILE
| then
|   TESTEL="-l /tmp/test.el"
| fi
| emacs -q -l ~/minimal.emacs $TESTEL $1
`----

,----[ C-h f org-mode RET ]
| org-mode is an interactive compiled Lisp function in `org.el'.
| 
| (org-mode)
| 
| Outline-based notes management and organizer, alias
| "Carsten's outline-mode for keeping track of everything."
| 
| Org-mode develops organizational tasks around a NOTES file which
| contains information about projects as plain text.  Org-mode is
| implemented on top of outline-mode, which is ideal to keep the content
| of large files well structured.  It supports ToDo items, deadlines and
| time stamps, which magically appear in the diary listing of the Emacs
| calendar.  Tables are easily created with a built-in table editor.
| Plain text URL-like links connect to websites, emails (VM), Usenet
| messages (Gnus), BBDB entries, and any files related to the project.
| For printing and sharing of notes, an Org-mode file (or a part of it)
| can be exported as a structured ASCII or HTML file.
| 
| The following commands are available:
| 
| key             binding
| ---             -------
| 
| C-a		org-beginning-of-line
| C-c		Prefix Command
| C-e		org-end-of-line
| TAB		org-cycle
| C-j		org-return-indent
| C-k		org-kill-line
| RET		org-return
| C-y		org-yank
| ESC		Prefix Command
| |		org-force-self-insert
| C-#		org-table-rotate-recalc-marks
| C-'		org-cycle-agenda-files
| C-,		org-cycle-agenda-files
| <C-S-down>	org-shiftcontroldown
| <C-S-left>	org-shiftcontrolleft
| <C-S-return>	org-insert-todo-heading-respect-content
| <C-S-right>	org-shiftcontrolright
| <C-S-up>	org-shiftcontrolup
| <C-return>	org-insert-heading-respect-content
| <C-tab>		org-force-cycle-archived
| <M-S-down>	org-shiftmetadown
| <M-S-left>	org-shiftmetaleft
| <M-S-return>	org-insert-todo-heading
| <M-S-right>	org-shiftmetaright
| <M-S-up>	org-shiftmetaup
| <M-down>	org-metadown
| <M-left>	org-metaleft
| <M-return>	org-meta-return
| <M-right>	org-metaright
| <M-up>		org-metaup
| <S-down>	org-shiftdown
| <S-iso-lefttab>			org-shifttab
| <S-left>	org-shiftleft
| <S-return>	org-table-copy-down
| <S-right>	org-shiftright
| <S-tab>		org-shifttab
| <S-up>		org-shiftup
| <backtab>	org-shifttab
| <remap>		Prefix Command
| <tab>		org-cycle
| 
| M-TAB		pcomplete
| M-RET		org-insert-heading
| C-M-t		org-transpose-element
| M-a		org-backward-sentence
| M-e		org-forward-sentence
| M-h		org-mark-element
| M-{		org-backward-element
| M-}		org-forward-element
| 
| C-c C-a		org-attach
| C-c C-b		org-backward-heading-same-level
| C-c C-c		org-ctrl-c-ctrl-c
| C-c C-d		org-deadline
| C-c C-e		org-export
| C-c C-f		org-forward-heading-same-level
| C-c C-j		org-goto
| C-c C-k		org-kill-note-or-show-branches
| C-c C-l		org-insert-link
| C-c RET		org-ctrl-c-ret
| C-c C-o		org-open-at-point
| C-c C-q		org-set-tags-command
| C-c C-r		org-reveal
| C-c C-s		org-schedule
| C-c C-t		org-todo
| C-c C-v		Prefix Command
| C-c C-w		org-refile
| C-c C-x		Prefix Command
| C-c C-y		org-evaluate-time-range
| C-c C-z		org-add-note
| C-c ESC		Prefix Command
| C-c C-^		org-up-element
| C-c C-_		org-down-element
| C-c SPC		org-table-blank-field
| C-c !		org-time-stamp-inactive
| C-c #		org-update-statistics-cookies
| C-c $		org-archive-subtree
| C-c %		org-mark-ring-push
| C-c &		org-mark-ring-goto
| C-c '		org-edit-special
| C-c *		org-ctrl-c-star
| C-c +		org-table-sum
| C-c ,		org-priority
| C-c -		org-ctrl-c-minus
| C-c .		org-time-stamp
| C-c /		org-sparse-tree
| C-c :		org-toggle-fixed-width-section
| C-c ;		org-toggle-comment
| C-c <		org-date-from-calendar
| C-c =		org-table-eval-formula
| C-c >		org-goto-calendar
| C-c ?		org-table-field-info
| C-c @		org-mark-subtree
| C-c [		org-agenda-file-to-front
| C-c \		org-match-sparse-tree
| C-c ]		org-remove-file
| C-c ^		org-sort
| C-c `		org-table-edit-field
| C-c {		org-table-toggle-formula-debugger
| C-c |		org-table-create-or-convert-from-region
| C-c }		org-table-toggle-coordinate-overlays
| C-c ~		org-table-create-with-table.el
| C-c C-*		org-list-make-subtree
| 
| <remap> <delete-backward-char>	org-delete-backward-char
| <remap> <delete-char>		org-delete-char
| <remap> <outline-backward-same-level>
| 				org-backward-heading-same-level
| <remap> <outline-demote>	org-demote-subtree
| <remap> <outline-forward-same-level>
| 				org-forward-heading-same-level
| <remap> <outline-insert-heading>
| 				org-ctrl-c-ret
| <remap> <outline-mark-subtree>	org-mark-subtree
| <remap> <outline-promote>	org-promote-subtree
| <remap> <self-insert-command>	org-self-insert-command
| <remap> <show-branches>		org-kill-note-or-show-branches
| <remap> <show-subtree>		org-show-subtree
| <remap> <transpose-words>	org-transpose-words
| 
| C-c C-M-l	org-insert-all-links
| C-c M-w		org-copy
| 
| C-c C-v C-a	org-babel-sha1-hash
| C-c C-v C-b	org-babel-execute-buffer
| C-c C-v C-c	org-babel-check-src-block
| C-c C-v C-d	org-babel-demarcate-block
| C-c C-v C-e	org-babel-execute-maybe
| C-c C-v C-f	org-babel-tangle-file
| C-c C-v TAB	org-babel-view-src-block-info
| C-c C-v C-j	org-babel-insert-header-arg
| C-c C-v C-l	org-babel-load-in-session
| C-c C-v C-n	org-babel-next-src-block
| C-c C-v C-o	org-babel-open-src-block-result
| C-c C-v C-p	org-babel-previous-src-block
| C-c C-v C-r	org-babel-goto-named-result
| C-c C-v C-s	org-babel-execute-subtree
| C-c C-v C-t	org-babel-tangle
| C-c C-v C-u	org-babel-goto-src-block-head
| C-c C-v C-v	org-babel-expand-src-block
| C-c C-v C-x	org-babel-do-key-sequence-in-edit-buffer
| C-c C-v C-z	org-babel-switch-to-session
| C-c C-v ESC	Prefix Command
| C-c C-v I	org-babel-view-src-block-info
| C-c C-v a	org-babel-sha1-hash
| C-c C-v b	org-babel-execute-buffer
| C-c C-v c	org-babel-check-src-block
| C-c C-v d	org-babel-demarcate-block
| C-c C-v e	org-babel-execute-maybe
| C-c C-v f	org-babel-tangle-file
| C-c C-v g	org-babel-goto-named-src-block
| C-c C-v h	org-babel-describe-bindings
| C-c C-v i	org-babel-lob-ingest
| C-c C-v j	org-babel-insert-header-arg
| C-c C-v l	org-babel-load-in-session
| C-c C-v n	org-babel-next-src-block
| C-c C-v o	org-babel-open-src-block-result
| C-c C-v p	org-babel-previous-src-block
| C-c C-v r	org-babel-goto-named-result
| C-c C-v s	org-babel-execute-subtree
| C-c C-v t	org-babel-tangle
| C-c C-v u	org-babel-goto-src-block-head
| C-c C-v v	org-babel-expand-src-block
| C-c C-v x	org-babel-do-key-sequence-in-edit-buffer
| C-c C-v z	org-babel-switch-to-session-with-code
| 
| C-c C-x C-a	org-archive-subtree-default
| C-c C-x C-b	org-toggle-checkbox
| C-c C-x C-c	org-columns
| C-c C-x C-d	org-clock-display
| C-c C-x C-f	org-emphasize
| C-c C-x TAB	org-clock-in
| C-c C-x C-j	org-clock-goto
| C-c C-x C-l	org-preview-latex-fragment
| C-c C-x RET	Prefix Command
| C-c C-x C-n	org-next-link
| C-c C-x C-o	org-clock-out
| C-c C-x C-p	org-previous-link
| C-c C-x C-q	org-clock-cancel
| C-c C-x C-r	org-clock-report
| C-c C-x C-s	org-advertized-archive-subtree
| C-c C-x C-t	org-toggle-time-stamp-overlays
| C-c C-x C-u	org-dblock-update
| C-c C-x C-v	org-toggle-inline-images
| C-c C-x C-w	org-cut-special
| C-c C-x C-x	org-clock-in-last
| C-c C-x C-y	org-paste-special
| C-c C-x C-z	org-resolve-clocks
| C-c C-x ESC	Prefix Command
| C-c C-x !	org-reload
| C-c C-x ,	org-timer-pause-or-continue
| C-c C-x -	org-timer-item
| C-c C-x .	org-timer
| C-c C-x 0	org-timer-start
| C-c C-x :	org-timer-cancel-timer
| C-c C-x ;	org-timer-set-timer
| C-c C-x <	org-agenda-set-restriction-lock
| C-c C-x >	org-agenda-remove-restriction-lock
| C-c C-x A	org-archive-to-archive-sibling
| C-c C-x E	org-inc-effort
| C-c C-x G	org-feed-goto-inbox
| C-c C-x P	org-set-property-and-value
| C-c C-x [	org-reftex-citation
| C-c C-x \	org-toggle-pretty-entities
| C-c C-x _	org-timer-stop
| C-c C-x a	org-toggle-archive-tag
| C-c C-x b	org-tree-to-indirect-buffer
| C-c C-x c	org-clone-subtree-with-time-shift
| C-c C-x d	org-insert-drawer
| C-c C-x e	org-set-effort
| C-c C-x f	org-footnote-action
| C-c C-x g	org-feed-update-all
| C-c C-x i	org-insert-columns-dblock
| C-c C-x o	org-toggle-ordered-property
| C-c C-x p	org-set-property
| C-c C-x v	org-copy-visible
| 
| C-c C-v C-M-h	org-babel-mark-block
| 
| C-c C-x C-M-v	org-redisplay-inline-images
| C-c C-x M-w	org-copy-special
| 
| C-c C-x RET g	org-mobile-pull
| C-c C-x RET p	org-mobile-push
| 
| 
| 
| In addition to any hooks its parent mode `outline-mode' might have run,
| this mode runs the hook `org-mode-hook', as the final step
| during initialization.
`----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Opening (for the first time) a 10-line Org doc takes 4 seconds
  2013-01-16  1:49               ` Bernt Hansen
@ 2013-01-16 17:04                 ` Achim Gratz
  0 siblings, 0 replies; 13+ messages in thread
From: Achim Gratz @ 2013-01-16 17:04 UTC (permalink / raw)
  To: emacs-orgmode

Bernt Hansen writes:
> For the record here is the output on my Emacs:
>
> GNU Emacs 23.2.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1) of 2013-01-08
> on murphy, modified by Debian
>
> Current git head:  release_7.9.3d-826-gbe0d87d

I can't check Emacs 23.2 right now, but Emacs 23.4 comes with Org
version 6.33x installed.  Just looking at what loaddefs.el has defined
as autoloads from org.el:

;;;### (autoloads (org-customize org-reload org-require-autoloaded-modules
;;;;;;  org-submit-bug-report org-cycle-agenda-files org-iswitchb
;;;;;;  org-map-entries org-open-link-from-string org-open-at-point-global
;;;;;;  org-insert-link-global org-store-link org-run-like-in-org-mode
;;;;;;  turn-on-orgstruct++ turn-on-orgstruct orgstruct-mode org-global-cycle
;;;;;;  org-mode) "org" "org/org.el" (20712 11830))
;;; Generated autoloads from org/org.el

Now compare that with the same section generated for a recent Git version:

;;;### (autoloads (org-customize org-reload org-submit-bug-report
;;;;;;  org-cycle-agenda-files org-switchb org-open-link-from-string
;;;;;;  org-open-at-point-global org-insert-link-global org-store-link
;;;;;;  org-run-like-in-org-mode turn-on-orgstruct++ turn-on-orgstruct
;;;;;;  orgstruct-mode org-global-cycle org-cycle org-mode org-clock-persistence-insinuate
;;;;;;  turn-on-orgtbl org-version org-babel-do-load-languages) "org"
;;;;;;  "org.el" (20726 54443))
;;; Generated autoloads from org.el

So yes, "org-mode" is autoloaded, but some other stuff that should be
isn't.  Things get more interesting with the autoloads that are defined
in the earlier version, but not anymore in the newer.  In the case of
org-iswitchb the autoload still works since it is defaliased to
org-switchb in the same file.  If it were removed, you'd get an error
when trying to use it, the same if it was moved to another file (since
the autoload definition says to look in "org" it will not look in
"org-whatever-i-have-been-moved-to".  Also if the file in question has
been renamed ("org-exp-blocks" exists in 6.33x, but not in a current
version), then those autoloads will also not work.

Having Emacs pull in the current autoload definitions will ensure that
all current autoloads are pointing to the correct file, so if you are
using only those everything is fine.  It still leaves some definitions
for functions that may not exist anymore, but you would not be able to
use them anyway, so while not squeaky-clean, it will work in practise.
There is one problem that all this still doesn't solve: if a previously
autoloaded function has no current autoload definition and the file it
used to reside in has been renamed, then Emacs will happily descend into
the load-path to load the function along with that old file.  This is
why Emacs itself should provide a way to de-activate a built-in package
when a newer version has been installed so that these stale autoload
definitions aren't present after initialization (it is probably possible
to traverse load-history to remove superseded autoload definitions, but
there is no ready-made function to do this AFAIK).


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-01-16 17:05 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).