]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/bytecomp.el
Spelling fixes.
[gnu-emacs] / lisp / emacs-lisp / bytecomp.el
index 223e9667ac321dd8ff72685f3cc29c54679e25f6..29c5f3f092bab3147296d77dbdc8f8ec2c1ef668 100644 (file)
@@ -178,9 +178,9 @@ adds `c' to it; otherwise adds `.elc'."
 ;; This can be the 'byte-compile property of any symbol.
 (autoload 'byte-compile-inline-expand "byte-opt")
 
-;; This is the entrypoint to the lapcode optimizer pass1.
+;; This is the entry point to the lapcode optimizer pass1.
 (autoload 'byte-optimize-form "byte-opt")
-;; This is the entrypoint to the lapcode optimizer pass2.
+;; This is the entry point to the lapcode optimizer pass2.
 (autoload 'byte-optimize-lapcode "byte-opt")
 (autoload 'byte-compile-unfold-lambda "byte-opt")
 
@@ -355,14 +355,16 @@ else the global value will be modified."
 (defvar byte-compile-interactive-only-functions
   '(beginning-of-buffer end-of-buffer replace-string replace-regexp
     insert-file insert-buffer insert-file-literally previous-line next-line
-    goto-line comint-run delete-backward-char switch-to-buffer)
+    goto-line comint-run delete-backward-char toggle-read-only)
   "List of commands that are not meant to be called from Lisp.")
 
 (defvar byte-compile-not-obsolete-vars nil
-  "If non-nil, a list of variables that shouldn't be reported as obsolete.")
+  "List of variables that shouldn't be reported as obsolete.")
+(defvar byte-compile-global-not-obsolete-vars nil
+  "Global list of variables that shouldn't be reported as obsolete.")
 
 (defvar byte-compile-not-obsolete-funcs nil
-  "If non-nil, a list of functions that shouldn't be reported as obsolete.")
+  "List of functions that shouldn't be reported as obsolete.")
 
 (defcustom byte-compile-generate-call-tree nil
   "Non-nil means collect call-graph information when compiling.
@@ -743,7 +745,7 @@ BYTES and PC are updated after evaluating all the arguments."
 
 (defmacro byte-compile-push-bytecode-const2 (opcode const2 bytes pc)
   "Push OPCODE and the two-byte constant CONST2 onto BYTES, and add 3 to PC.
-CONST2 may be evaulated multiple times."
+CONST2 may be evaluated multiple times."
   `(byte-compile-push-bytecodes ,opcode (logand ,const2 255) (lsh ,const2 -8)
                                ,bytes ,pc))
 
@@ -834,7 +836,7 @@ CONST2 may be evaulated multiple times."
       (setcar (cdr bytes-tail) (logand pc 255))
       (setcar bytes-tail (lsh pc -8))
       ;; FIXME: Replace this by some workaround.
-      (if (> (car bytes) 255) (error "Bytecode overflow")))
+      (if (> (car bytes-tail) 255) (error "Bytecode overflow")))
 
     (apply 'unibyte-string (nreverse bytes))))
 
@@ -1113,7 +1115,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
       (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs))
        (byte-compile-warn "`%s' is an obsolete %s%s%s" symbol
                           (if funcp "function" "variable")
-                          (if asof (concat " (as of Emacs " asof ")") "")
+                          (if asof (concat " (as of " asof ")") "")
                           (cond ((stringp instead)
                                  (concat "; " instead))
                                 (instead
@@ -2195,7 +2197,7 @@ list that represents a doc string reference.
           (byte-compile-keep-pending form)))))
 
 ;; Functions and variables with doc strings must be output separately,
-;; so make-docfile can recognise them.  Most other things can be output
+;; so make-docfile can recognize them.  Most other things can be output
 ;; as byte-code.
 
 (put 'autoload 'byte-hunk-handler 'byte-compile-file-form-autoload)
@@ -2635,7 +2637,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
                   (setq form (cdr form)))
                 (setq form (car form)))
               (if (and (eq (car-safe form) 'list)
-                        ;; The spec is evaled in callint.c in dynamic-scoping
+                        ;; The spec is evalled in callint.c in dynamic-scoping
                         ;; mode, so just leaving the form unchanged would mean
                         ;; it won't be eval'd in the right mode.
                         (not lexical-binding))
@@ -3030,6 +3032,7 @@ That command is designed for interactive use only" fn))
        ((let ((od (get var 'byte-obsolete-variable)))
            (and od
                 (not (memq var byte-compile-not-obsolete-vars))
+                (not (memq var byte-compile-global-not-obsolete-vars))
                 (or (case (nth 1 od)
                       (set (not (eq access-type 'reference)))
                       (get (eq access-type 'reference))
@@ -4116,7 +4119,7 @@ binding slots have been popped."
 (byte-defop-compiler-1 make-obsolete-variable)
 (defun byte-compile-make-obsolete-variable (form)
   (when (eq 'quote (car-safe (nth 1 form)))
-    (push (nth 1 (nth 1 form)) byte-compile-not-obsolete-vars))
+    (push (nth 1 (nth 1 form)) byte-compile-global-not-obsolete-vars))
   (byte-compile-normal-call form))
 
 (defun byte-compile-defvar (form)