Mercurial > emacs
changeset 82822:4d04d9500eaf
(byte-optimize-if): Don't presume `clause' is a list.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Fri, 24 Aug 2007 14:39:25 +0000 |
parents | ca1ec1c7d14a |
children | ee04117a2f17 |
files | lisp/ChangeLog lisp/emacs-lisp/byte-opt.el |
diffstat | 2 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri Aug 24 13:58:50 2007 +0000 +++ b/lisp/ChangeLog Fri Aug 24 14:39:25 2007 +0000 @@ -1,3 +1,8 @@ +2007-08-24 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/byte-opt.el (byte-optimize-if): Don't presume `clause' is + a list. + 2007-08-24 Thien-Thi Nguyen <ttn@gnuvola.org> * progmodes/hideshow.el (hs-match-data): Delete alias. @@ -39,8 +44,8 @@ 2007-08-23 Masatake YAMATO <jet@gyve.org> - * progmodes/cc-fonts.el (gtkdoc-font-lock-doc-comments): Highlight - name of parameters in document body. + * progmodes/cc-fonts.el (gtkdoc-font-lock-doc-comments): + Highlight name of parameters in document body. 2007-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
--- a/lisp/emacs-lisp/byte-opt.el Fri Aug 24 13:58:50 2007 +0000 +++ b/lisp/emacs-lisp/byte-opt.el Fri Aug 24 14:39:25 2007 +0000 @@ -1020,7 +1020,9 @@ ;; (if <test> nil <else...>) ==> (if (not <test>) (progn <else...>)) ;; (if <test> <then> nil) ==> (if <test> <then>) (let ((clause (nth 1 form))) - (cond ((eq (car clause) 'progn) + (cond ((and (eq (car-safe clause) 'progn) + ;; `clause' is a proper list. + (null (cdr (last clause)))) (if (null (cddr clause)) ;; A trivial `progn'. (byte-optimize-if `(if ,(cadr clause) ,@(nthcdr 2 form)))