aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDave Love2002-12-12 20:28:32 +0000
committerDave Love2002-12-12 20:28:32 +0000
commite5c230f42f4945e3e9c625529d4b340a92a26a55 (patch)
tree36794e4cffac43eb4dda08cea66b5eeaa154ffe3 /lisp
parentb8234c844c7a191a236a2c618bf0553dcd47f080 (diff)
downloademacs-e5c230f42f4945e3e9c625529d4b340a92a26a55.tar.gz
emacs-e5c230f42f4945e3e9c625529d4b340a92a26a55.zip
(byte-optimize-featurep): New.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/emacs-lisp/byte-opt.el12
2 files changed, 20 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c4f6c795ad5..4cb038aef91 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,12 @@
12002-12-12 Dave Love <fx@gnu.org>
2
3 * custom.el (defcustom, custom-set-variables): Doc fix.
4
5 * emacs-lisp/bytecomp.el (byte-compile-if): Suppress warnings from
6 things protected by `(if (fboundp ...' or `(if (boundp ...'.
7
8 * emacs-lisp/byte-opt.el (byte-optimize-featurep): New.
9
12002-12-12 Glenn Morris <gmorris@ast.cam.ac.uk> 102002-12-12 Glenn Morris <gmorris@ast.cam.ac.uk>
2 11
3 * progmodes/fortran.el (fortran-mode-abbrev-table): Handle 12 * 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 @@
252(defun byte-inline-lapcode (lap) 252(defun byte-inline-lapcode (lap)
253 (setq byte-compile-output (nconc (nreverse lap) byte-compile-output))) 253 (setq byte-compile-output (nconc (nreverse lap) byte-compile-output)))
254 254
255
256(defun byte-compile-inline-expand (form) 255(defun byte-compile-inline-expand (form)
257 (let* ((name (car form)) 256 (let* ((name (car form))
258 (fn (or (cdr (assq name byte-compile-function-environment)) 257 (fn (or (cdr (assq name byte-compile-function-environment))
@@ -1127,6 +1126,7 @@
1127 form))) 1126 form)))
1128 1127
1129;; Avoid having to write forward-... with a negative arg for speed. 1128;; Avoid having to write forward-... with a negative arg for speed.
1129;; Fixme: don't be limited to constant args.
1130(put 'backward-char 'byte-optimizer 'byte-optimize-backward-char) 1130(put 'backward-char 'byte-optimizer 'byte-optimize-backward-char)
1131(defun byte-optimize-backward-char (form) 1131(defun byte-optimize-backward-char (form)
1132 (cond ((and (= 2 (safe-length form)) 1132 (cond ((and (= 2 (safe-length form))
@@ -1152,6 +1152,16 @@
1152 ((= 1 (safe-length form)) 1152 ((= 1 (safe-length form))
1153 '(char-after (1- (point)))) 1153 '(char-after (1- (point))))
1154 (t form))) 1154 (t form)))
1155
1156;; Fixme: delete-char -> delete-region (byte-coded)
1157;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte,
1158;; string-make-multibyte for constant args.
1159
1160(put 'featurep 'byte-optimizer 'byte-optimize-featurep)
1161(defun byte-optimize-featurep (form)
1162 (if (equal '((quote xemacs)) (cdr-safe form))
1163 nil
1164 form))
1155 1165
1156;;; enumerating those functions which need not be called if the returned 1166;;; enumerating those functions which need not be called if the returned
1157;;; value is not used. That is, something like 1167;;; value is not used. That is, something like