emacs-devel
[Top][All Lists]
Advanced

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

Re: unload-feature questions and thoughts


From: Juanma Barranquero
Subject: Re: unload-feature questions and thoughts
Date: Mon, 5 Feb 2007 01:10:36 +0100

On 2/4/07, David Kastrup <address@hidden> wrote:

It defines tex-site-unload-hook already.  But "whatever is necessary"
pretty much means restoring all functions overwritten by AUCTeX, and
there is no point in not using the autoload unloader for that.

In fact (and this is not a proposal, at least not now), the current
working of `unload-feature' is a bit puzzling. Instead of running
either `FEATURE-unload-hook' (if found) or its normal heuristics, it'd
be better if it ran a FEATURE-unload-function, which would return t to
stop, or nil to *also* use the function's current heuristics. That
way, a package could define a FEATURE-unload-function to undo unusual
things, and leave the burden of the unloading to `unload-feature'.

I imagine it could be faked right now with:

 (defun myfeature-unload-hook ()
  ;; Undo unusual things, then:
  (let ((fun (symbol-function 'myfeature-unload-hook)))
    (fmakunbound 'myfeature-unload-hook)
    (ignore-errors (unload-feature 'myfeature))
    (fset 'myfeature-unload-hook fun)))

which is quite ugly, but it should work.

                   /L/e/k/t/u




reply via email to

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