# HG changeset patch # User Dave Love # Date 1039724899 0 # Node ID 43cfe87c63fa8fdaed1125941014e27c4c11e47f # Parent 162c286faa11268a1263090516a8b349c33dd214 (byte-optimize-featurep): New. diff -r 162c286faa11 -r 43cfe87c63fa lisp/emacs-lisp/byte-opt.el --- a/lisp/emacs-lisp/byte-opt.el Thu Dec 12 20:27:43 2002 +0000 +++ b/lisp/emacs-lisp/byte-opt.el Thu Dec 12 20:28:19 2002 +0000 @@ -252,7 +252,6 @@ (defun byte-inline-lapcode (lap) (setq byte-compile-output (nconc (nreverse lap) byte-compile-output))) - (defun byte-compile-inline-expand (form) (let* ((name (car form)) (fn (or (cdr (assq name byte-compile-function-environment)) @@ -1127,6 +1126,7 @@ form))) ;; Avoid having to write forward-... with a negative arg for speed. +;; Fixme: don't be limited to constant args. (put 'backward-char 'byte-optimizer 'byte-optimize-backward-char) (defun byte-optimize-backward-char (form) (cond ((and (= 2 (safe-length form)) @@ -1152,6 +1152,16 @@ ((= 1 (safe-length form)) '(char-after (1- (point)))) (t form))) + +;; Fixme: delete-char -> delete-region (byte-coded) +;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte, +;; string-make-multibyte for constant args. + +(put 'featurep 'byte-optimizer 'byte-optimize-featurep) +(defun byte-optimize-featurep (form) + (if (equal '((quote xemacs)) (cdr-safe form)) + nil + form)) ;;; enumerating those functions which need not be called if the returned ;;; value is not used. That is, something like