Sync up with r21-4-15.
[chise/xemacs-chise.git.1] / lisp / bytecomp.el
index cf3e917..f5be73d 100644 (file)
@@ -1284,7 +1284,7 @@ otherwise pop it")
     (setq unreferenced (nreverse unreferenced))
     (while unreferenced
       (byte-compile-warn
-       (format "variable %s bound but not referenced" (car unreferenced)))
+       "variable %s bound but not referenced" (car unreferenced))
       (setq unreferenced (cdr unreferenced)))))
 
 \f
@@ -2443,7 +2443,10 @@ If FORM is a lambda or a macro, byte-compile it as a function."
         (body (cdr (cdr fun)))
         (doc (if (stringp (car body))
                  (prog1 (car body)
-                   (setq body (cdr body)))))
+                   ;; Discard the doc string
+                   ;; only if it is not the only element of the body.
+                   (if (cdr body)
+                       (setq body (cdr body))))))
         (int (assq 'interactive body)))
     (dolist (arg arglist)
       (cond ((not (symbolp arg))
@@ -3918,7 +3921,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
              ;; `defconst' sets `var' unconditionally.
              `(setq ,var ,value)
            ;; `defvar' sets `var' only when unbound.
-           `(if (not (boundp ',var)) (setq ,var ,value))))
+           `(if (not (default-boundp ',var)) (set-default ',var ,value))))
       `',var))))
 
 (defun byte-compile-autoload (form)