emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: unload-feature


From: Luc Teirlinck
Subject: Re: unload-feature
Date: Tue, 6 Jan 2004 21:31:54 -0600 (CST)

Richard Stallman wrote:

   unload-feature is not designed to restore old definitions.
   The idea is that packages should not define names defined
   elsewhere.

   cl is a bizarre exception.

What about giving all these Emacs-cl name clashes a common definition
and use `(featurep 'cl-19)' to let that one single function or macro
decide on the actual behavior?  (The cl-19 vs cl is related to some
cl-macs subtlety.)  We could put all of them in a common file together
with `declare'.  That way `unload-feature' _would_ work and I believe
that this way people would also better realize that there are those
two versions around and that a:

(eval-when-compile (require 'cl))

does more than just add functions: it _redefines_ some basic Elisp
functions (in a usually harmless way, but still).

So something similar to what I proposed for `declare':

(eval-when-compile
  (require 'cl-19 "cl"))

;;;###autoload
(defmacro declare (&rest specs)
  "Do not evaluate any arguments and return nil.
Treated as a declaration when used at the right place in a
`defmacro' form.  \(See Info anchor `(elisp)Definition of declare'.)
Also treated as a declaration by various functions and macros of
the `cl' package."
  (with-no-warnings
   (and (featurep 'cl-19)
   (cl-compiling-file)
   (while specs
     (if (listp cl-declare-stack) (push (car specs) cl-declare-stack))
       (cl-do-proclaim (pop specs) nil))))
  nil)


Note: The anchor referred to above has not yet been installed in CVS.

Sincerely,

Luc.





reply via email to

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