]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/cl.el
(rx-syntax): Move sregex style syntax to code.
[gnu-emacs] / lisp / emacs-lisp / cl.el
index 9a5677237a86315ce594ec8adc1eebd902cf1812..b098a467f9f518219a82a768da6314674c9fb4be 100644 (file)
@@ -108,6 +108,10 @@ printer proceeds to the next function on the list.
 This variable is not used at present, but it is defined in hopes that
 a future Emacs interpreter will be able to use it.")
 
+(defvar cl-unload-hook '(cl-cannot-unload)
+  "Prevent unloading the feature `cl', since it does not work.")
+(defun cl-cannot-unload ()
+  (error "Cannot unload the feature `cl'"))
 
 ;;; Predicates.
 
@@ -178,7 +182,7 @@ Keywords supported:  :test :test-not :key"
 (defun cl-set-substring (str start end val)
   (if end (if (< end 0) (incf end (length str)))
     (setq end (length str)))
-  (if (< start 0) (incf start str))
+  (if (< start 0) (incf start (length str)))
   (concat (and (> start 0) (substring str 0 start))
          val
          (and (< end (length str)) (substring str end))))
@@ -229,6 +233,10 @@ right when EXPRESSION calls an ordinary Emacs Lisp function that returns just
 one value."
   (apply function expression))
 
+(defalias 'multiple-value-call 'apply
+  "Apply FUNCTION to ARGUMENTS, taking multiple values into account.
+This implementation only handles the case where there is only one argument.")
+
 (defsubst nth-value (n expression)
   "Evaluate EXPRESSION to get multiple values and return the Nth one.
 This handles multiple values in Common Lisp style, but it does not work
@@ -575,9 +583,10 @@ Keywords supported:  :test :test-not :key"
   "Non-nil means don't make CL functions autoload.")
 
 ;;; Autoload the other portions of the package.
-;; We want to replace the basic versions of dolist, dotimes below.
+;; We want to replace the basic versions of dolist, dotimes, declare below.
 (fmakunbound 'dolist)
 (fmakunbound 'dotimes)
+(fmakunbound 'declare)
 (mapcar (function
         (lambda (set)
           (let ((file (if cl-fake-autoloads "<none>" (car set))))
@@ -674,8 +683,8 @@ Keywords supported:  :test :test-not :key"
 (defun cl-hack-byte-compiler ()
   (if (and (not cl-hacked-flag) (fboundp 'byte-compile-file-form))
       (progn
-       (cl-compile-time-init)   ; in cl-macs.el
-       (setq cl-hacked-flag t))))
+       (setq cl-hacked-flag t)         ; Do it first, to prevent recursion.
+       (cl-compile-time-init))))       ; In cl-macs.el.
 
 ;;; Try it now in case the compiler has already been loaded.
 (cl-hack-byte-compiler)
@@ -691,4 +700,5 @@ Keywords supported:  :test :test-not :key"
 
 (run-hooks 'cl-load-hook)
 
+;;; arch-tag: 5f07fa74-f153-4524-9303-21f5be125851
 ;;; cl.el ends here