aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2007-04-06 18:22:23 +0000
committerChong Yidong2007-04-06 18:22:23 +0000
commitc990483162bf4594c7f3741699e2d77e813f0d6f (patch)
tree4fd21ff15ee2dd05c58fa8bd10e51505b04616d1
parent5d838629845a51091ad5f1088d82da1ec215ae3f (diff)
downloademacs-c990483162bf4594c7f3741699e2d77e813f0d6f.tar.gz
emacs-c990483162bf4594c7f3741699e2d77e813f0d6f.zip
* emacs-lisp/byte-opt.el (byte-optimize-pure-func): Remove function
(originally checked in as byte-optimize-concat on 1997-11-02).
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/emacs-lisp/byte-opt.el21
2 files changed, 4 insertions, 21 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b5aa1965e93..88efc444fa4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
12007-04-06 Chong Yidong <cyd@stupidchicken.com> 12007-04-06 Chong Yidong <cyd@stupidchicken.com>
2 2
3 * emacs-lisp/byte-opt.el (byte-optimize-pure-func): Remove
4 function (originally checked in as byte-optimize-concat on
5 1997-11-02).
6
3 * mail/sendmail.el (mail-text, mail-mode): Revert extant pieces of 7 * mail/sendmail.el (mail-text, mail-mode): Revert extant pieces of
4 1995-05-19 doc changes. 8 1995-05-19 doc changes.
5 9
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 61f7268adff..93d76c52076 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1118,27 +1118,6 @@
1118 (byte-optimize-predicate form)) 1118 (byte-optimize-predicate form))
1119 form)) 1119 form))
1120 1120
1121(put 'concat 'byte-optimizer 'byte-optimize-pure-func)
1122(put 'symbol-name 'byte-optimizer 'byte-optimize-pure-func)
1123(put 'regexp-opt 'byte-optimizer 'byte-optimize-pure-func)
1124(put 'regexp-quote 'byte-optimizer 'byte-optimize-pure-func)
1125(put 'string-to-syntax 'byte-optimizer 'byte-optimize-pure-func)
1126(defun byte-optimize-pure-func (form)
1127 "Do constant folding for pure functions.
1128This assumes that the function will not have any side-effects and that
1129its return value depends solely on its arguments.
1130If the function can signal an error, this might change the semantics
1131of FORM by signaling the error at compile-time."
1132 (let ((args (cdr form))
1133 (constant t))
1134 (while (and args constant)
1135 (or (byte-compile-constp (car args))
1136 (setq constant nil))
1137 (setq args (cdr args)))
1138 (if constant
1139 (list 'quote (eval form))
1140 form)))
1141
1142;; Avoid having to write forward-... with a negative arg for speed. 1121;; Avoid having to write forward-... with a negative arg for speed.
1143;; Fixme: don't be limited to constant args. 1122;; Fixme: don't be limited to constant args.
1144(put 'backward-char 'byte-optimizer 'byte-optimize-backward-char) 1123(put 'backward-char 'byte-optimizer 'byte-optimize-backward-char)