From: Dave Love Date: Thu, 12 Dec 2002 20:28:32 +0000 (+0000) Subject: (byte-optimize-featurep): New. X-Git-Tag: ttn-vms-21-2-B4~12029 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e5c230f42f4945e3e9c625529d4b340a92a26a55;p=emacs.git (byte-optimize-featurep): New. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c4f6c795ad5..4cb038aef91 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2002-12-12 Dave Love + + * custom.el (defcustom, custom-set-variables): Doc fix. + + * emacs-lisp/bytecomp.el (byte-compile-if): Suppress warnings from + things protected by `(if (fboundp ...' or `(if (boundp ...'. + + * emacs-lisp/byte-opt.el (byte-optimize-featurep): New. + 2002-12-12 Glenn Morris * progmodes/fortran.el (fortran-mode-abbrev-table): Handle diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 3edc619ea36..2e29e467d92 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -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