diff options
author | Miles Bader <miles@gnu.org> | 2007-04-11 00:17:47 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2007-04-11 00:17:47 +0000 |
commit | 57cb2e6f261bb0aad81a9f7e6f3017b54adee068 (patch) | |
tree | 6ceb46f2e3bf08f16468d77f4fbfd201f637596a /lisp/emacs-lisp/byte-opt.el | |
parent | 3bd1d328e94787ac52ef6ba5dfec3b94ba23917a (diff) | |
parent | c429815a6b9d271a57eed4956125f6bc89d1d72b (diff) | |
download | emacs-57cb2e6f261bb0aad81a9f7e6f3017b54adee068.tar.gz |
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 675-697)
- Update from CVS
- Merge from gnus--rel--5.10
- Release ERC 5.2.
* gnus--rel--5.10 (patch 211-215)
- Update from CVS
- Merge from emacs--devo--0
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-189
Diffstat (limited to 'lisp/emacs-lisp/byte-opt.el')
-rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 80a537cadb5..d0589b3eb00 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -545,8 +545,8 @@ (eq (car-safe (nth 2 last)) 'cdr) (eq (cadr (nth 2 last)) var)))) (progn - (byte-compile-warn "value returned by `%s' is not used" - (prin1-to-string (car form))) + (byte-compile-warn "value returned from %s is unused" + (prin1-to-string form)) nil))) (byte-compile-log " %s called for effect; deleted" fn) ;; appending a nil here might not be necessary, but it can't hurt. @@ -1117,27 +1117,6 @@ (byte-optimize-predicate form)) form)) -(put 'concat 'byte-optimizer 'byte-optimize-pure-func) -(put 'symbol-name 'byte-optimizer 'byte-optimize-pure-func) -(put 'regexp-opt 'byte-optimizer 'byte-optimize-pure-func) -(put 'regexp-quote 'byte-optimizer 'byte-optimize-pure-func) -(put 'string-to-syntax 'byte-optimizer 'byte-optimize-pure-func) -(defun byte-optimize-pure-func (form) - "Do constant folding for pure functions. -This assumes that the function will not have any side-effects and that -its return value depends solely on its arguments. -If the function can signal an error, this might change the semantics -of FORM by signaling the error at compile-time." - (let ((args (cdr form)) - (constant t)) - (while (and args constant) - (or (byte-compile-constp (car args)) - (setq constant nil)) - (setq args (cdr args))) - (if constant - (list 'quote (eval form)) - 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) @@ -1158,14 +1137,6 @@ of FORM by signaling the error at compile-time." '(forward-word -1)) (t form))) -(put 'char-before 'byte-optimizer 'byte-optimize-char-before) -(defun byte-optimize-char-before (form) - (cond ((= 2 (safe-length form)) - `(char-after (1- ,(nth 1 form)))) - ((= 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. |