From 9d693d807fbd77761cf1c35de1bcbcfc91d690e4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 24 Aug 2007 14:39:25 +0000 Subject: [PATCH] (byte-optimize-if): Don't presume `clause' is a list. --- lisp/ChangeLog | 9 +++++++-- lisp/emacs-lisp/byte-opt.el | 4 +++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a97ee9a2621..4601d4a6d76 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-08-24 Stefan Monnier + + * emacs-lisp/byte-opt.el (byte-optimize-if): Don't presume `clause' is + a list. + 2007-08-24 Thien-Thi Nguyen * progmodes/hideshow.el (hs-match-data): Delete alias. @@ -39,8 +44,8 @@ 2007-08-23 Masatake YAMATO - * 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 diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index b4eaf4ff5eb..80a6ad595b2 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1020,7 +1020,9 @@ ;; (if nil ) ==> (if (not ) (progn )) ;; (if nil) ==> (if ) (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))) -- 2.39.5