From: Stefan Monnier Date: Mon, 13 Aug 2007 04:06:31 +0000 (+0000) Subject: (Finsert_file_contents): Yet Another Int/Lisp_Object Mixup. X-Git-Tag: emacs-pretest-23.0.90~11525 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1bc99c9c789039e19c3f31b2807b58cf6588283a;p=emacs.git (Finsert_file_contents): Yet Another Int/Lisp_Object Mixup. --- diff --git a/src/ChangeLog b/src/ChangeLog index 51bf583fcee..c97fec64808 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2007-08-13 Stefan Monnier + * fileio.c (Finsert_file_contents): Yet Another Int/Lisp_Object Mixup. + * insdel.c (reset_var_on_error): New fun. (signal_before_change, signal_after_change): Use it to reset (after|before)-change-functions to nil in case of error. diff --git a/src/fileio.c b/src/fileio.c index 6037eec5d7d..195e76db658 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4738,7 +4738,7 @@ variable `last-coding-system-used' to the coding system actually used. */) insval = call3 (Qformat_decode, Qnil, make_number (oinserted), visit); CHECK_NUMBER (insval); - if (insval = oinserted) + if (XINT (insval) == oinserted) SET_PT_BOTH (opoint, opoint_byte); inserted = XFASTINT (insval); } @@ -4769,7 +4769,7 @@ variable `last-coding-system-used' to the coding system actually used. */) if (!NILP (insval)) { CHECK_NUMBER (insval); - if (insval = oinserted) + if (XINT (insval) == oinserted) SET_PT_BOTH (opoint, opoint_byte); inserted = XFASTINT (insval); } @@ -4788,18 +4788,16 @@ variable `last-coding-system-used' to the coding system actually used. */) { Lisp_Object tem = XCAR (old_undo); if (CONSP (tem) && INTEGERP (XCAR (tem)) && - INTEGERP (XCDR (tem)) && (XCAR (tem)) == lbeg) + INTEGERP (XCDR (tem)) && EQ (XCAR (tem), lbeg)) /* In the non-visiting case record only the final insertion. */ current_buffer->undo_list = Fcons (Fcons (lbeg, lend), Fcdr (old_undo)); } } - else if (old_undo == Qt) - /* If undo_list was Qt before, keep it that way. */ - current_buffer->undo_list = Qt; else - /* Otherwise start with an empty undo_list. */ - current_buffer->undo_list = Qnil; + /* If undo_list was Qt before, keep it that way. + Otherwise start with an empty undo_list. */ + current_buffer->undo_list = EQ (old_undo, Qt) ? Qt : Qnil; unbind_to (count, Qnil); }