aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-11-10 17:16:57 +0000
committerRichard M. Stallman1995-11-10 17:16:57 +0000
commitc0f43df5ae63da3fad9a7245b4f9ba294ea1735a (patch)
tree2eb12d4315cdf53b5e4137c9bee0e73d799b8741
parentd09d7ba961e9ecb15a2dbb3ad11cd83f9e7e508f (diff)
downloademacs-c0f43df5ae63da3fad9a7245b4f9ba294ea1735a.tar.gz
emacs-c0f43df5ae63da3fad9a7245b4f9ba294ea1735a.zip
(byte-compile-associative): Do operations left to right.
(byte-force-recompile): Improve the prompt.
-rw-r--r--lisp/emacs-lisp/bytecomp.el30
1 files changed, 21 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 29155123bf8..8e7e744e050 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1125,7 +1125,7 @@ otherwise pop it")
1125(defun byte-force-recompile (directory) 1125(defun byte-force-recompile (directory)
1126 "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. 1126 "Recompile every `.el' file in DIRECTORY that already has a `.elc' file.
1127Files in subdirectories of DIRECTORY are processed also." 1127Files in subdirectories of DIRECTORY are processed also."
1128 (interactive "DByte recompile directory: ") 1128 (interactive "DByte force recompile (directory): ")
1129 (byte-recompile-directory directory nil t)) 1129 (byte-recompile-directory directory nil t))
1130 1130
1131;;;###autoload 1131;;;###autoload
@@ -1905,9 +1905,16 @@ If FORM is a lambda or a macro, byte-compile it as a function."
1905 ;; If the interactive spec is a call to `list', 1905 ;; If the interactive spec is a call to `list',
1906 ;; don't compile it, because `call-interactively' 1906 ;; don't compile it, because `call-interactively'
1907 ;; looks at the args of `list'. 1907 ;; looks at the args of `list'.
1908 (or (eq (car-safe (nth 1 int)) 'list) 1908 (let ((form (nth 1 int)))
1909 (setq int (list 'interactive 1909 (while (or (eq (car-safe form) 'let)
1910 (byte-compile-top-level (nth 1 int)))))) 1910 (eq (car-safe form) 'let*)
1911 (eq (car-safe form) 'save-excursion))
1912 (while (consp (cdr form))
1913 (setq form (cdr form)))
1914 (setq form (car form)))
1915 (or (eq (car-safe form) 'list)
1916 (setq int (list 'interactive
1917 (byte-compile-top-level (nth 1 int)))))))
1911 ((cdr int) 1918 ((cdr int)
1912 (byte-compile-warn "malformed interactive spec: %s" 1919 (byte-compile-warn "malformed interactive spec: %s"
1913 (prin1-to-string int)))))) 1920 (prin1-to-string int))))))
@@ -2418,13 +2425,18 @@ If FORM is a lambda or a macro, byte-compile it as a function."
2418 2425
2419 2426
2420;; Compile a function that accepts one or more args and is right-associative. 2427;; Compile a function that accepts one or more args and is right-associative.
2428;; We do it by left-associativity so that the operations
2429;; are done in the same order as in interpreted code.
2421(defun byte-compile-associative (form) 2430(defun byte-compile-associative (form)
2422 (if (cdr form) 2431 (if (cdr form)
2423 (let ((opcode (get (car form) 'byte-opcode))) 2432 (let ((opcode (get (car form) 'byte-opcode))
2424 ;; To compile all the args first may enable some optimizations. 2433 (args (copy-sequence (cdr form))))
2425 (mapcar 'byte-compile-form (setq form (cdr form))) 2434 (byte-compile-form (car args))
2426 (while (setq form (cdr form)) 2435 (setq args (cdr args))
2427 (byte-compile-out opcode 0))) 2436 (while args
2437 (byte-compile-form (car args))
2438 (byte-compile-out opcode 0)
2439 (setq args (cdr args))))
2428 (byte-compile-constant (eval form)))) 2440 (byte-compile-constant (eval form))))
2429 2441
2430 2442