[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
(insert ?\n) spuriously calls before-change-functions twice. Help!
From: |
Alan Mackenzie |
Subject: |
(insert ?\n) spuriously calls before-change-functions twice. Help! |
Date: |
Tue, 5 Jan 2010 11:09:54 +0000 |
User-agent: |
Mutt/1.5.9i |
Hi, Emacs.
The following is a partial diagnosis of a bug reported by an AWK user.
(AWK Mode throws an error when require-final-newline is t).
In emacs -Q, in an AWK buffer, do M-: (insert ?\n). The following
happens:
1. before-change-functions is invoked with arguments (beg end) (16 16).
2. The NL is inserted at position 16.
3. before-change-functions is invoked with arguments (16 17).
This all happens before after-change-functions is invoked.
However, M-: (insert "\n") just does the Right Thing.
This second invocation of before-change-functions is surely a bug. I
can make this happen in a Fundamental Mode buffer in my normal Emacs
session, but not in Emacs -Q.
What is causing this spurious invocation? Does anybody have any idea?
I've perused the C source for `insert', without finding anything. Could
it be anything to do with text-properties?
Thanks for the help!
--
Alan Mackenzie (Nuremberg, Germany).
- (insert ?\n) spuriously calls before-change-functions twice. Help!,
Alan Mackenzie <=
- Re: (insert ?\n) spuriously calls before-change-functions twice. Help!, Stefan Monnier, 2010/01/05
- Re: (insert ?\n) spuriously calls before-change-functions twice. Help!, Alan Mackenzie, 2010/01/05
- Re: (insert ?\n) spuriously calls before-change-functions twice. Help!, Alan Mackenzie, 2010/01/19
- Re: (insert ?\n) spuriously calls before-change-functions twice. Help!, Chong Yidong, 2010/01/19
- Re: (insert ?\n) spuriously calls before-change-functions twice. Help!, Alan Mackenzie, 2010/01/19
- Re: (insert ?\n) spuriously calls before-change-functions twice. Help!, Chong Yidong, 2010/01/19
- Re: (insert ?\n) spuriously calls before-change-functions twice. Help!, Alan Mackenzie, 2010/01/19