< CL's main entry is (require 'cl-lib) since GNU Emacs 24.3. -- XueFuqiao
> CL's main entry has been (require 'cl-lib) since GNU Emacs 24.3. -- XueFuqiao
It is already loaded when you start XEmacs. For GNU Emacs, you need to add the following to your ~/.emacs file:
There is a separate InfoMode manual for this package. See Info node (cl). Some aspects of EmacsLisp can’t be changed or emulated transparently: you don’t get packages, you don’t get lexical scoping unless you ask for it with
‘lexical-let’, you don’t get keyword arguments unless you define your function with
‘defun*’ and so on. See the Info node (cl)Common Lisp Compatibility.
Here are some things extending
loopover alists and plists
Packages distributed within GNU Emacs don’t use cl at runtime (on account of its size, and potential future namespace clashes), only via byte-compiled macros (see the introduction to the cl manual on this). That doesn’t mean you must avoid cl altogether if you aspire to get code into Emacs, indeed major packages like CcMode and Gnus happily use cl; just ensure it’s only through macro forms (such as
‘loop’). The easiest way to do that is
(eval-when-compile (require 'cl))
eval-when-compile gets cl loaded when compiling, and the macros expand at that time, leaving no reference to cl in the
.elc (if only macros forms are used). If running uncompiled cl is loaded, but that’s ok since there are currently no technical issues.
CL’s main entry has been (require ‘cl-lib) since GNU Emacs 24.3. – XueFuqiao