# HG changeset patch # User Richard M. Stallman # Date 1139797030 0 # Node ID 14ada287f3fd0f7a333fd5545e2cd0c440138a52 # Parent 6a3bf61d8473c4a06155a55dd2f7e25bd637b5fb (internal_self_insert): Handle weird auto-fill-function. diff -r 6a3bf61d8473 -r 14ada287f3fd src/cmds.c --- a/src/cmds.c Mon Feb 13 01:59:00 2006 +0000 +++ b/src/cmds.c Mon Feb 13 02:17:10 2006 +0000 @@ -528,7 +528,8 @@ justification, if any, know where the end is going to be. */ SET_PT_BOTH (PT - 1, PT_BYTE - 1); tem = call0 (current_buffer->auto_fill_function); - if (c == '\n') + /* Test PT < ZV in case the auto-fill-function is strange. */ + if (c == '\n' && PT < ZV) SET_PT_BOTH (PT + 1, PT_BYTE + 1); if (!NILP (tem)) hairy = 2;