From: Glenn Morris Date: Mon, 22 Oct 2012 02:18:58 +0000 (-0700) Subject: * doc/lispref/tips.texi (Coding Conventions): Recommend cl-lib over cl. X-Git-Tag: emacs-24.2.90~211^2~16 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5fb904b0e48f82da36b4d54b467450a0b39afa27;p=emacs.git * doc/lispref/tips.texi (Coding Conventions): Recommend cl-lib over cl. --- diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index acf6f8a51ff..b99eca41644 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-10-22 Glenn Morris + + * tips.texi (Coding Conventions): Recommend cl-lib over cl. + 2012-10-15 Chong Yidong * macros.texi (Defining Macros): defmacro is now a macro. diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 0c7282c3586..4336baa128f 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -120,15 +120,18 @@ library when needed. This way people who don't use those aspects of your file do not need to load the extra library. @item -Please don't require the @code{cl} package of Common Lisp extensions at -run time. Use of this package is optional, and it is not part of the -standard Emacs namespace. If your package loads @code{cl} at run time, -that could cause name clashes for users who don't use that package. - -However, there is no problem with using the @code{cl} package at -compile time, with @code{(eval-when-compile (require 'cl))}. That's +If you need Common Lisp extensions, use the @code{cl-lib} library +rather than the old @code{cl} library. The latter does not +use a clean namespace (i.e., its definitions do not +start with a @samp{cl-} prefix). If your package loads @code{cl} at +run time, that could cause name clashes for users who don't use that +package. + +There is no problem with using the @code{cl} package at @emph{compile} +time, with @code{(eval-when-compile (require 'cl))}. That's sufficient for using the macros in the @code{cl} package, because the -compiler expands them before generating the byte-code. +compiler expands them before generating the byte-code. It is still +better to use the more modern @code{cl-lib} in this case, though. @item When defining a major mode, please follow the major mode