the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-#include "config.h"
+#include <config.h>
#include "lisp.h"
#include "commands.h"
#include "buffer.h"
Fbarf_if_buffer_read_only ();
/* Inserting a newline at the end of a line produces better
- redisplay in try_window_id than inserting at the ebginning fo a
+ redisplay in try_window_id than inserting at the beginning of a
line, and the textual result is the same. So, if we're at
beginning of line, pretend to be at the end of the previous line.
features all do nothing in that case. */
flag = point > BEGV && FETCH_CHAR (point - 1) == '\n';
+#ifdef USE_TEXT_PROPERTIES
+ /* We cannot use this optimization if properties change
+ in the vicinity.
+ ??? We need to check for change hook properties, etc. */
+ if (flag)
+ if (! (point - 1 > BEGV && ! property_change_between_p (point - 2, point)))
+ flag = 0;
+#endif
+
if (flag)
SET_PT (point - 1);