Re: Some libraries does (require 'cl)
In [EMAIL PROTECTED] Lennart Borgman (gmail) wrote: (require 'cl) without (eval-when-compile ...). Is not that incorrect? More files doing this: [...] tramp.el tramp.el doesn't seem to need cl at run time. Actually I have no problem on ftp and ssh connections using the following workaround in my ~/.emacs file: (let ((features (cons 'cl features))) (require 'tramp)) (provide 'tramp) ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Some libraries does (require 'cl)
It seems to me that idlwave.el loads cl only at compile time. Why do you think otherwise? ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Some libraries does (require 'cl)
It looks like mh-e tries to avoid loading cl at run time. Would someone like to verify that this works? It seems that the only other real problems are viper and tramp. I've asked the maintainers to fix them in the trunk, and I want to put those fixes into 22.2. ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Some libraries does (require 'cl)
Richard Stallman wrote: It seems to me that idlwave.el loads cl only at compile time. Why do you think otherwise? Yes, there is a second (require 'cl) on line 4157. ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Some libraries does (require 'cl)
On Fri, May 18 2007, Lennart Borgman (gmail) wrote: Lennart Borgman (gmail) wrote: (require 'cl) without (eval-when-compile ...). Is not that incorrect? [...] More files doing this: [...] For the file from lisp/gnus/, these forms are no-ops in Emacs 21 and up. (In the development version of Gnus, we have removed these forms because we o longer support Emacs 21 there.) gnus-registry.el ,[ gnus-registry.el ] | (eval-when-compile (require 'cl)) | [...] | ;; Function(s) missing in Emacs 20 | (when (memq nil (mapcar 'fboundp '(puthash))) | (require 'cl) | (unless (fboundp 'puthash) | ;; alias puthash is missing from Emacs 20 cl-extra.el | (defalias 'puthash 'cl-puthash))) ` spam-stat.el ,[ spam-stat.el ] | ;; Functions missing in Emacs 20 | | (when (memq nil (mapcar 'fboundp | '(gethash hash-table-count make-hash-table | mapc puthash))) | (require 'cl) | (unless (fboundp 'puthash) | ;; alias puthash is missing from Emacs 20 cl-extra.el | (defalias 'puthash 'cl-puthash))) ` Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/ ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Some libraries does (require 'cl)
However there is one thing I do not understand and that other people have asked: If one want to use functions from cl.el (not only macros), how does one do then? Is (eval-when-compile (require 'cl)) sufficient then? Solution 1: you don't! Solution 2: you make sure that your call to the CL function can be replaced by non-CL functions, using CL's compiler-macros. (a compiler-macro is basically a compiler directive that tells how to optimize/compile particular calls to a function. E.g. you can add a compiler-macro to the function * such that (* 1 x) is replaced by just x. IIRC the CL `list*' function has a compiler-macro that replaces most calls to it by a combination of `cons' calls). Stefan ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Some libraries does (require 'cl)
Lennart Borgman (gmail) wrote: Some libraries (iswitchb.el for example) does (require 'cl) without (eval-when-compile ...). Is not that incorrect? In GNU Emacs 22.1.50.1 (i386-mingw-nt5.1.2600) of 2007-05-06 More files doing this: lucid.el viper.el gnus-registry.el spam-stat.el mh-acros.el (in the macro mh-require-cl too) eudc.el tramp.el Maybe cc-lang.el? idlwave.el ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
Re: Some libraries does (require 'cl)
Richard Stallman wrote: Some libraries (iswitchb.el for example) does (require 'cl) without (eval-when-compile ...). Is not that incorrect? It is incorrect, in general. However, in the case of iswitchb, it is a no-op: ;; CL needed for cadr and last (if (not (and (fboundp 'cadr) (fboundp 'last))) (require 'cl)) The current Emacs has `cadr' and `last' as primitives, so cl will never be loaded. There are some more in a comment I made to this in another message. However there is one thing I do not understand and that other people have asked: If one want to use functions from cl.el (not only macros), how does one do then? Is (eval-when-compile (require 'cl)) sufficient then? ___ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug