From ae4002ce294f21a82979edacef39f82d8e4cd1cc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 29 Oct 2013 22:45:53 -0400 Subject: Cleanup namespace of dos-w32.el. * lisp/dos-w32.el (minibuffer-history-case-insensitive-variables) (path-separator, null-device, buffer-file-coding-system) (lpr-headers-switches): Check system-type before modifying them. (find-buffer-file-type-coding-system): Mark obsolete. (w32-find-file-not-found-set-buffer-file-coding-system): Rename from find-file-not-found-set-buffer-file-coding-system. (w32-untranslated-filesystem-list, w32-untranslated-canonical-name): (w32-add-untranslated-filesystem, w32-remove-untranslated-filesystem) (w32-direct-print-region-use-command-dot-com, w32-untranslated-file-p): (w32-direct-print-region-helper, w32-direct-print-region-function) (w32-direct-ps-print-region-function): Rename by adding a "w32-" prefix. * lisp/startup.el (normal-top-level-add-subdirs-to-load-path): * lisp/ps-print.el (ps-print-region-function): * lisp/lpr.el (print-region-function): Use new name. * lisp/simple.el (copy-region-as-kill): Fix call to region-extract-function. * lisp/emacs-lisp/bytecomp.el (byte-defop-compiler): Add new `2-and' handler. (byte-compile-and-folded): New function. (=, <, >, <=, >=): Use it. --- lisp/emacs-lisp/bytecomp.el | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 35c7c391870..e0d474bbb9f 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -3175,6 +3175,7 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\"" '((0 . byte-compile-no-args) (1 . byte-compile-one-arg) (2 . byte-compile-two-args) + (2-and . byte-compile-and-folded) (3 . byte-compile-three-args) (0-1 . byte-compile-zero-or-one-arg) (1-2 . byte-compile-one-or-two-args) @@ -3256,11 +3257,11 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\"" (byte-defop-compiler cons 2) (byte-defop-compiler aref 2) (byte-defop-compiler set 2) -(byte-defop-compiler (= byte-eqlsign) 2) -(byte-defop-compiler (< byte-lss) 2) -(byte-defop-compiler (> byte-gtr) 2) -(byte-defop-compiler (<= byte-leq) 2) -(byte-defop-compiler (>= byte-geq) 2) +(byte-defop-compiler (= byte-eqlsign) 2-and) +(byte-defop-compiler (< byte-lss) 2-and) +(byte-defop-compiler (> byte-gtr) 2-and) +(byte-defop-compiler (<= byte-leq) 2-and) +(byte-defop-compiler (>= byte-geq) 2-and) (byte-defop-compiler get 2) (byte-defop-compiler nth 2) (byte-defop-compiler substring 2-3) @@ -3324,6 +3325,16 @@ If it is nil, then the handler is \"byte-compile-SYMBOL.\"" (byte-compile-form (nth 2 form)) (byte-compile-out (get (car form) 'byte-opcode) 0))) +(defun byte-compile-and-folded (form) + "Compile calls to functions like `<='. +These implicitly `and' together a bunch of two-arg bytecodes." + (let ((l (length form))) + (cond + ((< l 3) (byte-compile-form `(progn ,(nth 1 form) t))) + ((= l 3) (byte-compile-two-args form)) + (t (byte-compile-form `(and (,(car form) ,(nth 1 form) ,(nth 2 form)) + (,(car form) ,@(nthcdr 2 form)))))))) + (defun byte-compile-three-args (form) (if (not (= (length form) 4)) (byte-compile-subr-wrong-args form 3) -- cgit v1.2.3