]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/bytecomp.el
Make seq.el more extensible by using cl-defmethod
[gnu-emacs] / lisp / emacs-lisp / bytecomp.el
index 51bbf8a2944e4bbfbb3f95ee78829531f667fcf0..0ae7824de1ec2a3baec18329c4754adaff01dee4 100644 (file)
@@ -348,7 +348,7 @@ else the global value will be modified."
 ;;;###autoload
 (defun byte-compile-enable-warning (warning)
   "Change `byte-compile-warnings' to enable WARNING.
-If `byte-compile-warnings' is `t', do nothing.  Otherwise, if the
+If `byte-compile-warnings' is t, do nothing.  Otherwise, if the
 first element is `not', remove WARNING, else add it.
 Normally you should let-bind `byte-compile-warnings' before calling this,
 else the global value will be modified."
@@ -814,7 +814,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
@@ -979,17 +979,6 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
           (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x))
           args))))))
 
-(defvar byte-compile--interactive nil
-  "Determine if `byte-compile--message' uses the minibuffer.")
-
-(defun byte-compile--message (format &rest args)
-  "Like `message', except sometimes don't print to minibuffer.
-If the variable `byte-compile--interactive' is nil, the message
-is not displayed on the minibuffer."
-  (apply #'message format args)
-  (unless byte-compile--interactive
-    (message nil)))
-
 ;; Log something that isn't a warning.
 (defun byte-compile-log-1 (string)
   (with-current-buffer byte-compile-log-buffer
@@ -997,7 +986,7 @@ is not displayed on the minibuffer."
       (goto-char (point-max))
       (byte-compile-warning-prefix nil nil)
       (cond (noninteractive
-            (byte-compile--message " %s" string))
+            (message " %s" string))
            (t
             (insert (format "%s\n" string)))))))
 
@@ -1131,7 +1120,7 @@ is not displayed on the minibuffer."
                pt)
           (when dir
             (unless was-same
-              (insert (format "Leaving directory `%s'\n" default-directory))))
+              (insert (format "Leaving directory ‘%s’\n" default-directory))))
           (unless (bolp)
             (insert "\n"))
           (setq pt (point-marker))
@@ -1146,7 +1135,7 @@ is not displayed on the minibuffer."
           (when dir
             (setq default-directory dir)
             (unless was-same
-              (insert (format "Entering directory `%s'\n"
+              (insert (format "Entering directory ‘%s’\n"
                                default-directory))))
           (setq byte-compile-last-logged-file byte-compile-current-file
                 byte-compile-last-warned-form nil)
@@ -1349,7 +1338,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))
@@ -1369,7 +1358,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)
@@ -1388,7 +1377,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.
@@ -1396,7 +1385,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 <))
@@ -1428,7 +1417,7 @@ extra args."
                      (`(lambda ,args . ,_) args)
                      (`(closure ,_ ,args . ,_) args)
                      ((pred byte-code-function-p) (aref old 0))
-                     (t '(&rest def)))))
+                     (_ '(&rest def)))))
             (sig2 (byte-compile-arglist-signature arglist)))
         (unless (byte-compile-arglist-signatures-congruent-p sig1 sig2)
           (byte-compile-set-symbol-position name)
@@ -1475,7 +1464,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)
 
@@ -1517,12 +1506,12 @@ extra args."
        (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)
@@ -1601,10 +1590,7 @@ extra args."
   "Recompile every `.el' file in DIRECTORY that already has a `.elc' file.
 Files in subdirectories of DIRECTORY are processed also."
   (interactive "DByte force recompile (directory): ")
-  (let ((byte-compile--interactive
-         (or byte-compile--interactive
-             (called-interactively-p 'any))))
-    (byte-recompile-directory directory nil t)))
+  (byte-recompile-directory directory nil t))
 
 ;;;###autoload
 (defun byte-recompile-directory (directory &optional arg force)
@@ -1634,9 +1620,6 @@ that already has a `.elc' file."
       (compilation-mode))
     (let ((directories (list default-directory))
          (default-directory default-directory)
-          (byte-compile--interactive
-           (or byte-compile--interactive
-               (called-interactively-p 'any)))
          (skip-count 0)
          (fail-count 0)
          (file-count 0)
@@ -1645,7 +1628,7 @@ that already has a `.elc' file."
       (displaying-byte-compile-warnings
        (while directories
         (setq directory (car directories))
-        (byte-compile--message "Checking %s..." directory)
+        (message "Checking %s..." directory)
          (dolist (file (directory-files directory))
            (let ((source (expand-file-name file directory)))
             (if (file-directory-p source)
@@ -1670,13 +1653,13 @@ that already has a `.elc' file."
                              (`t file-count)
                              (_ fail-count)))
                           (or noninteractive
-                              (byte-compile--message "Checking %s..." directory))
+                              (message "Checking %s..." directory))
                           (if (not (eq last-dir directory))
                               (setq last-dir directory
                                     dir-count (1+ dir-count)))
                           )))))
         (setq directories (cdr directories))))
-      (byte-compile--message "Done (Total of %d file%s compiled%s%s%s)"
+      (message "Done (Total of %d file%s compiled%s%s%s)"
               file-count (if (= file-count 1) "" "s")
               (if (> fail-count 0) (format ", %d failed" fail-count) "")
               (if (> skip-count 0) (format ", %d skipped" skip-count) "")
@@ -1723,10 +1706,7 @@ If compilation is needed, this functions returns the result of
           current-prefix-arg)))
   (let ((dest (byte-compile-dest-file filename))
         ;; Expand now so we get the current buffer's defaults
-        (filename (expand-file-name filename))
-        (byte-compile--interactive
-         (or byte-compile--interactive
-             (called-interactively-p 'any))))
+        (filename (expand-file-name filename)))
     (if (if (file-exists-p dest)
             ;; File was already compiled
             ;; Compile if forced to, or filename newer
@@ -1738,7 +1718,7 @@ If compilation is needed, this functions returns the result of
                                      filename "? ")))))
         (progn
           (if (and noninteractive (not byte-compile-verbose))
-              (byte-compile--message "Compiling %s..." filename))
+              (message "Compiling %s..." filename))
           (byte-compile-file filename load))
       (when load
        (load (if (file-exists-p dest) dest filename)))
@@ -1782,9 +1762,6 @@ The value is non-nil if there were no errors, nil if errors."
   (let ((byte-compile-current-file filename)
         (byte-compile-current-group nil)
        (set-auto-coding-for-load t)
-        (byte-compile--interactive
-         (or byte-compile--interactive
-             (called-interactively-p 'any)))
        target-file input-buffer output-buffer
        byte-compile-dest-file)
     (setq target-file (byte-compile-dest-file filename))
@@ -1836,18 +1813,18 @@ 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)
-           (byte-compile--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)))
          ;; We successfully didn't compile this file.
          'no-byte-compile)
       (when byte-compile-verbose
-       (byte-compile--message "Compiling %s..." filename))
+       (message "Compiling %s..." filename))
       (setq byte-compiler-error-flag nil)
       ;; It is important that input-buffer not be current at this call,
       ;; so that the value of point set in input-buffer
@@ -1859,7 +1836,7 @@ The value is non-nil if there were no errors, nil if errors."
       (if byte-compiler-error-flag
          nil
        (when byte-compile-verbose
-         (byte-compile--message "Compiling %s...done" filename))
+         (message "Compiling %s...done" filename))
        (kill-buffer input-buffer)
        (with-current-buffer output-buffer
          (goto-char (point-max))
@@ -1885,7 +1862,7 @@ The value is non-nil if there were no errors, nil if errors."
                ;; recompiled).  Previously this was accomplished by
                ;; deleting target-file before writing it.
                (rename-file tempfile target-file t)
-               (or noninteractive (byte-compile--message "Wrote %s" target-file)))
+               (or noninteractive (message "Wrote %s" target-file)))
            ;; This is just to give a better error message than write-region
            (signal 'file-error
                    (list "Opening output file"
@@ -1919,9 +1896,6 @@ With argument ARG, insert value in current buffer after the form."
           (byte-compile-read-position (point))
           (byte-compile-last-position byte-compile-read-position)
           (byte-compile-last-warned-form 'nothing)
-           (byte-compile--interactive
-            (or byte-compile--interactive
-                (called-interactively-p 'any)))
           (value (eval
                   (let ((read-with-symbol-positions (current-buffer))
                         (read-symbol-positions-list nil))
@@ -1929,10 +1903,10 @@ With argument ARG, insert value in current buffer after the form."
                      (byte-compile-sexp (read (current-buffer)))))
                    lexical-binding)))
       (cond (arg
-            (byte-compile--message "Compiling from buffer... done.")
+            (message "Compiling from buffer... done.")
             (prin1 value (current-buffer))
             (insert "\n"))
-           ((byte-compile--message "%s" (prin1-to-string value)))))))
+           ((message "%s" (prin1-to-string value)))))))
 
 (defun byte-compile-from-buffer (inbuffer)
   (let ((byte-compile-current-buffer inbuffer)
@@ -2040,7 +2014,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.
@@ -2326,12 +2300,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)
@@ -2436,7 +2410,7 @@ not to take responsibility for the actual compilation of the code."
         (byte-compile-arglist-warn name arglist macro))
 
     (if byte-compile-verbose
-        (byte-compile--message "Compiling %s... (%s)"
+        (message "Compiling %s... (%s)"
                  (or byte-compile-current-file "") name))
     (cond ((not (or macro (listp body)))
            ;; We do not know positively if the definition is a macro
@@ -2448,7 +2422,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
@@ -2456,13 +2430,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")))
@@ -2479,7 +2453,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))
@@ -2606,7 +2580,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
        ;; error to a simple message for the known case where signaling an error
        ;; causes problems.
        ((byte-code-function-p fun)
-        (byte-compile--message "Function %s is already compiled"
+        (message "Function %s is already compiled"
                  (if (symbolp form) form "provided"))
         fun)
        (t
@@ -2946,11 +2920,17 @@ for symbols generated by the byte compiler itself."
 
 ;; Special macro-expander used during byte-compilation.
 (defun byte-compile-macroexpand-declare-function (fn file &rest args)
-  (push (cons fn
-              (if (and (consp args) (listp (car args)))
-                  (list 'declared (car args))
-                t))                     ; Arglist not specified.
-        byte-compile-function-environment)
+  (let ((gotargs (and (consp args) (listp (car args))))
+       (unresolved (assq fn byte-compile-unresolved-functions)))
+    (when unresolved         ; function was called before declaration
+      (if (and gotargs (byte-compile-warning-enabled-p 'callargs))
+         (byte-compile-arglist-warn fn (car args) nil)
+       (setq byte-compile-unresolved-functions
+             (delq unresolved byte-compile-unresolved-functions))))
+    (push (cons fn (if gotargs
+                      (list 'declared (car args))
+                    t))                     ; Arglist not specified.
+         byte-compile-function-environment))
   ;; We are stating that it _will_ be defined at runtime.
   (setq byte-compile-noruntime-functions
         (delq fn byte-compile-noruntime-functions))
@@ -2999,19 +2979,19 @@ 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 "%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))
                                   ((and (symbolp 'interactive-only)
                                         (not (eq interactive-only t)))
-                                   (format "; use `%s' instead."
+                                   (format "; use ‘%s’ instead."
                                            interactive-only))
                                   (t "."))))
         (if (eq (car-safe (symbol-function (car form))) 'macro)
@@ -3056,7 +3036,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))))
@@ -3144,8 +3124,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)))
@@ -3183,7 +3163,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))))
 
@@ -3199,7 +3179,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))))
 
@@ -3380,7 +3360,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.
@@ -3748,7 +3728,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)))))))
@@ -4122,7 +4102,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
@@ -4185,7 +4165,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
@@ -4204,14 +4184,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))
                       )
@@ -4237,7 +4217,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)))
@@ -4245,12 +4225,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))
@@ -4287,7 +4267,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))
@@ -4327,7 +4307,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))
@@ -4338,7 +4318,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")
@@ -4347,7 +4327,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
@@ -4370,7 +4350,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))
 
@@ -4378,7 +4358,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)
@@ -4424,8 +4404,8 @@ binding slots have been popped."
                   name macro arglist body rest)
            (when macro
              (if (null fun)
-                 (byte-compile--message "Macro %s unrecognized, won't work in file" name)
-               (byte-compile--message "Macro %s partly recognized, trying our luck" name)
+                 (message "Macro %s unrecognized, won't work in file" name)
+               (message "Macro %s partly recognized, trying our luck" name)
                (push (cons name (eval fun))
                      byte-compile-macro-environment)))
            (byte-compile-keep-pending form))))
@@ -4436,7 +4416,7 @@ binding slots have been popped."
       ;; which is to call back byte-compile-file-form and then return nil.
       ;; Except that we can't just call byte-compile-file-form since it would
       ;; call us right back.
-      (t (byte-compile-keep-pending form)))))
+      (_ (byte-compile-keep-pending form)))))
 
 (byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings)
 (defun byte-compile-no-warnings (form)
@@ -4450,7 +4430,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)
@@ -4551,11 +4531,11 @@ 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
 invoked interactively."
   (interactive)
-  (byte-compile--message "Generating call tree...")
+  (message "Generating call tree...")
   (with-output-to-temp-buffer "*Call-Tree*"
     (set-buffer "*Call-Tree*")
     (erase-buffer)
-    (byte-compile--message "Generating call tree... (sorting on %s)"
+    (message "Generating call tree... (sorting on %s)"
             byte-compile-call-tree-sort)
     (insert "Call tree for "
            (cond ((null byte-compile-current-file) (or filename "???"))
@@ -4582,7 +4562,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)
@@ -4695,7 +4675,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)))