Bug in new vc

Ville Skyttä scop at xemacs.org
Sat Feb 3 06:36:12 EST 2007


On Friday 02 February 2007 17:25, Stephen J. Turnbull wrote:

> Now, vc-svn-registered is a strange beast: it gets defun'ed in the
> autoload file to a function which loads vc-svn and then calls
> vc-svn-registered, which has been redefined in vc-svn.  I suspect the
> 21.4 byte-compiler or maybe the bytecode interpreter gets confused by
> these shenanigans.  I think this is excessively tricky, but it should
> work.

I suppose the reason for this is that unless the vc-BACKEND-registered defun 
for a specific backend is fully embedded into auto-autoloads.el, the whole 
backend gets always loaded when vc-registered in vc-hooks.el calls it.  And 
of course, if a file being opened is not handled by that backend, that 
backend was loaded pretty much for nothing.

If on the other hand there's a fully selfcontained vc-BACKEND-registered 
available through autoloads, it can be called without pulling in the backend 
and the actual backend loaded only when some basic checks performed by the 
selfcontained one indicates that the likelihood of the full backend being 
actually needed is sufficently big.

> I haven't tried it yet, but I wouldn't be surprised if in vc-svn.el
>
> 1.  marking the defvar of vc-svn-admin-directory with an autoload cookie
> 2.  getting rid of the magical autoload of vc-svn-registered
> 3.  marking the regular defun of vc-svn-registered
>
> works around the bytecode bug in 21.4.

By 3) above do you mean marking the whole vc-svn-registered function, 
essentially copy-pasting it and just prepending ;;;###autoload to every line 
of it in the copy, or just keeping one copy and marking it with an autoload 
cookie as usual?

If copy-pasting the whole defun, I suppose vc-svn-admin-directory would need 
the autoload cookie indeed.  With other backends it could be much more than 
just a single defvar.  If just one copy marked with an autoload cookie as 
usual, I guess vc-svn-admin-directory wouldn't need the cookie, but the 
drawback would vc-hooks.el dragging along all handled backends right from the 
start as discussed above.

I think I'll play a bit with renaming the "embedded autoloads copies" of 
vc-BACKEND-registered to something else so the redefining of 
vc-BACKEND-registered doesn't happen and see if that makes a difference.

If not, perhaps KISS and shrug off the penalty of all backends being pulled in 
for now.



More information about the XEmacs-Beta mailing list