emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] missing autoloads / (void-variable org-version)


From: Achim Gratz
Subject: [O] missing autoloads / (void-variable org-version)
Date: Thu, 26 Apr 2012 07:52:59 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Since my Makefile branch was merged I've been getting flak for breaking
certain setups.  Now, the change didn't actually break them, but I did
make (perhaps foolishly) a deliberate decision to make that particular
breakage fatal rather than silent.  It would be very easy to continue to
paper over the breakage and pretend things are working when they're not.
What irritates me greatly is that quite a few of the people that insist
on this "solution" are the ones who would have to deal with the
Heisenbugs thus introduced.  So let me explain once more what is broken:


Consider a core emacs library "test", consisting of the main "test.el"
and auxiliary functions in "test-aux.el".  The main entry points are in
"test.el" and thus you'd "(require 'test)" in your .emacs to activate
the package.  The auxiliary functions are not needed in "test.el", so to
make them available to the user or whatever function that needs to call
them, these entry points are autoloaded (let's say the only function
there is "test-aux").  When this package gets installed into emacs, the
autoload forms will be extracted into "loaddefs.el" in the main lisp
directory.  You can then call "(test-aux)" without having to explicitly
load "test-aux.el", since the autoload form has registered that
association and will load "test-aux.el" automatically when encountering
the first use of the function test-aux.

Now the development version of this same package gets installed locally.
The load-path is altered so that emacs finds the development version
first.  Thus "(require 'test)" will load the development version.  If
you now try to "(test-aux)", what happens?  Autoload still has all the
associations from "loaddefs.el" and thus tries to load "test-aux.el",
which will end up finding the file in the development version. So all is
well, right?

Development progresses and as "test.el" grows larger some functions are
moved to "test-extra.el".  Also, "test-aux.el" is split into
"test-aux1.el", while the function test-aux (yes, the same name as the
old, but with different arguments) is moved to "test-aux2.el".  The
functions in "test-extra.el" become unavailable since autoload doesn't
know about them — unless you explicitely load "test-aux.el" of course.
Also, the calls to "(test-aux)" flip-flop between calling the old and
new test-aux: if that call is made before a load of "test-aux2.el",
emacs will look for it in "test-aux.el" and only find that file in its
own install directory.  If you happened to have loaded "test-aux2.el"
(maybe due to a "(require 'test-aux2)" in "test-extra.el"), then the new
definition of "(test-aux)" will be used.  So you will have irritated
users and developers alike and bugs that don't reproduce (or only with
certain versions of emacs that happen to have specific versions of
library test integrated).

The real solution of course is to re-generate the autoloads file for the
development version and explicitely load it, say "(require
'test-install)".

That still leaves an open flank if you delete both a function and it's
associated source file from the development version: if someone then
uses "(test-deleted-function)", the autoload definition in Emacs will
happily find the stale source it has installed since it is not shadowed
anymore by the same file in the development version.  I've no idea yet
if that is fixable without touching the actual installation and how
difficult it would be, but that's a minor worry at this point.


If you've made it here, please weigh in on whether you want to have
things correctly fixed or simply papered over.  Either one is fine with
me...


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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]