Fix fontification bugs with constructors and const.
[bpt/emacs.git] / lisp / emacs-lisp / cl-lib.el
index 9175dd7..e826cf4 100644 (file)
@@ -1,6 +1,6 @@
 ;;; cl-lib.el --- Common Lisp extensions for Emacs  -*- lexical-binding: t -*-
 
-;; Copyright (C) 1993, 2001-201 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001-2013 Free Software Foundation, Inc.
 
 ;; Author: Dave Gillespie <daveg@synaptics.com>
 ;; Version: 1.0
 ;; package which should always be present.
 
 
-;;; Future notes:
-
-;; Once Emacs 19 becomes standard, many things in this package which are
-;; messy for reasons of compatibility can be greatly simplified.  For now,
-;; I prefer to maintain one unified version.
-
-
 ;;; Change Log:
 
 ;; Version 2.02 (30 Jul 93):
@@ -156,8 +149,8 @@ an element already on the list.
                  ;; earlier and should have triggered them already.
                  (with-no-warnings ,place)
                (setq ,place (cons ,var ,place))))
-       (list 'setq place (cl-list* 'cl-adjoin x place keys)))
-    (cl-list* 'cl-callf2 'cl-adjoin x place keys)))
+       `(setq ,place (cl-adjoin ,x ,place ,@keys)))
+    `(cl-callf2 cl-adjoin ,x ,place ,@keys)))
 
 (defun cl--set-elt (seq n val)
   (if (listp seq) (setcar (nthcdr n seq) val) (aset seq n val)))
@@ -271,11 +264,7 @@ so that they are registered at compile-time as well as run-time."
 
 ;;; Numbers.
 
-(defun cl-floatp-safe (object)
-  "Return t if OBJECT is a floating point number.
-On Emacs versions that lack floating-point support, this function
-always returns nil."
-  (and (numberp object) (not (integerp object))))
+(define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4")
 
 (defsubst cl-plusp (number)
   "Return t if NUMBER is positive."
@@ -725,6 +714,9 @@ If ALIST is non-nil, the new pairs are prepended to it."
 
 ;;;###autoload
 (progn
+  ;; The `assert' macro from the cl package signals
+  ;; `cl-assertion-failed' at runtime so always define it.
+  (define-error 'cl-assertion-failed (purecopy "Assertion failed"))
   ;; Make sure functions defined with cl-defsubst can be inlined even in
   ;; packages which do not require CL.  We don't put an autoload cookie
   ;; directly on that function, since those cookies only go to cl-loaddefs.
@@ -736,9 +728,10 @@ If ALIST is non-nil, the new pairs are prepended to it."
   (put 'cl-defsubst 'doc-string-elt 3)
   (put 'cl-defstruct 'doc-string-elt 2))
 
-(load "cl-loaddefs" nil 'quiet)
-
 (provide 'cl-lib)
+(or (load "cl-loaddefs" 'noerror 'quiet)
+    ;; When bootstrapping, cl-loaddefs hasn't been built yet!
+    (require 'cl-macs))
 
 ;; Local variables:
 ;; byte-compile-dynamic: t