]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/bytecomp.el
add-timeout doc fix
[gnu-emacs] / lisp / emacs-lisp / bytecomp.el
index 0ae7824de1ec2a3baec18329c4754adaff01dee4..1526e2fdeb9e9bb4dfe1b1c1ea881273ef436fa8 100644 (file)
@@ -1,6 +1,6 @@
 ;;; bytecomp.el --- compilation of Lisp code into byte code -*- lexical-binding: t -*-
 
-;; Copyright (C) 1985-1987, 1992, 1994, 1998, 2000-2015 Free Software
+;; Copyright (C) 1985-1987, 1992, 1994, 1998, 2000-2016 Free Software
 ;; Foundation, Inc.
 
 ;; Author: Jamie Zawinski <jwz@lucid.com>
@@ -265,8 +265,8 @@ This option is enabled by default because it reduces Emacs memory usage."
 
 (defcustom byte-optimize-log nil
   "If non-nil, the byte-compiler will log its optimizations.
-If this is 'source, then only source-level optimizations will be logged.
-If it is 'byte, then only byte-level optimizations will be logged.
+If this is `source', then only source-level optimizations will be logged.
+If it is `byte', then only byte-level optimizations will be logged.
 The information is logged to `byte-compile-log-buffer'."
   :group 'bytecomp
   :type '(choice (const :tag "none" nil)
@@ -397,7 +397,7 @@ invoked interactively are excluded from this list."
   "Alist of functions and their call tree.
 Each element looks like
 
-  \(FUNCTION CALLERS CALLS\)
+  (FUNCTION CALLERS CALLS)
 
 where CALLERS is a list of functions that call FUNCTION, and CALLS
 is a list of functions for which calls were generated while compiling
@@ -456,10 +456,20 @@ Return the compile-time value of FORM."
                               (byte-compile-recurse-toplevel
                                (macroexp-progn body)
                                (lambda (form)
-                                 (setf result
-                                       (byte-compile-eval
-                                        (byte-compile-top-level
-                                         (byte-compile-preprocess form))))))
+                                 ;; Insulate the following variables
+                                 ;; against changes made in the
+                                 ;; subsidiary compilation.  This
+                                 ;; prevents spurious warning
+                                 ;; messages: "not defined at runtime"
+                                 ;; etc.
+                                 (let ((byte-compile-unresolved-functions
+                                        byte-compile-unresolved-functions)
+                                       (byte-compile-new-defuns
+                                        byte-compile-new-defuns))
+                                   (setf result
+                                         (byte-compile-eval
+                                          (byte-compile-top-level
+                                           (byte-compile-preprocess form)))))))
                               (list 'quote result))))
     (eval-and-compile . ,(lambda (&rest body)
                            (byte-compile-recurse-toplevel
@@ -503,6 +513,11 @@ defined with incorrect args.")
 Used for warnings about calling a function that is defined during compilation
 but won't necessarily be defined when the compiled file is loaded.")
 
+(defvar byte-compile-new-defuns nil
+  "List of (runtime) functions defined in this compilation run.
+This variable is used to qualify `byte-compile-noruntime-functions' when
+outputting warnings about functions not being defined at runtime.")
+
 ;; Variables for lexical binding
 (defvar byte-compile--lexical-environment nil
   "The current lexical environment.")
@@ -814,7 +829,7 @@ CONST2 may be evaluated multiple times."
            off (cdr lap-entry))
       (cond
        ((not (symbolp op))
-        (error "Non-symbolic opcode ‘%s’" op))
+        (error "Non-symbolic opcode `%s'" op))
        ((eq op 'TAG)
         (setcar off pc))
        (t
@@ -973,7 +988,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
          (print-level 4)
          (print-length 4))
       (byte-compile-log-1
-       (format
+       (format-message
        ,format-string
        ,@(mapcar
           (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x))
@@ -1120,7 +1135,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
                pt)
           (when dir
             (unless was-same
-              (insert (format "Leaving directory ‘%s’\n" default-directory))))
+              (insert (format-message "Leaving directory `%s'\n"
+                                       default-directory))))
           (unless (bolp)
             (insert "\n"))
           (setq pt (point-marker))
@@ -1135,8 +1151,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
           (when dir
             (setq default-directory dir)
             (unless was-same
-              (insert (format "Entering directory ‘%s’\n"
-                               default-directory))))
+              (insert (format-message "Entering directory `%s'\n"
+                                       default-directory))))
           (setq byte-compile-last-logged-file byte-compile-current-file
                 byte-compile-last-warned-form nil)
           ;; Do this after setting default-directory.
@@ -1153,8 +1169,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
     (display-warning 'bytecomp string level byte-compile-log-buffer)))
 
 (defun byte-compile-warn (format &rest args)
-  "Issue a byte compiler warning; use (format FORMAT ARGS...) for message."
-  (setq format (apply 'format format args))
+  "Issue a byte compiler warning; use (format-message FORMAT ARGS...) for message."
+  (setq format (apply #'format-message format args))
   (if byte-compile-error-on-warn
       (error "%s" format)              ; byte-compile-file catches and logs it
     (byte-compile-log-warning format t :warning)))
@@ -1338,7 +1354,7 @@ extra args."
          (nargs (- (length form) 2)))
       (unless (= nargs nfields)
        (byte-compile-warn
-        "‘%s’ called with %d args to fill %d format field(s)" (car form)
+        "`%s' called with %d args to fill %d format field(s)" (car form)
         nargs nfields)))))
 
 (dolist (elt '(format message error))
@@ -1358,7 +1374,7 @@ extra args."
           (plist-get keyword-args :group)
           (not (and (consp name) (eq (car name) 'quote)))
           (byte-compile-warn
-           "%s for ‘%s’ fails to specify containing group"
+           "%s for `%s' fails to specify containing group"
            (cdr (assq (car form)
                       '((custom-declare-group . defgroup)
                         (custom-declare-face . defface)
@@ -1377,7 +1393,7 @@ extra args."
   (let ((calls (assq name byte-compile-unresolved-functions))
         nums sig min max)
     (when (and calls macrop)
-      (byte-compile-warn "macro ‘%s’ defined too late" name))
+      (byte-compile-warn "macro `%s' defined too late" name))
     (setq byte-compile-unresolved-functions
           (delq calls byte-compile-unresolved-functions))
     (setq calls (delq t calls))      ;Ignore higher-order uses of the function.
@@ -1385,7 +1401,7 @@ extra args."
       (when (and (symbolp name)
                  (eq (function-get name 'byte-optimizer)
                      'byte-compile-inline-expand))
-        (byte-compile-warn "defsubst ‘%s’ was used before it was defined"
+        (byte-compile-warn "defsubst `%s' was used before it was defined"
                            name))
       (setq sig (byte-compile-arglist-signature arglist)
             nums (sort (copy-sequence (cdr calls)) (function <))
@@ -1464,7 +1480,7 @@ extra args."
                          ;; so don't warn about them.
                          macroexpand
                          cl--compiling-file))))
-       (byte-compile-warn "function ‘%s’ from cl package called at runtime"
+       (byte-compile-warn "function `%s' from cl package called at runtime"
                           func)))
   form)
 
@@ -1502,16 +1518,17 @@ extra args."
       ;; Separate the functions that will not be available at runtime
       ;; from the truly unresolved ones.
       (dolist (f byte-compile-unresolved-functions)
-       (setq f (car f))
-       (if (fboundp f) (push f noruntime) (push f unresolved)))
+        (setq f (car f))
+        (when (not (memq f byte-compile-new-defuns))
+          (if (fboundp f) (push f noruntime) (push f unresolved))))
       ;; Complain about the no-run-time functions
       (byte-compile-print-syms
-       "the function ‘%s’ might not be defined at runtime."
+       "the function `%s' might not be defined at runtime."
        "the following functions might not be defined at runtime:"
        noruntime)
       ;; Complain about the unresolved functions
       (byte-compile-print-syms
-       "the function ‘%s’ is not known to be defined."
+       "the function `%s' is not known to be defined."
        "the following functions are not known to be defined:"
        unresolved)))
   nil)
@@ -1690,7 +1707,7 @@ Any other non-nil value of ARG means to ask the user.
 If optional argument LOAD is non-nil, loads the file after compiling.
 
 If compilation is needed, this functions returns the result of
-`byte-compile-file'; otherwise it returns 'no-byte-compile."
+`byte-compile-file'; otherwise it returns `no-byte-compile'."
   (interactive
    (let ((file buffer-file-name)
         (file-name nil)
@@ -1813,11 +1830,11 @@ The value is non-nil if there were no errors, nil if errors."
     ;; compile this file.
     (if (with-current-buffer input-buffer no-byte-compile)
        (progn
-         ;; (message "%s not compiled because of ‘no-byte-compile: %s’"
+         ;; (message "%s not compiled because of `no-byte-compile: %s'"
          ;;       (byte-compile-abbreviate-file filename)
          ;;       (with-current-buffer input-buffer no-byte-compile))
          (when (file-exists-p target-file)
-           (message "%s deleted because of ‘no-byte-compile: %s’"
+           (message "%s deleted because of `no-byte-compile: %s'"
                     (byte-compile-abbreviate-file target-file)
                     (buffer-local-value 'no-byte-compile input-buffer))
            (condition-case nil (delete-file target-file) (error nil)))
@@ -1900,7 +1917,10 @@ With argument ARG, insert value in current buffer after the form."
                   (let ((read-with-symbol-positions (current-buffer))
                         (read-symbol-positions-list nil))
                     (displaying-byte-compile-warnings
-                     (byte-compile-sexp (read (current-buffer)))))
+                     (byte-compile-sexp
+                       (eval-sexp-add-defvars
+                        (read (current-buffer))
+                        byte-compile-read-position))))
                    lexical-binding)))
       (cond (arg
             (message "Compiling from buffer... done.")
@@ -1957,6 +1977,8 @@ With argument ARG, insert value in current buffer after the form."
        ;; compiled.  A: Yes!  b-c-u-f might contain dross from a
        ;; previous byte-compile.
        (setq byte-compile-unresolved-functions nil)
+        (setq byte-compile-noruntime-functions nil)
+        (setq byte-compile-new-defuns nil)
 
        ;; Compile the forms from the input buffer.
        (while (progn
@@ -2014,7 +2036,7 @@ and will be removed soon.  See (elisp)Backquote in the manual."))
        (format "     (string-lessp emacs-version \"%s\")\n" minimum-version)
        ;; Because the header must fit in a fixed width, we cannot
        ;; insert arbitrary-length file names (Bug#11585).
-       "     (error \"'%s' was compiled for "
+       "     (error \"`%s' was compiled for "
        (format "Emacs %s or later\" #$))\n\n" minimum-version))
       ;; Now compensate for any change in size, to make sure all
       ;; positions in the file remain valid.
@@ -2283,8 +2305,7 @@ list that represents a doc string reference.
      ;; byte-compile-warn-about-unresolved-functions.
      (if (memq funsym byte-compile-noruntime-functions)
          (setq byte-compile-noruntime-functions
-               (delq funsym byte-compile-noruntime-functions)
-               byte-compile-noruntime-functions)
+               (delq funsym byte-compile-noruntime-functions))
        (setq byte-compile-unresolved-functions
              (delq (assq funsym byte-compile-unresolved-functions)
                    byte-compile-unresolved-functions)))))
@@ -2300,12 +2321,12 @@ list that represents a doc string reference.
   (when (and (symbolp sym)
              (not (string-match "[-*/:$]" (symbol-name sym)))
              (byte-compile-warning-enabled-p 'lexical))
-    (byte-compile-warn "global/dynamic var ‘%s’ lacks a prefix"
+    (byte-compile-warn "global/dynamic var `%s' lacks a prefix"
                        sym))
   (when (memq sym byte-compile-lexical-variables)
     (setq byte-compile-lexical-variables
           (delq sym byte-compile-lexical-variables))
-    (byte-compile-warn "Variable ‘%S’ declared after its first use" sym))
+    (byte-compile-warn "Variable `%S' declared after its first use" sym))
   (push sym byte-compile-bound-variables))
 
 (defun byte-compile-file-form-defvar (form)
@@ -2342,8 +2363,21 @@ list that represents a doc string reference.
 (defun byte-compile-file-form-require (form)
   (let ((args (mapcar 'eval (cdr form)))
        (hist-orig load-history)
-       hist-new)
+       hist-new prov-cons)
     (apply 'require args)
+
+    ;; Record the functions defined by the require in `byte-compile-new-defuns'.
+    (setq hist-new load-history)
+    (setq prov-cons (cons 'provide (car args)))
+    (while (and hist-new
+                (not (member prov-cons (car hist-new))))
+      (setq hist-new (cdr hist-new)))
+    (when hist-new
+      (dolist (x (car hist-new))
+        (when (and (consp x)
+                   (memq (car x) '(defun t)))
+          (push (cdr x) byte-compile-new-defuns))))
+
     (when (byte-compile-warning-enabled-p 'cl-functions)
       ;; Detect (require 'cl) in a way that works even if cl is already loaded.
       (if (member (car args) '("cl" cl))
@@ -2399,6 +2433,7 @@ not to take responsibility for the actual compilation of the code."
          (byte-compile-current-form name)) ; For warnings.
 
     (byte-compile-set-symbol-position name)
+    (push name byte-compile-new-defuns)
     ;; When a function or macro is defined, add it to the call tree so that
     ;; we can tell when functions are not used.
     (if byte-compile-generate-call-tree
@@ -2422,7 +2457,7 @@ not to take responsibility for the actual compilation of the code."
                     ;; Don't warn when compiling the stubs in byte-run...
                     (not (assq name byte-compile-initial-macro-environment)))
                (byte-compile-warn
-                "‘%s’ defined multiple times, as both function and macro"
+                "`%s' defined multiple times, as both function and macro"
                 name))
            (setcdr that-one nil))
           (this-one
@@ -2430,13 +2465,13 @@ not to take responsibility for the actual compilation of the code."
                       ;; Hack: Don't warn when compiling the magic internal
                       ;; byte-compiler macros in byte-run.el...
                       (not (assq name byte-compile-initial-macro-environment)))
-             (byte-compile-warn "%s ‘%s’ defined multiple times in this file"
+             (byte-compile-warn "%s `%s' defined multiple times in this file"
                                 (if macro "macro" "function")
                                 name)))
           ((eq (car-safe (symbol-function name))
                (if macro 'lambda 'macro))
            (when (byte-compile-warning-enabled-p 'redefine)
-             (byte-compile-warn "%s ‘%s’ being redefined as a %s"
+             (byte-compile-warn "%s `%s' being redefined as a %s"
                                 (if macro "function" "macro")
                                 name
                                 (if macro "macro" "function")))
@@ -2453,7 +2488,7 @@ not to take responsibility for the actual compilation of the code."
                (stringp (car-safe (cdr-safe (cdr-safe body)))))
       ;; FIXME: We've done that already just above, so this looks wrong!
       ;;(byte-compile-set-symbol-position name)
-      (byte-compile-warn "probable ‘\"’ without ‘\\’ in doc string of %s"
+      (byte-compile-warn "probable `\"' without `\\' in doc string of %s"
                          name))
 
     (if (not (listp body))
@@ -2584,7 +2619,9 @@ If FORM is a lambda or a macro, byte-compile it as a function."
                  (if (symbolp form) form "provided"))
         fun)
        (t
-        (when (symbolp form)
+        (when (or (symbolp form) (eq (car-safe fun) 'closure))
+          ;; `fun' is a function *value*, so try to recover its corresponding
+          ;; source code.
           (setq lexical-binding (eq (car fun) 'closure))
           (setq fun (byte-compile--reify-function fun)))
         ;; Expand macros.
@@ -2979,20 +3016,22 @@ for symbols generated by the byte compiler itself."
             (`(',var . ,_)
              (when (assq var byte-compile-lexical-variables)
                (byte-compile-log-warning
-                (format "%s cannot use lexical var ‘%s’" fn var)
+                (format-message "%s cannot use lexical var `%s'" fn var)
                 nil :error)))))
         (when (macroexp--const-symbol-p fn)
-          (byte-compile-warn "‘%s’ called as a function" fn))
+          (byte-compile-warn "`%s' called as a function" fn))
        (when (and (byte-compile-warning-enabled-p 'interactive-only)
                   interactive-only)
-         (byte-compile-warn "‘%s’ is for interactive use only%s"
+         (byte-compile-warn "`%s' is for interactive use only%s"
                             fn
                             (cond ((stringp interactive-only)
-                                   (format "; %s" interactive-only))
+                                   (format "; %s"
+                                           (substitute-command-keys
+                                            interactive-only)))
                                   ((and (symbolp 'interactive-only)
                                         (not (eq interactive-only t)))
-                                   (format "; use ‘%s’ instead."
-                                           interactive-only))
+                                   (format-message "; use `%s' instead."
+                                                    interactive-only))
                                   (t "."))))
         (if (eq (car-safe (symbol-function (car form))) 'macro)
             (byte-compile-log-warning
@@ -3036,7 +3075,7 @@ for symbols generated by the byte compiler itself."
              (byte-compile-warning-enabled-p 'mapcar))
     (byte-compile-set-symbol-position 'mapcar)
     (byte-compile-warn
-     "‘mapcar’ called for effect; use ‘mapc’ or ‘dolist’ instead"))
+     "`mapcar' called for effect; use `mapc' or `dolist' instead"))
   (byte-compile-push-constant (car form))
   (mapc 'byte-compile-form (cdr form)) ; wasteful, but faster.
   (byte-compile-out 'byte-call (length (cdr form))))
@@ -3124,8 +3163,8 @@ for symbols generated by the byte compiler itself."
   (cond ((or (not (symbolp var)) (macroexp--const-symbol-p var))
         (when (byte-compile-warning-enabled-p 'constants)
           (byte-compile-warn (if (eq access-type 'let-bind)
-                                 "attempt to let-bind %s ‘%s’"
-                               "variable reference to %s ‘%s’")
+                                 "attempt to let-bind %s `%s'"
+                               "variable reference to %s `%s'")
                              (if (symbolp var) "constant" "nonvariable")
                              (prin1-to-string var))))
        ((let ((od (get var 'byte-obsolete-variable)))
@@ -3163,7 +3202,7 @@ for symbols generated by the byte compiler itself."
                  (boundp var)
                  (memq var byte-compile-bound-variables)
                  (memq var byte-compile-free-references))
-       (byte-compile-warn "reference to free variable ‘%S’" var)
+       (byte-compile-warn "reference to free variable `%S'" var)
        (push var byte-compile-free-references))
       (byte-compile-dynamic-variable-op 'byte-varref var))))
 
@@ -3179,7 +3218,7 @@ for symbols generated by the byte compiler itself."
                  (boundp var)
                  (memq var byte-compile-bound-variables)
                  (memq var byte-compile-free-assignments))
-       (byte-compile-warn "assignment to free variable ‘%s’" var)
+       (byte-compile-warn "assignment to free variable `%s'" var)
        (push var byte-compile-free-assignments))
       (byte-compile-dynamic-variable-op 'byte-varset var))))
 
@@ -3360,7 +3399,7 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\""
 \f
 (defun byte-compile-subr-wrong-args (form n)
   (byte-compile-set-symbol-position (car form))
-  (byte-compile-warn "‘%s’ called with %d arg%s, but requires %s"
+  (byte-compile-warn "`%s' called with %d arg%s, but requires %s"
                     (car form) (length (cdr form))
                     (if (= 1 (length (cdr form))) "" "s") n)
   ;; Get run-time wrong-number-of-args error.
@@ -3612,8 +3651,8 @@ discarding."
 
 (defun byte-compile-quo (form)
   (let ((len (length form)))
-    (cond ((<= len 2)
-          (byte-compile-subr-wrong-args form "2 or more"))
+    (cond ((< len 2)
+          (byte-compile-subr-wrong-args form "1 or more"))
          ((= len 3)
           (byte-compile-two-args form))
          (t
@@ -3702,16 +3741,26 @@ discarding."
 (byte-defop-compiler-1 quote)
 
 (defun byte-compile-setq (form)
-  (let ((args (cdr form)))
-    (if args
-       (while args
-         (byte-compile-form (car (cdr args)))
-         (or byte-compile--for-effect (cdr (cdr args))
-             (byte-compile-out 'byte-dup 0))
-         (byte-compile-variable-set (car args))
-         (setq args (cdr (cdr args))))
-      ;; (setq), with no arguments.
-      (byte-compile-form nil byte-compile--for-effect))
+  (let* ((args (cdr form))
+         (len (length args)))
+    (if (= (logand len 1) 1)
+        (progn
+          (byte-compile-log-warning
+           (format-message
+            "missing value for `%S' at end of setq" (car (last args)))
+           nil :error)
+          (byte-compile-form
+           `(signal 'wrong-number-of-arguments '(setq ,len))
+           byte-compile--for-effect))
+      (if args
+          (while args
+            (byte-compile-form (car (cdr args)))
+            (or byte-compile--for-effect (cdr (cdr args))
+                (byte-compile-out 'byte-dup 0))
+            (byte-compile-variable-set (car args))
+            (setq args (cdr (cdr args))))
+        ;; (setq), with no arguments.
+        (byte-compile-form nil byte-compile--for-effect)))
     (setq byte-compile--for-effect nil)))
 
 (defun byte-compile-setq-default (form)
@@ -3728,7 +3777,7 @@ discarding."
                 (macroexp--const-symbol-p var t))
             (byte-compile-warning-enabled-p 'constants)
             (byte-compile-warn
-             "variable assignment to %s ‘%s’"
+             "variable assignment to %s `%s'"
              (if (symbolp var) "constant" "nonvariable")
              (prin1-to-string var)))
        (byte-compile-normal-call `(set-default ',var ,@(cdr form)))))))
@@ -3824,11 +3873,11 @@ discarding."
   "Execute forms in BODY, potentially guarded by CONDITION.
 CONDITION is a variable whose value is a test in an `if' or `cond'.
 BODY is the code to compile in the first arm of the if or the body of
-the cond clause.  If CONDITION's value is of the form (fboundp 'foo)
-or (boundp 'foo), the relevant warnings from BODY about foo's
+the cond clause.  If CONDITION's value is of the form (fboundp \\='foo)
+or (boundp \\='foo), the relevant warnings from BODY about foo's
 being undefined (or obsolete) will be suppressed.
 
-If CONDITION's value is (not (featurep 'emacs)) or (featurep 'xemacs),
+If CONDITION's value is (not (featurep \\='emacs)) or (featurep \\='xemacs),
 that suppresses all warnings during execution of BODY."
   (declare (indent 1) (debug t))
   `(let* ((fbound-list (byte-compile-find-bound-condition
@@ -3965,8 +4014,14 @@ that suppresses all warnings during execution of BODY."
     (setq byte-compile--for-effect nil)))
 
 (defun byte-compile-funcall (form)
-  (mapc 'byte-compile-form (cdr form))
-  (byte-compile-out 'byte-call (length (cdr (cdr form)))))
+  (if (cdr form)
+      (progn
+        (mapc 'byte-compile-form (cdr form))
+        (byte-compile-out 'byte-call (length (cdr (cdr form)))))
+    (byte-compile-log-warning
+     (format-message "`funcall' called with no arguments") nil :error)
+    (byte-compile-form '(signal 'wrong-number-of-arguments '(funcall 0))
+                       byte-compile--for-effect)))
 
 \f
 ;; let binding
@@ -4102,7 +4157,7 @@ binding slots have been popped."
   (list 'not
     (cons (or (get (car form) 'byte-compile-negated-op)
              (error
-              "Compiler error: ‘%s’ has no ‘byte-compile-negated-op’ property"
+              "Compiler error: `%s' has no `byte-compile-negated-op' property"
               (car form)))
          (cdr form))))
 \f
@@ -4165,7 +4220,7 @@ binding slots have been popped."
     (byte-compile-set-symbol-position 'condition-case)
     (unless (symbolp var)
       (byte-compile-warn
-       "‘%s’ is not a variable-name or nil (in condition-case)" var))
+       "`%s' is not a variable-name or nil (in condition-case)" var))
     (if fun-bodies (setq var (make-symbol "err")))
     (byte-compile-push-constant var)
     (if fun-bodies
@@ -4184,14 +4239,14 @@ binding slots have been popped."
                                              (setq ok nil)))
                                        ok))))
                        (byte-compile-warn
-                        "‘%S’ is not a condition name or list of such (in condition-case)"
+                        "`%S' is not a condition name or list of such (in condition-case)"
                         condition))
                       ;; (not (or (eq condition 't)
                       ;;         (and (stringp (get condition 'error-message))
                       ;;              (consp (get condition
                       ;;                          'error-conditions)))))
                       ;; (byte-compile-warn
-                      ;;   "‘%s’ is not a known condition name
+                      ;;   "`%s' is not a known condition name
                       ;;   (in condition-case)"
                       ;;   condition))
                       )
@@ -4217,7 +4272,7 @@ binding slots have been popped."
     (byte-compile-set-symbol-position 'condition-case)
     (unless (symbolp var)
       (byte-compile-warn
-       "‘%s’ is not a variable-name or nil (in condition-case)" var))
+       "`%s' is not a variable-name or nil (in condition-case)" var))
 
     (dolist (clause (reverse clauses))
       (let ((condition (nth 1 clause)))
@@ -4225,12 +4280,12 @@ binding slots have been popped."
         (dolist (c condition)
           (unless (and c (symbolp c))
             (byte-compile-warn
-             "‘%S’ is not a condition name (in condition-case)" c))
+             "`%S' is not a condition name (in condition-case)" c))
           ;; In reality, the `error-conditions' property is only required
           ;; for the argument to `signal', not to `condition-case'.
           ;;(unless (consp (get c 'error-conditions))
           ;;  (byte-compile-warn
-          ;;   "‘%s’ is not a known condition name (in condition-case)"
+          ;;   "`%s' is not a known condition name (in condition-case)"
           ;;   c))
           )
         (byte-compile-push-constant condition))
@@ -4267,7 +4322,7 @@ binding slots have been popped."
   (if (and (eq 'set-buffer (car-safe (car-safe (cdr form))))
            (byte-compile-warning-enabled-p 'suspicious))
       (byte-compile-warn
-       "Use ‘with-current-buffer’ rather than save-excursion+set-buffer"))
+       "Use `with-current-buffer' rather than save-excursion+set-buffer"))
   (byte-compile-out 'byte-save-excursion 0)
   (byte-compile-body-do-effect (cdr form))
   (byte-compile-out 'byte-unbind 1))
@@ -4307,7 +4362,7 @@ binding slots have been popped."
   (when (and (symbolp (nth 1 form))
              (not (string-match "[-*/:$]" (symbol-name (nth 1 form))))
              (byte-compile-warning-enabled-p 'lexical))
-    (byte-compile-warn "global/dynamic var ‘%s’ lacks a prefix"
+    (byte-compile-warn "global/dynamic var `%s' lacks a prefix"
                        (nth 1 form)))
   (let ((fun (nth 0 form))
        (var (nth 1 form))
@@ -4318,7 +4373,7 @@ binding slots have been popped."
              (and (eq fun 'defconst) (null (cddr form))))
       (let ((ncall (length (cdr form))))
        (byte-compile-warn
-        "‘%s’ called with %d argument%s, but %s %s"
+        "`%s' called with %d argument%s, but %s %s"
         fun ncall
         (if (= 1 ncall) "" "s")
         (if (< ncall 2) "requires" "accepts only")
@@ -4327,7 +4382,7 @@ binding slots have been popped."
     (if (eq fun 'defconst)
        (push var byte-compile-const-variables))
     (when (and string (not (stringp string)))
-      (byte-compile-warn "third arg to ‘%s %s’ is not a string: %s"
+      (byte-compile-warn "third arg to `%s %s' is not a string: %s"
                          fun var string))
     (byte-compile-form-do-effect
      (if (cddr form)  ; `value' provided
@@ -4350,7 +4405,7 @@ binding slots have been popped."
        (not (fboundp (eval (nth 1 form))))
        (byte-compile-warn
        "The compiler ignores `autoload' except at top level.  You should
-     probably put the autoload of the macro ‘%s’ at top-level."
+     probably put the autoload of the macro `%s' at top-level."
        (eval (nth 1 form))))
   (byte-compile-normal-call form))
 
@@ -4358,7 +4413,7 @@ binding slots have been popped."
 ;; The ones that remain are errors.
 (defun byte-compile-lambda-form (_form)
   (byte-compile-set-symbol-position 'lambda)
-  (error "‘lambda’ used as function name is invalid"))
+  (error "`lambda' used as function name is invalid"))
 
 ;; Compile normally, but deal with warnings for the function being defined.
 (put 'defalias 'byte-hunk-handler 'byte-compile-file-form-defalias)
@@ -4430,7 +4485,7 @@ binding slots have been popped."
   (if (and (eq (car-safe (car-safe (cdr-safe form))) 'quote)
            (byte-compile-warning-enabled-p 'make-local))
       (byte-compile-warn
-       "‘make-variable-buffer-local’ not called at toplevel"))
+       "`make-variable-buffer-local' not called at toplevel"))
   (byte-compile-normal-call form))
 (put 'make-variable-buffer-local
      'byte-hunk-handler 'byte-compile-form-make-variable-buffer-local)
@@ -4524,11 +4579,11 @@ whose definitions have been compiled in this Emacs session, as well as
 all functions called by those functions.
 
 The call graph does not include macros, inline functions, or
-primitives that the byte-code interpreter knows about directly \(eq,
-cons, etc.\).
+primitives that the byte-code interpreter knows about directly
+\(`eq', `cons', etc.).
 
 The call tree also lists those functions which are not known to be called
-\(that is, to which no calls have been compiled\), and which cannot be
+\(that is, to which no calls have been compiled), and which cannot be
 invoked interactively."
   (interactive)
   (message "Generating call tree...")
@@ -4562,7 +4617,7 @@ invoked interactively."
                                       (length (nth 2 y))))))
                       (`name
                        (lambda (x y) (string< (car x) (car y))))
-                      (_ (error "‘byte-compile-call-tree-sort’: ‘%s’ - unknown sort mode"
+                      (_ (error "`byte-compile-call-tree-sort': `%s' - unknown sort mode"
                                 byte-compile-call-tree-sort))))))
     (message "Generating call tree...")
     (let ((rest byte-compile-call-tree)
@@ -4675,7 +4730,7 @@ already up-to-date."
   ;; startup.el.
   (defvar command-line-args-left)      ;Avoid 'free variable' warning
   (if (not noninteractive)
-      (error "‘batch-byte-compile’ is to be used only with -batch"))
+      (error "`batch-byte-compile' is to be used only with -batch"))
   (let ((error nil))
     (while command-line-args-left
       (if (file-directory-p (expand-file-name (car command-line-args-left)))